History

xsk: Add launch time hardware offload support to XDP Tx metadata

Extend the XDP Tx metadata framework so that user can requests launch time hardware offload, where the Ethernet device will schedule the packet for transmission at a pre-determined time called launch time. The value of launch time is communicated from user space to Ethernet driver via launch_time field of struct xsk_tx_metadata.

Song Yoong Siang committed 1 year ago

Commit ca4419f1 parent 68b92ac10 files · +108 −0Browse files

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

Unified · Split

2 files
  1. include/uapi/linux/if_xdp.h +10 −0
  2. include/uapi/linux/netdev.h +3 −0
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 {