linux-hardened/tools/testing/selftests/bpf
Daniel Borkmann b1d9fc41aa bpf: add napi_id read access to __sk_buff
Add napi_id access to __sk_buff for socket filter program types, tc
program types and other bpf_convert_ctx_access() users. Having access
to skb->napi_id is useful for per RX queue listener siloing, f.e.
in combination with SO_ATTACH_REUSEPORT_EBPF and when busy polling is
used, meaning SO_REUSEPORT enabled listeners can then select the
corresponding socket at SYN time already [1]. The skb is marked via
skb_mark_napi_id() early in the receive path (e.g., napi_gro_receive()).

Currently, sockets can only use SO_INCOMING_NAPI_ID from 6d4339028b
("net: Introduce SO_INCOMING_NAPI_ID") as a socket option to look up
the NAPI ID associated with the queue for steering, which requires a
prior sk_mark_napi_id() after the socket was looked up.

Semantics for the __sk_buff napi_id access are similar, meaning if
skb->napi_id is < MIN_NAPI_ID (e.g. outgoing packets using sender_cpu),
then an invalid napi_id of 0 is returned to the program, otherwise a
valid non-zero napi_id.

  [1] http://netdevconf.org/2.1/slides/apr6/dumazet-BUSY-POLLING-Netdev-2.1.pdf

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-21 13:53:27 -04:00
..
.gitignore bpf: Add test_tag to .gitignore 2017-02-10 15:56:08 -05:00
bpf_util.h bpf: fix multiple issues in selftest suite and samples 2016-11-27 20:38:47 -05:00
config bpf: add initial suite for selftests 2016-10-18 11:35:55 -04:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-06 08:24:51 -07:00
test_iptunnel_common.h selftests/bpf: add a test for basic XDP functionality 2017-04-01 12:45:57 -07:00
test_kmod.sh selftests: do not require bash to run bpf tests 2017-01-05 13:19:47 -07:00
test_l4lb.c selftests/bpf: add l4 load balancer test based on sched_cls 2017-04-01 12:45:57 -07:00
test_lpm_map.c bpf: Remove bpf_sys.h from selftests 2017-02-10 15:56:08 -05:00
test_lru_map.c bpf: lru: Lower the PERCPU_NR_SCANS from 16 to 4 2017-04-17 13:55:52 -04:00
test_maps.c bpf: fix hashmap extra_elems logic 2017-03-22 14:12:18 -07:00
test_pkt_access.c selftests/bpf: add a test for overlapping packet range checks 2017-04-01 12:45:57 -07:00
test_progs.c selftests/bpf: add l4 load balancer test based on sched_cls 2017-04-01 12:45:57 -07:00
test_tag.c bpf: Remove bpf_sys.h from selftests 2017-02-10 15:56:08 -05:00
test_verifier.c bpf: add napi_id read access to __sk_buff 2017-04-21 13:53:27 -04:00
test_xdp.c selftests/bpf: add a test for basic XDP functionality 2017-04-01 12:45:57 -07:00