netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/4] libbpf: xsk improvements
@ 2019-06-03 13:19 Maciej Fijalkowski
  2019-06-03 13:19 ` [RFC PATCH bpf-next 1/4] libbpf: fill the AF_XDP fill queue before bind() call Maciej Fijalkowski
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Maciej Fijalkowski @ 2019-06-03 13:19 UTC (permalink / raw)
  To: magnus.karlsson, bjorn.topel, netdev
  Cc: ast, daniel, jakub.kicinski, jonathan.lemon, songliubraving

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


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-06-05  9:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03 13:19 [RFC PATCH bpf-next 0/4] libbpf: xsk improvements Maciej Fijalkowski
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).