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
69136913 BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
69146914 };
69156915
6916+enum {
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+
69166922 /* List of known BPF sock_ops operators.
69176923 * New entries can only be added at the end
69186924 */
@@ -7091,6 +7097,7 @@ enum { · 172 unmodified lines
70917097 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
70927098 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
70937099 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 */
70947101 };
70957102
70967103 enum {