History

bpf: Add rx_queue_mapping to bpf_sock

Add "rx_queue_mapping" to bpf_sock. This gives read access for the existing field (sk_rx_queue_mapping) of struct sock from bpf_sock. Semantics for the bpf_sock rx_queue_mapping access are similar to sk_rx_queue_get(), i.e the value NO_QUEUE_MAPPING is not allowed and -1 is returned in that case. This is useful for transmit queue selection based on the received queue index which is cached in the socket in the receive path. v3: Addressed review comments to add usecase in patch description, and fixed default value for rx_queue_mapping. v2: fixed build error for CONFIG_XPS wrapping, reported by kbuild test robot <lkp@intel.com>

Amritha Nambiar committed 6 years ago

Commit c3c16f21 parent e255d322 files · +19 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -3612,6 +3612,7 @@ struct bpf_sock { · 3611 unmodified lines
36123612 __u32 dst_ip4;
36133613 __u32 dst_ip6[4];
36143614 __u32 state;
3615+ __s32 rx_queue_mapping;
36153616 };
36163617
36173618 struct bpf_tcp_sock {