History

Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

Martin KaFai Lau says: ==================== pull-request: bpf-next 2025-02-20 We've added 19 non-merge commits during the last 8 day(s) which contain a total of 35 files changed, 1126 insertions(+), 53 deletions(-). The main changes are: 1) Add TCP_RTO_MAX_MS support to bpf_set/getsockopt, from Jason Xing 2) Add network TX timestamping support to BPF sock_ops, from Jason Xing 3) Add TX metadata Launch Time support, from Song Yoong Siang * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: igc: Add launch time support to XDP ZC igc: Refactor empty frame insertion for launch time support net: stmmac: Add launch time support to XDP ZC selftests/bpf: Add launch time request to xdp_hw_metadata xsk: Add launch time hardware offload support to XDP Tx metadata selftests/bpf: Add simple bpf tests in the tx path for timestamping feature bpf: Support selective sampling for bpf timestamping bpf: Add BPF_SOCK_OPS_TSTAMP_SENDMSG_CB callback bpf: Add BPF_SOCK_OPS_TSTAMP_ACK_CB callback bpf: Add BPF_SOCK_OPS_TSTAMP_SND_HW_CB callback bpf: Add BPF_SOCK_OPS_TSTAMP_SND_SW_CB callback bpf: Add BPF_SOCK_OPS_TSTAMP_SCHED_CB callback net-timestamp: Prepare for isolating two modes of SO_TIMESTAMPING bpf: Disable unsafe helpers in TX timestamping callbacks bpf: Prevent unsafe access to the sock fields in the BPF timestamping callback bpf: Prepare the sock_ops ctx and call bpf prog for TX timestamping bpf: Add networking timestamping support to bpf_get/setsockopt() selftests/bpf: Add rto max for bpf_setsockopt test bpf: Support TCP_RTO_MAX_MS for bpf_setsockopt ====================

Jakub Kicinski committed 1 year ago

Commit e8770092 parents 4b9c7d8 494a04435 files · +1126 −53Browse files

Showing the changes to include/uapi/linux (3 of 35 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/bpf.h +30 −0
  2. include/uapi/linux/if_xdp.h +10 −0
  3. include/uapi/linux/netdev.h +3 −0
include/uapi/linux/bpf.h+30−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 */
@@ -7025,6 +7031,29 @@ enum { · 106 unmodified lines
70257031 * by the kernel or the
70267032 * earlier bpf-progs.
70277033 */
7034+ BPF_SOCK_OPS_TSTAMP_SCHED_CB, /* Called when skb is passing
7035+ * through dev layer when
7036+ * SK_BPF_CB_TX_TIMESTAMPING
7037+ * feature is on.
7038+ */
7039+ BPF_SOCK_OPS_TSTAMP_SND_SW_CB, /* Called when skb is about to send
7040+ * to the nic when SK_BPF_CB_TX_TIMESTAMPING
7041+ * feature is on.
7042+ */
7043+ BPF_SOCK_OPS_TSTAMP_SND_HW_CB, /* Called in hardware phase when
7044+ * SK_BPF_CB_TX_TIMESTAMPING feature
7045+ * is on.
7046+ */
7047+ BPF_SOCK_OPS_TSTAMP_ACK_CB, /* Called when all the skbs in the
7048+ * same sendmsg call are acked
7049+ * when SK_BPF_CB_TX_TIMESTAMPING
7050+ * feature is on.
7051+ */
7052+ BPF_SOCK_OPS_TSTAMP_SENDMSG_CB, /* Called when every sendmsg syscall
7053+ * is triggered. It's used to correlate
7054+ * sendmsg timestamp with corresponding
7055+ * tskey.
7056+ */
70287057 };
70297058
70307059 /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
@@ -7091,6 +7120,7 @@ enum { · 60 unmodified lines
70917120 TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
70927121 TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
70937122 TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
7123+ SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
70947124 };
70957125
70967126 enum {
include/uapi/linux/if_xdp.h+10−0
@@ -127,6 +127,12 @@ struct xdp_options { · 126 unmodified lines
127127 */
128128 #define XDP_TXMD_FLAGS_CHECKSUM (1 << 1)
129129
130+/* Request launch time hardware offload. The device will schedule the packet for
131+ * transmission at a pre-determined time called launch time. The value of
132+ * launch time is communicated via launch_time field of struct xsk_tx_metadata.
133+ */
134+#define XDP_TXMD_FLAGS_LAUNCH_TIME (1 << 2)
135+
130136 /* AF_XDP offloads request. 'request' union member is consumed by the driver
131137 * when the packet is being transmitted. 'completion' union member is
132138 * filled by the driver when the transmit completion arrives.
@@ -142,6 +148,10 @@ struct xsk_tx_metadata { · 9 unmodified lines
142148 __u16 csum_start;
143149 /* Offset from csum_start where checksum should be stored. */
144150 __u16 csum_offset;
151+
152+ /* XDP_TXMD_FLAGS_LAUNCH_TIME */
153+ /* Launch time in nanosecond against the PTP HW Clock */
154+ __u64 launch_time;
145155 } request;
146156
147157 struct {
include/uapi/linux/netdev.h+3−0
@@ -59,10 +59,13 @@ enum netdev_xdp_rx_metadata { · 58 unmodified lines
5959 * by the driver.
6060 * @NETDEV_XSK_FLAGS_TX_CHECKSUM: L3 checksum HW offload is supported by the
6161 * driver.
62+ * @NETDEV_XSK_FLAGS_TX_LAUNCH_TIME_FIFO: Launch time HW offload is supported
63+ * by the driver.
6264 */
6365 enum netdev_xsk_flags {
6466 NETDEV_XSK_FLAGS_TX_TIMESTAMP = 1,
6567 NETDEV_XSK_FLAGS_TX_CHECKSUM = 2,
68+ NETDEV_XSK_FLAGS_TX_LAUNCH_TIME_FIFO = 4,
6669 };
6770
6871 enum netdev_queue_type {