This series fixes transmit burst error handling and adds hardware TCP
segmentation offload (TSO) for the Microsoft Azure MANA PMD.
Patch 1 drops packets that fail validation, counting them in
stats.errors and consuming them, so rte_eth_tx_burst() maintains a
contiguous prefix and short returns reflect only ring backpressure.
It also clamps segment limits to MAX_SGL_ENTRIES_FOR_TRANSMIT.
Patch 2 implements hardware TSO for IPv4 and IPv6 TCP traffic,
formatting SGE0 for headers and subsequent SGEs for payload, handling
GDMA work request flags, advertising RTE_ETH_TX_OFFLOAD_TCP_TSO, and
handling non-TSO fallback checksums.
Hardware TSO segmentation was verified on Azure Standard_D8ds_v6 (kernel
6.8.0-1067-azure, MANA PCI 7870:00:00.0; driver reports no firmware
version) between two VMs on one subnet using an earlier revision of
this series:
- VM A ran testpmd txonly, modified locally to emit TCP packets with
RTE_MBUF_F_TX_TCP_SEG set (not part of this series), after
"csum set ip hw 0", "csum set tcp hw 0" and "tso set 1460 0".
- VM B captured the frames with tcpdump on its kernel interface, GRO off.
- A 4000-byte IPv4 packet in a single mbuf, in mbufs with a header-only
first segment, and in mbufs with payload in the first segment, each
arrived as 1514, 1514 and 1080 byte frames with consecutive TCP
sequence numbers, per-segment IP IDs and valid IP and TCP checksums.
- Plain UDP with "tso set 0" was unaffected.
- The drop paths (packets exceeding segment limit, oversized MSS or
header) and IPv6 TSO were not exercised on hardware.
The v3 changes (hardware field bounds for MSS and header length,
loop bound, unsegmented fallback checksum masking, and dev_info limit
advertisement) were compile-tested but have not been re-run on hardware.
v3:
- Patch 1: no changes.
- Patch 2:
* Mask RTE_MBUF_F_TX_TCP_SEG in the non-TSO fallback branch so
rte_ipv4_phdr_cksum / rte_ipv6_phdr_cksum calculate the full L4
length into the pseudo-header checksum.
* Reject invalid TSO packets (tso_segsz > MANA_TSO_MAX_SEGSZ or
gso_hs > UINT8_MAX) to prevent hardware bitfield truncations.
* Reflect the extra SGE for TSO in dev_info by setting nb_seg_max to
max_sge - 1 (keeping nb_mtu_seg_max as max_sge) instead of a mana.rst
limitation note.
* Bound the TSO segment walk by expected_sge and verify SGE count.
* Streamline commit message and cover letter.
v2:
- Patch 1:
* Drop unsendable packets and return a separate consumed count (nb_done)
instead of breaking out of the burst; break only when the ring is full.
* Move MAX_SGL_ENTRIES_FOR_TRANSMIT clamp from patch 2 to patch 1, and
clamp dev_info nb_seg_max and nb_mtu_seg_max.
- Patch 2:
* Use the drop path for all per-packet TSO validation failures.
* Honour implied TCP checksum when RTE_MBUF_F_TX_TCP_SEG is set but the
packet is unsegmented.
* Move GDMA_WR_OOB_IN_SGL and GDMA_WR_PAD_BY_SGE0 adjacent to
struct gdma_work_request.
* Add release notes entry and update mana.ini feature matrix.
Tathagat Priyadarshi (2):
net/mana: fix transmit burst error handling
net/mana: add hardware TSO support
doc/guides/nics/features/mana.ini | 1 +
doc/guides/rel_notes/release_26_11.rst | 4 +
drivers/net/mana/gdma.c | 5 +
drivers/net/mana/mana.c | 9 +-
drivers/net/mana/mana.h | 9 +-
drivers/net/mana/tx.c | 206 +++++++++++++++++++++----
6 files changed, 195 insertions(+), 39 deletions(-)
--
2.43.0