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.
Showing the changes to include/uapi/linux (2 of 10 files). Show all
Unified · Split
| @@ -127,6 +127,12 @@ struct xdp_options { · 126 unmodified lines | |||
| 127 | */ | 127 | */ |
| 128 | #define XDP_TXMD_FLAGS_CHECKSUM (1 << 1) | 128 | #define XDP_TXMD_FLAGS_CHECKSUM (1 << 1) |
| 129 | 129 | ||
| 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 | |||
| 130 | /* AF_XDP offloads request. 'request' union member is consumed by the driver | 136 | /* AF_XDP offloads request. 'request' union member is consumed by the driver |
| 131 | * when the packet is being transmitted. 'completion' union member is | 137 | * when the packet is being transmitted. 'completion' union member is |
| 132 | * filled by the driver when the transmit completion arrives. | 138 | * filled by the driver when the transmit completion arrives. |
| @@ -142,6 +148,10 @@ struct xsk_tx_metadata { · 9 unmodified lines | |||
| 142 | __u16 csum_start; | 148 | __u16 csum_start; |
| 143 | /* Offset from csum_start where checksum should be stored. */ | 149 | /* Offset from csum_start where checksum should be stored. */ |
| 144 | __u16 csum_offset; | 150 | __u16 csum_offset; |
| 151 | |||
| 152 | /* XDP_TXMD_FLAGS_LAUNCH_TIME */ | ||
| 153 | /* Launch time in nanosecond against the PTP HW Clock */ | ||
| 154 | __u64 launch_time; | ||
| 145 | } request; | 155 | } request; |
| 146 | 156 | ||
| 147 | struct { | 157 | struct { |
| @@ -59,10 +59,13 @@ enum netdev_xdp_rx_metadata { · 58 unmodified lines | |||
| 59 | * by the driver. | 59 | * by the driver. |
| 60 | * @NETDEV_XSK_FLAGS_TX_CHECKSUM: L3 checksum HW offload is supported by the | 60 | * @NETDEV_XSK_FLAGS_TX_CHECKSUM: L3 checksum HW offload is supported by the |
| 61 | * driver. | 61 | * driver. |
| 62 | * @NETDEV_XSK_FLAGS_TX_LAUNCH_TIME_FIFO: Launch time HW offload is supported | ||
| 63 | * by the driver. | ||
| 62 | */ | 64 | */ |
| 63 | enum netdev_xsk_flags { | 65 | enum netdev_xsk_flags { |
| 64 | NETDEV_XSK_FLAGS_TX_TIMESTAMP = 1, | 66 | NETDEV_XSK_FLAGS_TX_TIMESTAMP = 1, |
| 65 | NETDEV_XSK_FLAGS_TX_CHECKSUM = 2, | 67 | NETDEV_XSK_FLAGS_TX_CHECKSUM = 2, |
| 68 | NETDEV_XSK_FLAGS_TX_LAUNCH_TIME_FIFO = 4, | ||
| 66 | }; | 69 | }; |
| 67 | 70 | ||
| 68 | enum netdev_queue_type { | 71 | enum netdev_queue_type { |