diff options
author | Nitin Hande <nitin.hande@gmail.com> | 2018-10-28 21:02:45 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-11-09 10:14:54 +0100 |
commit | c8123ead13a5c92dc5fd15c0fdfe88eef41e6ac1 (patch) | |
tree | bcaf2c624e5c4cf7f51fb33dd1c4bf115cc6c3fb /include | |
parent | bf598a8f0f771302d4ecb0ef0003c54732221597 (diff) | |
download | lwn-c8123ead13a5c92dc5fd15c0fdfe88eef41e6ac1.tar.gz lwn-c8123ead13a5c92dc5fd15c0fdfe88eef41e6ac1.zip |
bpf: Extend the sk_lookup() helper to XDP hookpoint.
This patch proposes to extend the sk_lookup() BPF API to the
XDP hookpoint. The sk_lookup() helper supports a lookup
on incoming packet to find the corresponding socket that will
receive this packet. Current support for this BPF API is
at the tc hookpoint. This patch will extend this API at XDP
hookpoint. A XDP program can map the incoming packet to the
5-tuple parameter and invoke the API to find the corresponding
socket structure.
Signed-off-by: Nitin Hande <Nitin.Hande@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/bpf.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 852dc17ab47a..47d606d744cc 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2201,6 +2201,8 @@ union bpf_attr { * **CONFIG_NET** configuration option. * Return * Pointer to *struct bpf_sock*, or NULL in case of failure. + * For sockets with reuseport option, *struct bpf_sock* + * return is from reuse->socks[] using hash of the packet. * * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags) * Description @@ -2233,6 +2235,8 @@ union bpf_attr { * **CONFIG_NET** configuration option. * Return * Pointer to *struct bpf_sock*, or NULL in case of failure. + * For sockets with reuseport option, *struct bpf_sock* + * return is from reuse->socks[] using hash of the packet. * * int bpf_sk_release(struct bpf_sock *sk) * Description |