OSDN Git Service

xsk: Store struct xdp_sock as a flexible array member of the XSKMAP
authorBjörn Töpel <bjorn.topel@intel.com>
Fri, 1 Nov 2019 11:03:44 +0000 (12:03 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Nov 2019 23:38:49 +0000 (00:38 +0100)
commit64fe8c061de7d7ffdfdc104a57d48d645ae0ac4f
tree874762fd9e7687d0218d8603329090abea2b71cc
parent75b0bfd2e1a7d0c698b617f5e5ceaf056bdcaef7
xsk: Store struct xdp_sock as a flexible array member of the XSKMAP

Prior this commit, the array storing XDP socket instances were stored
in a separate allocated array of the XSKMAP. Now, we store the sockets
as a flexible array member in a similar fashion as the arraymap. Doing
so, we do less pointer chasing in the lookup.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Link: https://lore.kernel.org/bpf/20191101110346.15004-2-bjorn.topel@gmail.com
kernel/bpf/xskmap.c