WSL2-Linux-Kernel/net/core
Jesper Dangaard Brouer 0cd917a4a8 xdp: rss hash types representation
The RSS hash type specifies what portion of packet data NIC hardware used
when calculating RSS hash value. The RSS types are focused on Internet
traffic protocols at OSI layers L3 and L4. L2 (e.g. ARP) often get hash
value zero and no RSS type. For L3 focused on IPv4 vs. IPv6, and L4
primarily TCP vs UDP, but some hardware supports SCTP.

Hardware RSS types are differently encoded for each hardware NIC. Most
hardware represent RSS hash type as a number. Determining L3 vs L4 often
requires a mapping table as there often isn't a pattern or sorting
according to ISO layer.

The patch introduce a XDP RSS hash type (enum xdp_rss_hash_type) that
contains both BITs for the L3/L4 types, and combinations to be used by
drivers for their mapping tables. The enum xdp_rss_type_bits get exposed
to BPF via BTF, and it is up to the BPF-programmer to match using these
defines.

This proposal change the kfunc API bpf_xdp_metadata_rx_hash() adding
a pointer value argument for provide the RSS hash type.
Change signature for all xmo_rx_hash calls in drivers to make it compile.

The RSS type implementations for each driver comes as separate patches.

Fixes: 3d76a4d3d4 ("bpf: XDP metadata RX kfuncs")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/168132892042.340624.582563003880565460.stgit@firesoul
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-04-13 11:15:10 -07:00
..
Makefile netdev-genl: create a simple family for netdev stuff 2023-02-02 20:48:23 -08:00
bpf_sk_storage.c
datagram.c
dev.c rtnetlink: Restore RTM_NEW/DELLINK notification behavior 2023-04-12 20:47:58 -07:00
dev.h net-sysctl: factor-out rpm mask manipulation helpers 2023-02-09 17:45:55 -08:00
dev_addr_lists.c
dev_addr_lists_test.c
dev_ioctl.c
drop_monitor.c
dst.c ipv6: remove max_size check inline with ipv4 2023-01-13 20:59:14 -08:00
dst_cache.c
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf: Add BPF_FIB_LOOKUP_SKIP_NEIGH for bpf_fib_lookup 2023-02-17 22:12:04 +01:00
flow_dissector.c
flow_offload.c
gen_estimator.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
gen_stats.c
gro.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-02-02 14:49:55 -08:00
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
neighbour.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-02-09 12:25:40 -08:00
net-procfs.c
net-sysfs.c net: make default_rps_mask a per netns attribute 2023-02-20 11:22:54 +00:00
net-sysfs.h
net-traces.c net: bridge: Add a tracepoint for MDB overflows 2023-02-06 08:48:25 +00:00
net_namespace.c net: initialize net->notrefcnt_tracker earlier 2023-02-09 22:49:25 -08:00
netclassid_cgroup.c
netdev-genl-gen.c ynl: broaden the license even more 2023-03-16 21:20:32 -07:00
netdev-genl-gen.h ynl: broaden the license even more 2023-03-16 21:20:32 -07:00
netdev-genl.c netdev-genl: create a simple family for netdev stuff 2023-02-02 20:48:23 -08:00
netevent.c
netpoll.c net: don't let netpoll invoke NAPI if in xmit context 2023-04-02 13:26:21 +01:00
netprio_cgroup.c
of_net.c
page_pool.c net: page_pool: use in_softirq() instead 2023-02-06 09:15:22 +00:00
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c rtnetlink: Restore RTM_NEW/DELLINK notification behavior 2023-04-12 20:47:58 -07:00
scm.c scm: add user copy checks to put_cmsg() 2023-02-20 11:39:59 +00:00
secure_seq.c
selftests.c
skbuff.c skbuff: Fix a race between coalescing and releasing SKBs 2023-04-13 10:08:42 -07:00
skmsg.c net/sock: Introduce trace_sk_data_ready() 2023-01-23 11:26:50 +00:00
sock.c net: use indirect calls helpers for sk_exit_memory_pressure() 2023-03-02 11:35:06 +01:00
sock_destructor.h
sock_diag.c
sock_map.c bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself 2023-01-24 21:32:55 -08:00
sock_reuseport.c
stream.c net: Remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues(). 2023-02-10 19:53:42 -08:00
sysctl_net_core.c net: make default_rps_mask a per netns attribute 2023-02-20 11:22:54 +00:00
timestamping.c
tso.c
utils.c
xdp.c xdp: rss hash types representation 2023-04-13 11:15:10 -07:00