Skip to content

Introduce bpf_link in libbpf's xsk

Maciej Fijalkowski bpf netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 33 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3libbpf: xsk: use bpf_linktools/lib/bpf/xsk.c+122 -2127 replies
2/3libbpf: clear map_info before each bpf_obj_get_info_by_fdtools/lib/bpf/xsk.c+3 -12 replies
3/3samples: bpf: do not unload prog within xdpsocksamples/bpf/xdpsock_user.c+14 -413 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBjörn Töpel
SeriesR-b A-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] Introduce bpf_link in libbpf's xsk

Hi,

This set is another approach towards addressing the below issue:

// load xdp prog and xskmap and add entry to xskmap at idx 10

$ sudo ./xdpsock -i ens801f0 -t -q 10

// add entry to xskmap at idx 11

$ sudo ./xdpsock -i ens801f0 -t -q 11

terminate one of the processes and another one is unable to work due to the fact that the XDP prog was unloaded from interface.

Previous attempt was, to put it mildly, a bit broken, as there was no synchronization between updates to additional map, as Bjorn pointed out. See https://lore.kernel.org/netdev/[email protected]/

In the meantime bpf_link was introduced and it seems that it can address the issue of refcounting the XDP prog on interface. More info on commit messages.

Thanks.

Maciej Fijalkowski (3):
libbpf: xsk: use bpf_link
libbpf: clear map_info before each bpf_obj_get_info_by_fd
samples: bpf: do not unload prog within xdpsock

 samples/bpf/xdpsock_user.c |  55 ++++----------
 tools/lib/bpf/xsk.c        | 147 +++++++++++++++++++++++++++++++------
 2 files changed, 139 insertions(+), 63 deletions(-)
Signature · 1 line
2.20.1