Wangxun fixes and new features
A message that is not in the archive (sent off-list or not yet received): [email protected]
v4 cover Wangxun fixes and new features
This patchset introduces three new features and critical fixes for our recent release cycle.
Patches 1-2 add support for UDP Segmentation Offload (USO) to improve large-packet transmission performance for UDP workloads.
Patch 3 enables VFs to sense PF ifconfig down/up events, allowing better fault tolerance and fast recovery in virtualized environments.
Patch 4 adds the missing VF support for the Amber-Lite 40G NICs, which was previously omitted in the initial integration.
---
v4:
- Patches 1-4: add release notes
- Patch 3: consume the mailbox message before checking the CTS flag; separate CTS validation from link status processing by returning early after handling a CTS-less control message; make pf_running atomic.
---
v3:
- Patches 1-2: change from new feature to bug fix.
- Patch 3: fix link status update in txgbevf_get_pf_link_status();
extend speed mask from 0xFFF0 to 0x1FFFFE for 40G speed;
reduce msgbuf array to a single u32 variable;
correct commit message.- Patch 4: add a cleanup note in commit message for dropping the redundant mac type check in txgbevf_check_mac_link_vf(); remove a redundant blank line in txgbe_reset_hw_vf().
---
v2:
- Rebased on top of commit 72fdcb7bd19d to resolve conflict in drivers/net/txgbe/base/txgbe_type.h.
- No code changes compared to v1.
---
Zaiyu Wang (4):
net/ngbe: implement USO support net/txgbe: implement USO support net/txgbe: add support for VF sensing PF down net/txgbe: add VF support for Amber-Lite 40G NIC
doc/guides/rel_notes/release_26_07.rst | 21 ++++++ drivers/net/ngbe/ngbe_rxtx.c | 13 ++-- drivers/net/txgbe/base/txgbe_devids.h | 2 + drivers/net/txgbe/base/txgbe_hw.c | 7 ++ drivers/net/txgbe/base/txgbe_regs.h | 7 +- drivers/net/txgbe/base/txgbe_type.h | 2 + drivers/net/txgbe/base/txgbe_vf.c | 6 +- drivers/net/txgbe/txgbe_ethdev.c | 5 +- drivers/net/txgbe/txgbe_ethdev_vf.c | 88 ++++++++++++++++++++++---- drivers/net/txgbe/txgbe_rxtx.c | 13 ++-- 10 files changed, 136 insertions(+), 28 deletions(-)
Signature · 1 line
2.21.0.windows.1
PATCH v4 1/4 net/ngbe: implement USO support
USO (UDP Segmentation Offload), also known as UFO (UDP Fragmentation Offload), is a hardware offload rarely seen in DPDK. Its implementation is similar to TSO (TCP Segmentation Offload), so the driver enables USO based on existing TSO support.
The driver has advertised RTE_ETH_TX_OFFLOAD_UDP_TSO in tx_offload_capa since its initial integration, but the data path never implemented the actual segmentation support. This commit fills that gap by enabling USO in the transmit path, making the advertised capability fully functional.
Note:
USO segments UDP packets, requiring hardware to recalculate both IP and UDP checksums due to length change. Thus, USO implicitly requires IP and UDP checksum offloads, same as TSO.
--- doc/guides/rel_notes/release_26_07.rst | 7 +++++++ drivers/net/ngbe/ngbe_rxtx.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-)
doc/guides/rel_notes/release_26_07.rst +7 -0
@@ -177,6 +177,13 @@ New Features Added AGENTS.md file for AI review and supporting scripts to review patches and documentation. +* **Updated Wangxun ngbe driver.** + + * Implemented UDP Segmentation Offload (USO) in the transmit path. + The ``RTE_ETH_TX_OFFLOAD_UDP_TSO`` capability was advertised since the + driver's initial integration but the data path was missing; it is now + functional. + Removed Items -------------
drivers/net/ngbe/ngbe_rxtx.c +8 -5
@@ -30,6 +30,7 @@ static const u64 NGBE_TX_OFFLOAD_MASK = (RTE_MBUF_F_TX_IP_CKSUM |RTE_MBUF_F_TX_VLAN |RTE_MBUF_F_TX_L4_MASK |RTE_MBUF_F_TX_TCP_SEG | +RTE_MBUF_F_TX_UDP_SEG | NGBE_TX_IEEE1588_TMST);#define NGBE_TX_OFFLOAD_NOTSUP_MASK \
@@ -317,7 +318,7 @@ ngbe_set_xmit_ctx(struct ngbe_tx_queue *txq, type_tucmd_mlhl |=NGBE_TXD_PTID (tx_offload.ptid);/* check if TCP segmentation required for this packet */ -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) { tx_offload_mask.l2_len |= ~0 ; tx_offload_mask.l3_len |= ~0 ; tx_offload_mask.l4_len |= ~0 ;
@@ -427,7 +428,7 @@ tx_desc_cksum_flags_to_olinfo(uint64_t ol_flags) tmp |=NGBE_TXD_CC ; tmp |=NGBE_TXD_EIPCS ; } -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) { tmp |=NGBE_TXD_CC ;/* implies IPv4 cksum */ if (ol_flags &RTE_MBUF_F_TX_IPV4 )
@@ -447,7 +448,7 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)if (ol_flags &RTE_MBUF_F_TX_VLAN ) cmdtype |=NGBE_TXD_VLE ; -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) cmdtype |=NGBE_TXD_TSE ;return cmdtype; }
@@ -483,6 +484,8 @@ tx_desc_ol_flags_to_ptype(uint64_t oflags)if (oflags &RTE_MBUF_F_TX_TCP_SEG ) ptype |=RTE_PTYPE_L4_TCP ; +else if (oflags &RTE_MBUF_F_TX_UDP_SEG ) + ptype |=RTE_PTYPE_L4_UDP ;return ptype; }
@@ -764,7 +767,7 @@ ngbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, olinfo_status =0 ;if (tx_ol_req) { -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) {/* when TSO is on, paylen in descriptor is the * not the packet len but the tcp payload len */
@@ -1991,7 +1994,7 @@ ngbe_get_tx_port_offloads(struct rte_eth_dev *dev)RTE_ETH_TX_OFFLOAD_TCP_CKSUM |RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |RTE_ETH_TX_OFFLOAD_TCP_TSO | -RTE_ETH_TX_OFFLOAD_UDP_TSO | +RTE_ETH_TX_OFFLOAD_UDP_TSO |RTE_ETH_TX_OFFLOAD_MULTI_SEGS ;if (hw->is_pf)
Signature · 1 line
2.21.0.windows.1
PATCH v4 2/4 net/txgbe: implement USO support
In reply to Zaiyu WangUSO (UDP Segmentation Offload), also known as UFO (UDP Fragmentation Offload), is a hardware offload rarely seen in DPDK. Its implementation is similar to TSO (TCP Segmentation Offload), so the driver enables USO based on existing TSO support.
The driver has advertised RTE_ETH_TX_OFFLOAD_UDP_TSO in tx_offload_capa since its initial integration, but the data path never implemented the actual segmentation support. This commit fills that gap by enabling USO in the transmit path, making the advertised capability fully functional.
Note:
USO segments UDP packets, requiring hardware to recalculate both IP and UDP checksums due to length change. Thus, USO implicitly requires IP and UDP checksum offloads, same as TSO.
--- doc/guides/rel_notes/release_26_07.rst | 7 +++++++ drivers/net/txgbe/txgbe_rxtx.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-)
doc/guides/rel_notes/release_26_07.rst +7 -0
@@ -184,6 +184,13 @@ New Features driver's initial integration but the data path was missing; it is now functional. +* **Updated Wangxun txgbe driver.** + + * Implemented UDP Segmentation Offload (USO) in the transmit path. + The ``RTE_ETH_TX_OFFLOAD_UDP_TSO`` capability was advertised since the + driver's initial integration but the data path was missing; it is now + functional. + Removed Items -------------
drivers/net/txgbe/txgbe_rxtx.c +8 -5
@@ -58,6 +58,7 @@ static const u64 TXGBE_TX_OFFLOAD_MASK = (RTE_MBUF_F_TX_IP_CKSUM |RTE_MBUF_F_TX_VLAN |RTE_MBUF_F_TX_L4_MASK |RTE_MBUF_F_TX_TCP_SEG | +RTE_MBUF_F_TX_UDP_SEG |RTE_MBUF_F_TX_TUNNEL_MASK |RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_OUTER_UDP_CKSUM |
@@ -367,7 +368,7 @@ txgbe_set_xmit_ctx(struct txgbe_tx_queue *txq, type_tucmd_mlhl |=TXGBE_TXD_PTID (tx_offload.ptid);/* check if TCP segmentation required for this packet */ -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) { tx_offload_mask.l2_len |= ~0 ; tx_offload_mask.l3_len |= ~0 ; tx_offload_mask.l4_len |= ~0 ;
@@ -517,7 +518,7 @@ tx_desc_cksum_flags_to_olinfo(uint64_t ol_flags) tmp |=TXGBE_TXD_CC ; tmp |=TXGBE_TXD_EIPCS ; } -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) { tmp |=TXGBE_TXD_CC ;/* implies IPv4 cksum */ if (ol_flags &RTE_MBUF_F_TX_IPV4 )
@@ -537,7 +538,7 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)if (ol_flags &RTE_MBUF_F_TX_VLAN ) cmdtype |=TXGBE_TXD_VLE ; -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) cmdtype |=TXGBE_TXD_TSE ;if (ol_flags &RTE_MBUF_F_TX_MACSEC ) cmdtype |=TXGBE_TXD_LINKSEC ;
@@ -587,6 +588,8 @@ tx_desc_ol_flags_to_ptype(uint64_t oflags)if (oflags &RTE_MBUF_F_TX_TCP_SEG ) ptype |= (tun ?RTE_PTYPE_INNER_L4_TCP :RTE_PTYPE_L4_TCP ); +else if (oflags &RTE_MBUF_F_TX_UDP_SEG ) + ptype |= (tun ?RTE_PTYPE_INNER_L4_UDP :RTE_PTYPE_L4_UDP );/* Tunnel */ switch (oflags &RTE_MBUF_F_TX_TUNNEL_MASK ) {
@@ -1071,7 +1074,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, olinfo_status =0 ;if (tx_ol_req) { -if (ol_flags &RTE_MBUF_F_TX_TCP_SEG ) { +if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG |RTE_MBUF_F_TX_UDP_SEG )) {/* when TSO is on, paylen in descriptor is the * not the packet len but the tcp payload len */
@@ -2389,7 +2392,7 @@ txgbe_get_tx_port_offloads(struct rte_eth_dev *dev)RTE_ETH_TX_OFFLOAD_TCP_CKSUM |RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |RTE_ETH_TX_OFFLOAD_TCP_TSO | -RTE_ETH_TX_OFFLOAD_UDP_TSO | +RTE_ETH_TX_OFFLOAD_UDP_TSO |RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO |RTE_ETH_TX_OFFLOAD_IP_TNL_TSO | RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
Signature · 1 line
2.21.0.windows.1
PATCH v4 3/4 net/txgbe: add support for VF sensing PF down
In reply to Zaiyu WangVFs should continue normal packet Rx/Tx after PF ifconfig down/up.
When mailbox messages lack the TXGBE_VT_MSGTYPE_CTS flag, the PF is considered down. In this state, the VF reports link down and stops transmitting. Upon detecting the loss of CTS, the VF sends a reset request to the PF. If the request succeeds (indicating PF recovery), the VF triggers an RTE_ETH_EVENT_INTR_RESET event to notify the application or users to reset the VF.
The write_posted() based VF_RESET request is the only recovery path:
the PF only marks this VF as ready (and starts sending CTS) after it processes VF_RESET, so this request is required for the VF to recover. write_posted() may busy-wait for the ACK in the interrupt thread, but the PF does not send further mailbox messages once it is down, so this blocking is not continuously triggered.
Additionally, hw->rx_loaded and hw->offset_loaded must be reset when PF ifconfig down; otherwise, because hardware counter registers are cleared during PF reset, the VF's software counters will overflow to 0xFFFFFFFF.
--- doc/guides/rel_notes/release_26_07.rst | 5 ++ drivers/net/txgbe/base/txgbe_type.h | 1 + drivers/net/txgbe/txgbe_ethdev.c | 4 +- drivers/net/txgbe/txgbe_ethdev_vf.c | 86 ++++++++++++++++++++++---- 4 files changed, 83 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_07.rst +5 -0
@@ -190,6 +190,11 @@ New Features The ``RTE_ETH_TX_OFFLOAD_UDP_TSO`` capability was advertised since the driver's initial integration but the data path was missing; it is now functional. + * Added support for VF sensing PF down. VFs now detect when the PF goes + down (via the mailbox ``TXGBE_VT_MSGTYPE_CTS`` flag) and report link + down. When the PF comes back, the VF triggers an + ``RTE_ETH_EVENT_INTR_RESET`` event so the application can reset the VF + and resume normal packet Rx/Tx. Removed Items
drivers/net/txgbe/base/txgbe_type.h +1 -0
@@ -883,6 +883,7 @@ struct txgbe_hw {rte_atomic32_t swfw_busy;u32 fec_mode;u32 cur_fec_link; +RTE_ATOMIC (bool ) pf_running; };struct txgbe_backplane_ability {
drivers/net/txgbe/txgbe_ethdev.c +3 -1
@@ -3150,7 +3150,9 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev, hw->mac.get_link_status = true; -if (intr->flags &TXGBE_FLAG_NEED_LINK_CONFIG ) +if (intr->flags &TXGBE_FLAG_NEED_LINK_CONFIG || + (txgbe_is_vf (hw) && !rte_atomic_load_explicit (&hw->pf_running, + rte_memory_order_acquire)))return rte_eth_linkstatus_set (dev, &link);/* check if it needs to wait to complete, if lsc interrupt is enabled */
drivers/net/txgbe/txgbe_ethdev_vf.c +74 -12
122 lines not on this page · raw message
Signature · 1 line
2.21.0.windows.1
PATCH v4 4/4 net/txgbe: add VF support for Amber-Lite 40G NIC
In reply to Zaiyu WangVF support for the 40G NIC was previously omitted; only the 25G VF was added. Now add 40G VF support based on the existing 25G VF implementation, with no major changes but only device ID adaptation.
Also, drop the redundant mac type check in txgbe_check_mac_link_vf(), as the function now handles all VF types uniformly.
--- doc/guides/rel_notes/release_26_07.rst | 2 ++ drivers/net/txgbe/base/txgbe_devids.h | 2 ++ drivers/net/txgbe/base/txgbe_hw.c | 7 +++++++ drivers/net/txgbe/base/txgbe_regs.h | 7 +++++-- drivers/net/txgbe/base/txgbe_type.h | 1 + drivers/net/txgbe/base/txgbe_vf.c | 6 +++--- drivers/net/txgbe/txgbe_ethdev.c | 1 + drivers/net/txgbe/txgbe_ethdev_vf.c | 2 ++ 8 files changed, 23 insertions(+), 5 deletions(-)
doc/guides/rel_notes/release_26_07.rst +2 -0
@@ -195,6 +195,8 @@ New Features down. When the PF comes back, the VF triggers an ``RTE_ETH_EVENT_INTR_RESET`` event so the application can reset the VF and resume normal packet Rx/Tx. + * Added VF support for the Amber-Lite 40G NIC variant, with new device + IDs ``0x503f`` and ``0x513f``. Removed Items
drivers/net/txgbe/base/txgbe_devids.h +2 -0
@@ -28,6 +28,8 @@#define TXGBE_DEV_ID_AML_VF 0x5001#define TXGBE_DEV_ID_AML5024_VF 0x5024#define TXGBE_DEV_ID_AML5124_VF 0x5124 +#define TXGBE_DEV_ID_AML503F_VF 0x503f +#define TXGBE_DEV_ID_AML513F_VF 0x513f/* * Subsystem IDs
drivers/net/txgbe/base/txgbe_hw.c +7 -0
@@ -2543,6 +2543,7 @@ s32 txgbe_init_shared_code(struct txgbe_hw *hw)break ;case txgbe_mac_sp_vf:case txgbe_mac_aml_vf: +case txgbe_mac_aml40_vf: status =txgbe_init_ops_vf (hw);break ;default :
@@ -2573,6 +2574,7 @@ bool txgbe_is_vf(struct txgbe_hw *hw)switch (hw->mac.type) {case txgbe_mac_sp_vf:case txgbe_mac_aml_vf: +case txgbe_mac_aml40_vf:return true;default :return false;
@@ -2620,6 +2622,11 @@ s32 txgbe_set_mac_type(struct txgbe_hw *hw) hw->phy.media_type = txgbe_media_type_virtual; hw->mac.type = txgbe_mac_aml_vf;break ; +case TXGBE_DEV_ID_AML503F_VF : +case TXGBE_DEV_ID_AML513F_VF : + hw->phy.media_type = txgbe_media_type_virtual; + hw->mac.type = txgbe_mac_aml40_vf; +break ;default : err =TXGBE_ERR_DEVICE_NOT_SUPPORTED ;DEBUGOUT ("Unsupported device id: %x" , hw->device_id);
drivers/net/txgbe/base/txgbe_regs.h +5 -2
@@ -1824,12 +1824,14 @@ txgbe_map_reg(struct txgbe_hw *hw, u32 reg)switch (reg) {case TXGBE_REG_RSSTBL :if (hw->mac.type == txgbe_mac_sp_vf || - hw->mac.type == txgbe_mac_aml_vf) + hw->mac.type == txgbe_mac_aml_vf || + hw->mac.type == txgbe_mac_aml40_vf) reg =TXGBE_VFRSSTBL (0 );break ;case TXGBE_REG_RSSKEY :if (hw->mac.type == txgbe_mac_sp_vf || - hw->mac.type == txgbe_mac_aml_vf) + hw->mac.type == txgbe_mac_aml_vf || + hw->mac.type == txgbe_mac_aml40_vf) reg =TXGBE_VFRSSKEY (0 );break ;default :
@@ -2012,6 +2014,7 @@ static inline void txgbe_flush(struct txgbe_hw *hw)break ;case txgbe_mac_sp_vf:case txgbe_mac_aml_vf: +case txgbe_mac_aml40_vf:rd32 (hw,TXGBE_VFSTATUS );break ;default :
drivers/net/txgbe/base/txgbe_type.h +1 -0
@@ -171,6 +171,7 @@ enum txgbe_mac_type { txgbe_mac_aml40, txgbe_mac_sp_vf, txgbe_mac_aml_vf, + txgbe_mac_aml40_vf, txgbe_num_macs };
drivers/net/txgbe/base/txgbe_vf.c +3 -3
@@ -134,7 +134,8 @@ s32 txgbe_reset_hw_vf(struct txgbe_hw *hw) }/* amlite: bme */ -if (hw->mac.type == txgbe_mac_aml_vf) +if (hw->mac.type == txgbe_mac_aml_vf || + hw->mac.type == txgbe_mac_aml40_vf)wr32 (hw,TXGBE_BME_AML ,0x1 );if (!timeout)
@@ -493,8 +494,7 @@ s32 txgbe_check_mac_link_vf(struct txgbe_hw *hw, u32 *speed,/* for SFP+ modules and DA cables it can take up to 500usecs * before the link status is correct */ -if ((mac->type == txgbe_mac_sp_vf || - mac->type == txgbe_mac_aml_vf) && wait_to_complete) { +if (wait_to_complete) {if (po32m (hw,TXGBE_VFSTATUS ,TXGBE_VFSTATUS_UP ,0 ,NULL ,5 ,100 )) goto out;
drivers/net/txgbe/txgbe_ethdev.c +1 -0
@@ -5229,6 +5229,7 @@ txgbe_rss_update(enum txgbe_mac_type mac_type)case txgbe_mac_aml:case txgbe_mac_aml40:case txgbe_mac_aml_vf: +case txgbe_mac_aml40_vf:return 1 ;default :return 0 ;
drivers/net/txgbe/txgbe_ethdev_vf.c +2 -0
@@ -77,6 +77,8 @@ static const struct rte_pci_id pci_id_txgbevf_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_AML_VF) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_AML5024_VF) }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_AML5124_VF) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_AML503F_VF) }, + { RTE_PCI_DEVICE(PCI_VENDOR_ID_WANGXUN, TXGBE_DEV_ID_AML513F_VF) }, { .vendor_id = 0, /* sentinel */ }, };
Signature · 1 line
2.21.0.windows.1
Stephen Hemminger
AppliedQuoted 11 lines · On Tue, 30 Jun 2026 19:16:00 +0800 Zaiyu Wang <[email protected]> wrote:
This patchset introduces three new features and critical fixes for our recent release cycle.
Patches 1-2 add support for UDP Segmentation Offload (USO) to improve large-packet transmission performance for UDP workloads.
Patch 3 enables VFs to sense PF ifconfig down/up events, allowing better fault tolerance and fast recovery in virtualized environments.
Patch 4 adds the missing VF support for the Amber-Lite 40G NICs, which was previously omitted in the initial integration.
Applied to net-next. Had to resolve a code merge conflict from earlier changes in net-next and also release note conflicts.
Quoted 9 lines
Quoted 6 lines · On Tue, 30 Jun 2026 19:16:00 +0800 Zaiyu Wang <[email protected]> wrote:
This patchset introduces three new features and critical fixes for our recent release cycle.
Patches 1-2 add support for UDP Segmentation Offload (USO) to improve large-packet transmission performance for UDP workloads.
Quoted 9 lines
Quoted 5 lines
Patch 3 enables VFs to sense PF ifconfig down/up events, allowing better fault tolerance and fast recovery in virtualized environments.
Patch 4 adds the missing VF support for the Amber-Lite 40G NICs, which was previously omitted in the initial integration.
Applied to net-next. Had to resolve a code merge conflict from earlier changes in net-next and also release note conflicts.
Thanks.