History

bpf: Support passing args to sock_ops bpf function

Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size.

Lawrence Brakmo committed 8 years ago

Commit de525be1 parent b73042b6 files · +42 −10Browse files

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

Unified · Split

include/uapi/linux/bpf.h+3−2
@@ -952,8 +952,9 @@ struct bpf_map_info { · 951 unmodified lines
952952 struct bpf_sock_ops {
953953 __u32 op;
954954 union {
955− __u32 reply;
956− __u32 replylong[4];
955+ __u32 args[4]; /* Optionally passed to bpf program */
956+ __u32 reply; /* Returned by bpf program */
957+ __u32 replylong[4]; /* Optionally returned by bpf prog */
957958 };
958959 __u32 family;
959960 __u32 remote_ip4; /* Stored in network byte order */