summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorAmritha Nambiar <amritha.nambiar@intel.com>2020-05-26 17:34:36 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-06-01 14:38:23 -0700
commitc3c16f2ea6d20159903cf93afbb1155f3d8348d5 (patch)
tree0948edc2fb124f13909092894f1946e0dfebcb43 /include/uapi/linux/bpf.h
parente255d3273920dfd2d4e1cf2afe565b942c122219 (diff)
downloadlinux-stable-c3c16f2ea6d20159903cf93afbb1155f3d8348d5.tar.gz
linux-stable-c3c16f2ea6d20159903cf93afbb1155f3d8348d5.tar.bz2
linux-stable-c3c16f2ea6d20159903cf93afbb1155f3d8348d5.zip
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> Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 974ca6e948e3..630432c5c292 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -3612,6 +3612,7 @@ struct bpf_sock {
__u32 dst_ip4;
__u32 dst_ip6[4];
__u32 state;
+ __s32 rx_queue_mapping;
};
struct bpf_tcp_sock {