@@ -50,6 +50,10 @@ The flags field enables the particular offload:
5050 checksum. ``csum_start `` specifies byte offset of where the checksumming
5151 should start and ``csum_offset `` specifies byte offset where the
5252 device should store the computed checksum.
53+ - ``XDP_TXMD_FLAGS_LAUNCH_TIME ``: requests the device to schedule the
54+ packet for transmission at a pre-determined time called launch time. The
55+ value of launch time is indicated by ``launch_time `` field of
56+ ``union xsk_tx_metadata ``.
5357
5458Besides the flags above, in order to trigger the offloads, the first
5559packet's ``struct xdp_desc `` descriptor should set ``XDP_TX_METADATA ``
@@ -65,6 +69,63 @@ In this case, when running in ``XDK_COPY`` mode, the TX checksum
6569is calculated on the CPU. Do not enable this option in production because
6670it will negatively affect performance.
6771
72+ Launch Time
73+ ===========
74+
75+ The value of the requested launch time should be based on the device's PTP
76+ Hardware Clock (PHC) to ensure accuracy. AF_XDP takes a different data path
77+ compared to the ETF queuing discipline, which organizes packets and delays
78+ their transmission. Instead, AF_XDP immediately hands off the packets to
79+ the device driver without rearranging their order or holding them prior to
80+ transmission. Since the driver maintains FIFO behavior and does not perform
81+ packet reordering, a packet with a launch time request will block other
82+ packets in the same Tx Queue until it is sent. Therefore, it is recommended
83+ to allocate separate queue for scheduling traffic that is intended for
84+ future transmission.
85+
86+ In scenarios where the launch time offload feature is disabled, the device
87+ driver is expected to disregard the launch time request. For correct
88+ interpretation and meaningful operation, the launch time should never be
89+ set to a value larger than the farthest programmable time in the future
90+ (the horizon). Different devices have different hardware limitations on the
91+ launch time offload feature.
92+
93+ stmmac driver
94+ -------------
95+
96+ For stmmac, TSO and launch time (TBS) features are mutually exclusive for
97+ each individual Tx Queue. By default, the driver configures Tx Queue 0 to
98+ support TSO and the rest of the Tx Queues to support TBS. The launch time
99+ hardware offload feature can be enabled or disabled by using the tc-etf
100+ command to call the driver's ndo_setup_tc() callback.
101+
102+ The value of the launch time that is programmed in the Enhanced Normal
103+ Transmit Descriptors is a 32-bit value, where the most significant 8 bits
104+ represent the time in seconds and the remaining 24 bits represent the time
105+ in 256 ns increments. The programmed launch time is compared against the
106+ PTP time (bits[39:8]) and rolls over after 256 seconds. Therefore, the
107+ horizon of the launch time for dwmac4 and dwxlgmac2 is 128 seconds in the
108+ future.
109+
110+ igc driver
111+ ----------
112+
113+ For igc, all four Tx Queues support the launch time feature. The launch
114+ time hardware offload feature can be enabled or disabled by using the
115+ tc-etf command to call the driver's ndo_setup_tc() callback. When entering
116+ TSN mode, the igc driver will reset the device and create a default Qbv
117+ schedule with a 1-second cycle time, with all Tx Queues open at all times.
118+
119+ The value of the launch time that is programmed in the Advanced Transmit
120+ Context Descriptor is a relative offset to the starting time of the Qbv
121+ transmission window of the queue. The Frst flag of the descriptor can be
122+ set to schedule the packet for the next Qbv cycle. Therefore, the horizon
123+ of the launch time for i225 and i226 is the ending time of the next cycle
124+ of the Qbv transmission window of the queue. For example, when the Qbv
125+ cycle time is set to 1 second, the horizon of the launch time ranges
126+ from 1 second to 2 seconds, depending on where the Qbv cycle is currently
127+ running.
128+
68129Querying Device Capabilities
69130============================
70131
@@ -74,6 +135,7 @@ Refer to ``xsk-flags`` features bitmask in
74135
75136- ``tx-timestamp ``: device supports ``XDP_TXMD_FLAGS_TIMESTAMP ``
76137- ``tx-checksum ``: device supports ``XDP_TXMD_FLAGS_CHECKSUM ``
138+ - ``tx-launch-time-fifo ``: device supports ``XDP_TXMD_FLAGS_LAUNCH_TIME ``
77139
78140See ``tools/net/ynl/samples/netdev.c `` on how to query this information.
79141
0 commit comments