All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciejromanfijalkowski@gmail.com>
To: magnus.karlsson@intel.com, bjorn.topel@intel.com, netdev@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net,
	jakub.kicinski@netronome.com, jonathan.lemon@gmail.com,
	songliubraving@fb.com
Subject: [RFC PATCH bpf-next 0/4] libbpf: xsk improvements
Date: Mon,  3 Jun 2019 15:19:03 +0200	[thread overview]
Message-ID: <20190603131907.13395-1-maciej.fijalkowski@intel.com> (raw)

Hello,
This set contains fixes for libbpf's AF_XDP support. For patches 1-3 please
have a look at commit messages, 4th patch needs a bit more discussion.

Patch 4 tries to address the issue of dangling xsksocks in case when there were
many instances of those running on a particular interface and one of them got
removed. The case is that we don't keep an information about how many entries
are currently used in eBPF maps, so there's a need for having an external
counter, or we could just be traversing the map via
bpf_map_get_next_key/bpf_map_lookup_elem syscall combination, but IMHO that's a
no-go since the maps used in libbpf's xsk get preallocated entries. The count
of entries is equal to number of HW queues present on a working interface,
which means many unnecessary operations as CPUs are getting more and more cores
and normally NICs are allocating HW queue per CPU core.

For xsk counter we could have for example additional entry in qidconf_map, but
that map is removed in Jonathan's patches, so that's not an option. The
resolution I gave a shot is to have a pinned map with a single entry. Further
reasoning is included in commit message of fourth patch.

Thanks!

Maciej Fijalkowski (4):
  libbpf: fill the AF_XDP fill queue before bind() call
  libbpf: check for channels.max_{t,r}x in xsk_get_max_queues
  libbpf: move xdp program removal to libbpf
  libbpf: don't remove eBPF resources when other xsks are present

 samples/bpf/xdpsock_user.c |  48 ++++--------------
 tools/lib/bpf/xsk.c        | 124 +++++++++++++++++++++++++++++++++++++++------
 tools/lib/bpf/xsk.h        |   1 +
 3 files changed, 120 insertions(+), 53 deletions(-)

-- 
2.16.1


             reply	other threads:[~2019-06-03 13:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 13:19 Maciej Fijalkowski [this message]
2019-06-03 13:19 ` [RFC PATCH bpf-next 1/4] libbpf: fill the AF_XDP fill queue before bind() call Maciej Fijalkowski
2019-06-04  8:06   ` Björn Töpel
2019-06-04 15:04     ` Maciej Fijalkowski
2019-06-04 15:54       ` Jonathan Lemon
2019-06-05  9:00       ` Björn Töpel
2019-06-03 13:19 ` [RFC PATCH bpf-next 2/4] libbpf: check for channels.max_{t,r}x in xsk_get_max_queues Maciej Fijalkowski
2019-06-04  8:06   ` Björn Töpel
2019-06-04 15:05     ` Maciej Fijalkowski
2019-06-03 13:19 ` [RFC PATCH bpf-next 3/4] libbpf: move xdp program removal to libbpf Maciej Fijalkowski
2019-06-04  8:07   ` Björn Töpel
2019-06-04 15:06     ` Maciej Fijalkowski
2019-06-05  9:03       ` Björn Töpel
2019-06-03 13:19 ` [RFC PATCH bpf-next 4/4] libbpf: don't remove eBPF resources when other xsks are present Maciej Fijalkowski
2019-06-03 18:26   ` Jonathan Lemon
2019-06-04  8:08   ` Björn Töpel
2019-06-04 15:07     ` Maciej Fijalkowski
2019-06-05  9:26       ` Björn Töpel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190603131907.13395-1-maciej.fijalkowski@intel.com \
    --to=maciejromanfijalkowski@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.