History

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.

Nitin Hande committed 8 years ago

Commit c8123ea1 parent bf598a82 files · +90 −19Browse files

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

Unified · Split

include/uapi/linux/bpf.h+4−0
@@ -2201,6 +2201,8 @@ union bpf_attr { · 2200 unmodified lines
2201 * **CONFIG_NET** configuration option.2201 * **CONFIG_NET** configuration option.
2202 * Return2202 * Return
2203 * Pointer to *struct bpf_sock*, or NULL in case of failure.2203 * Pointer to *struct bpf_sock*, or NULL in case of failure.
2204 * For sockets with reuseport option, *struct bpf_sock*
2205 * return is from reuse->socks[] using hash of the packet.
2204 *2206 *
2205 * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)2207 * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u32 netns, u64 flags)
2206 * Description2208 * Description
@@ -2233,6 +2235,8 @@ union bpf_attr { · 26 unmodified lines
2233 * **CONFIG_NET** configuration option.2235 * **CONFIG_NET** configuration option.
2234 * Return2236 * Return
2235 * Pointer to *struct bpf_sock*, or NULL in case of failure.2237 * Pointer to *struct bpf_sock*, or NULL in case of failure.
2238 * For sockets with reuseport option, *struct bpf_sock*
2239 * return is from reuse->socks[] using hash of the packet.
2236 *2240 *
2237 * int bpf_sk_release(struct bpf_sock *sk)2241 * int bpf_sk_release(struct bpf_sock *sk)
2238 * Description2242 * Description

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t