History

bpf: Add networking timestamping support to bpf_get/setsockopt()

The new SK_BPF_CB_FLAGS and new SK_BPF_CB_TX_TIMESTAMPING are added to bpf_get/setsockopt. The later patches will implement the BPF networking timestamping. The BPF program will use bpf_setsockopt(SK_BPF_CB_FLAGS, SK_BPF_CB_TX_TIMESTAMPING) to enable the BPF networking timestamping on a socket.

Jason Xing committed 1 year ago

Commit 24e82b71 parent 09bc97b4 files · +40 −0Browse files

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

Unified · Split

include/uapi/linux/bpf.h+7−0
@@ -6913,6 +6913,12 @@ enum { · 6912 unmodified lines
6913 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,6913 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
6914};6914};
6915 6915
6916enum {
6917 SK_BPF_CB_TX_TIMESTAMPING = 1<<0,
6918 SK_BPF_CB_MASK = (SK_BPF_CB_TX_TIMESTAMPING - 1) |
6919 SK_BPF_CB_TX_TIMESTAMPING
6920};
6921
6916/* List of known BPF sock_ops operators.6922/* List of known BPF sock_ops operators.
6917 * New entries can only be added at the end6923 * New entries can only be added at the end
6918 */6924 */
@@ -7091,6 +7097,7 @@ enum { · 172 unmodified lines
7091 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */7097 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
7092 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */7098 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
7093 TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */7099 TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
7100 SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
7094};7101};
7095 7102
7096enum {7103enum {