* [PATCH 1/4] net/ngbe: add USO support
2026-06-17 10:59 [PATCH 0/4] Wangxun new feature Zaiyu Wang
@ 2026-06-17 10:59 ` Zaiyu Wang
2026-06-17 10:59 ` [PATCH 2/4] net/txgbe: " Zaiyu Wang
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 10:59 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
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.
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.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/ngbe/ngbe_rxtx.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c
index 91e215694c..a1389de9c0 100644
--- a/drivers/net/ngbe/ngbe_rxtx.c
+++ b/drivers/net/ngbe/ngbe_rxtx.c
@@ -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)
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 2/4] net/txgbe: add USO support
2026-06-17 10:59 [PATCH 0/4] Wangxun new feature Zaiyu Wang
2026-06-17 10:59 ` [PATCH 1/4] net/ngbe: add USO support Zaiyu Wang
@ 2026-06-17 10:59 ` Zaiyu Wang
2026-06-17 10:59 ` [PATCH 3/4] net/txgbe: add support for VF sensing PF down Zaiyu Wang
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 10:59 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
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.
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.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/txgbe/txgbe_rxtx.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index f51c6193a9..77ec9f1e39 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -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 |
@@ -366,7 +367,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;
@@ -516,7 +517,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)
@@ -536,7 +537,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;
@@ -586,6 +587,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
*/
@@ -2395,7 +2398,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 |
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 3/4] net/txgbe: add support for VF sensing PF down
2026-06-17 10:59 [PATCH 0/4] Wangxun new feature Zaiyu Wang
2026-06-17 10:59 ` [PATCH 1/4] net/ngbe: add USO support Zaiyu Wang
2026-06-17 10:59 ` [PATCH 2/4] net/txgbe: " Zaiyu Wang
@ 2026-06-17 10:59 ` Zaiyu Wang
2026-06-17 10:59 ` [PATCH 4/4] net/txgbe: add VF support for Amber-Lite 40G NIC Zaiyu Wang
` (2 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 10:59 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
VFs should continue normal packet Rx/Tx after PF ifconfig down/up.
To achieve this, cooperate with mailbox commands added in our Linux
kernel driver txgbe-2.2.0. Detect PF ifconfig down when
TXGBE_VT_MSGTYPE_SPEC is present in mailbox commands. Detect PF ifconfig
up when mailbox commands lack TXGBE_VT_MSGTYPE_CTS. Upon detection PF
up, the VF needs to reset; the driver sets a reset callback to prompt
users to reset the VF.
Additionally, hw->rx_loaded and hw->offset_loaded must be reset after
PF ifconfig up; otherwise, because hardware counter registers are cleared
during PF reset, the VF's software counters will overflow to 0xFFFFFFFF.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/txgbe/base/txgbe_type.h | 1 +
drivers/net/txgbe/txgbe_ethdev.c | 3 +-
drivers/net/txgbe/txgbe_ethdev_vf.c | 58 +++++++++++++++++++++++++----
3 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index 2e2d79e0e1..d9d08b79a2 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -909,6 +909,7 @@ struct txgbe_hw {
bool an_done;
u32 fsm;
u64 bp_event_interval;
+ bool pf_running;
};
typedef enum {
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 2ed9a8c179..6e7ac1320f 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -3387,7 +3387,8 @@ 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) && !hw->pf_running))
return rte_eth_linkstatus_set(dev, &link);
/* check if it needs to wait to complete, if lsc interrupt is enabled */
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 7a50c7a855..7ec1e009ed 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -281,6 +281,7 @@ eth_txgbevf_dev_init(struct rte_eth_dev *eth_dev)
hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
+ hw->pf_running = true;
/* initialize the vfta */
memset(shadow_vfta, 0, sizeof(*shadow_vfta));
@@ -1405,8 +1406,18 @@ static s32 txgbevf_get_pf_link_status(struct rte_eth_dev *dev)
if (retval)
return 0;
+ if (!(msgbuf[0] & TXGBE_NOFITY_VF_LINK_STATUS))
+ return 0;
+
rte_eth_linkstatus_get(dev, &link);
+ if (!hw->pf_running) {
+ link_up = false;
+ link_speed = TXGBE_LINK_SPEED_UNKNOWN;
+ link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
+ return rte_eth_linkstatus_set(dev, &link);
+ }
+
link_up = msgbuf[1] & TXGBE_VFSTATUS_UP;
link_speed = (msgbuf[1] & 0xFFF0) >> 1;
@@ -1434,10 +1445,22 @@ static s32 txgbevf_get_pf_link_status(struct rte_eth_dev *dev)
static void txgbevf_check_link_for_intr(struct rte_eth_dev *dev)
{
struct rte_eth_link orig_link, new_link;
+ struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
rte_eth_linkstatus_get(dev, &orig_link);
- txgbevf_dev_link_update(dev, 0);
- rte_eth_linkstatus_get(dev, &new_link);
+
+ if (hw->pf_running) {
+ txgbevf_dev_link_update(dev, 0);
+ rte_eth_linkstatus_get(dev, &new_link);
+ } else {
+ DEBUGOUT("PF ifconfig down, so VF link down");
+ new_link.link_status = RTE_ETH_LINK_DOWN;
+ new_link.link_speed = RTE_ETH_SPEED_NUM_NONE;
+ new_link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
+ new_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
+ RTE_ETH_LINK_SPEED_FIXED);
+ rte_eth_linkstatus_set(dev, &new_link);
+ }
PMD_DRV_LOG(INFO, "orig_link: %d, new_link: %d",
orig_link.link_status, new_link.link_status);
@@ -1450,6 +1473,8 @@ static void txgbevf_check_link_for_intr(struct rte_eth_dev *dev)
static void txgbevf_mbx_process(struct rte_eth_dev *dev)
{
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
+ struct txgbe_mbx_info *mbx = &hw->mbx;
+ u32 msgbuf[TXGBE_VF_PERMADDR_MSG_LEN] = {0};
u32 in_msg = 0;
/* peek the message first */
@@ -1457,14 +1482,33 @@ static void txgbevf_mbx_process(struct rte_eth_dev *dev)
/* PF reset VF event */
if (in_msg & TXGBE_PF_CONTROL_MSG) {
- if (in_msg & TXGBE_NOFITY_VF_LINK_STATUS) {
+ /* msg is not CTS, we need to do reset */
+ if (!(in_msg & TXGBE_VT_MSGTYPE_CTS)) {
+ /* send reset to PF to reconfig CTS flag */
+ int err = 0;
+
+ msgbuf[0] = TXGBE_VF_RESET;
+ err = mbx->write_posted(hw, msgbuf, 1, 0);
+ if (err) {
+ hw->pf_running = false;
+ txgbevf_check_link_for_intr(dev);
+ } else {
+ hw->pf_running = true;
+ rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+ NULL);
+ }
+ }
+
+ if (in_msg & TXGBE_NOFITY_VF_LINK_STATUS)
txgbevf_get_pf_link_status(dev);
- } else {
- /* dummy mbx read to ack pf */
- txgbe_read_mbx(hw, &in_msg, 1, 0);
+ else
/* check link status if pf ping vf */
txgbevf_check_link_for_intr(dev);
- }
+ }
+
+ if (!hw->pf_running) {
+ hw->rx_loaded = true;
+ hw->offset_loaded = true;
}
}
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH 4/4] net/txgbe: add VF support for Amber-Lite 40G NIC
2026-06-17 10:59 [PATCH 0/4] Wangxun new feature Zaiyu Wang
` (2 preceding siblings ...)
2026-06-17 10:59 ` [PATCH 3/4] net/txgbe: add support for VF sensing PF down Zaiyu Wang
@ 2026-06-17 10:59 ` Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 0/4] Wangxun new feature Zaiyu Wang
2026-06-17 15:36 ` [PATCH 0/4] Wangxun new feature Stephen Hemminger
5 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 10:59 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
VF 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.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
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 | 7 ++++---
drivers/net/txgbe/txgbe_ethdev.c | 1 +
drivers/net/txgbe/txgbe_ethdev_vf.c | 2 ++
7 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/net/txgbe/base/txgbe_devids.h b/drivers/net/txgbe/base/txgbe_devids.h
index b7133c7d54..f5454ffbb1 100644
--- a/drivers/net/txgbe/base/txgbe_devids.h
+++ b/drivers/net/txgbe/base/txgbe_devids.h
@@ -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
diff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c
index c84656e206..2650b8b7f1 100644
--- a/drivers/net/txgbe/base/txgbe_hw.c
+++ b/drivers/net/txgbe/base/txgbe_hw.c
@@ -2552,6 +2552,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:
@@ -2582,6 +2583,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;
@@ -2629,6 +2631,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);
diff --git a/drivers/net/txgbe/base/txgbe_regs.h b/drivers/net/txgbe/base/txgbe_regs.h
index 3c4c696c00..bf46a80862 100644
--- a/drivers/net/txgbe/base/txgbe_regs.h
+++ b/drivers/net/txgbe/base/txgbe_regs.h
@@ -1829,12 +1829,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:
@@ -2017,6 +2019,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:
diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index d9d08b79a2..4b5ff7da17 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -174,6 +174,7 @@ enum txgbe_mac_type {
txgbe_mac_aml40,
txgbe_mac_sp_vf,
txgbe_mac_aml_vf,
+ txgbe_mac_aml40_vf,
txgbe_num_macs
};
diff --git a/drivers/net/txgbe/base/txgbe_vf.c b/drivers/net/txgbe/base/txgbe_vf.c
index 1a8a20f104..4412006f1f 100644
--- a/drivers/net/txgbe/base/txgbe_vf.c
+++ b/drivers/net/txgbe/base/txgbe_vf.c
@@ -134,7 +134,9 @@ 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 +495,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;
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 6e7ac1320f..16a548e6d0 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -5602,6 +5602,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;
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 7ec1e009ed..655ccc622f 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -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 */ },
};
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 0/4] Wangxun new feature
2026-06-17 10:59 [PATCH 0/4] Wangxun new feature Zaiyu Wang
` (3 preceding siblings ...)
2026-06-17 10:59 ` [PATCH 4/4] net/txgbe: add VF support for Amber-Lite 40G NIC Zaiyu Wang
@ 2026-06-17 11:33 ` Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 1/4] net/ngbe: add USO support Zaiyu Wang
` (3 more replies)
2026-06-17 15:36 ` [PATCH 0/4] Wangxun new feature Stephen Hemminger
5 siblings, 4 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 11:33 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang
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.
---
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: add USO support
net/txgbe: add USO support
net/txgbe: add support for VF sensing PF down
net/txgbe: add VF support for Amber-Lite 40G NIC
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 | 7 ++--
drivers/net/txgbe/txgbe_ethdev.c | 4 +-
drivers/net/txgbe/txgbe_ethdev_vf.c | 60 +++++++++++++++++++++++----
drivers/net/txgbe/txgbe_rxtx.c | 13 +++---
9 files changed, 92 insertions(+), 23 deletions(-)
--
2.21.0.windows.1
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 1/4] net/ngbe: add USO support
2026-06-17 11:33 ` [PATCH v2 0/4] Wangxun new feature Zaiyu Wang
@ 2026-06-17 11:33 ` Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 2/4] net/txgbe: " Zaiyu Wang
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 11:33 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
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.
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.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/ngbe/ngbe_rxtx.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c
index 91e215694c..a1389de9c0 100644
--- a/drivers/net/ngbe/ngbe_rxtx.c
+++ b/drivers/net/ngbe/ngbe_rxtx.c
@@ -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)
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 2/4] net/txgbe: add USO support
2026-06-17 11:33 ` [PATCH v2 0/4] Wangxun new feature Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 1/4] net/ngbe: add USO support Zaiyu Wang
@ 2026-06-17 11:33 ` Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 3/4] net/txgbe: add support for VF sensing PF down Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 4/4] net/txgbe: add VF support for Amber-Lite 40G NIC Zaiyu Wang
3 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 11:33 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
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.
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.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/txgbe/txgbe_rxtx.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index e2cd9b8841..c4cbdbc2b4 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -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 |
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 3/4] net/txgbe: add support for VF sensing PF down
2026-06-17 11:33 ` [PATCH v2 0/4] Wangxun new feature Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 1/4] net/ngbe: add USO support Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 2/4] net/txgbe: " Zaiyu Wang
@ 2026-06-17 11:33 ` Zaiyu Wang
2026-06-17 11:33 ` [PATCH v2 4/4] net/txgbe: add VF support for Amber-Lite 40G NIC Zaiyu Wang
3 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 11:33 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
VFs should continue normal packet Rx/Tx after PF ifconfig down/up.
To achieve this, cooperate with mailbox commands added in our Linux
kernel driver txgbe-2.2.0. Detect PF ifconfig down when
TXGBE_VT_MSGTYPE_SPEC is present in mailbox commands. Detect PF ifconfig
up when mailbox commands lack TXGBE_VT_MSGTYPE_CTS. Upon detection PF
up, the VF needs to reset; the driver sets a reset callback to prompt
users to reset the VF.
Additionally, hw->rx_loaded and hw->offset_loaded must be reset after
PF ifconfig up; otherwise, because hardware counter registers are cleared
during PF reset, the VF's software counters will overflow to 0xFFFFFFFF.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
drivers/net/txgbe/base/txgbe_type.h | 1 +
drivers/net/txgbe/txgbe_ethdev.c | 3 +-
drivers/net/txgbe/txgbe_ethdev_vf.c | 58 +++++++++++++++++++++++++----
3 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index ede780321f..956080c702 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -883,6 +883,7 @@ struct txgbe_hw {
rte_atomic32_t swfw_busy;
u32 fec_mode;
u32 cur_fec_link;
+ bool pf_running;
};
struct txgbe_backplane_ability {
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 0f484dfe91..003a24141c 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -3150,7 +3150,8 @@ 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) && !hw->pf_running))
return rte_eth_linkstatus_set(dev, &link);
/* check if it needs to wait to complete, if lsc interrupt is enabled */
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 7a50c7a855..7ec1e009ed 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -281,6 +281,7 @@ eth_txgbevf_dev_init(struct rte_eth_dev *eth_dev)
hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
+ hw->pf_running = true;
/* initialize the vfta */
memset(shadow_vfta, 0, sizeof(*shadow_vfta));
@@ -1405,8 +1406,18 @@ static s32 txgbevf_get_pf_link_status(struct rte_eth_dev *dev)
if (retval)
return 0;
+ if (!(msgbuf[0] & TXGBE_NOFITY_VF_LINK_STATUS))
+ return 0;
+
rte_eth_linkstatus_get(dev, &link);
+ if (!hw->pf_running) {
+ link_up = false;
+ link_speed = TXGBE_LINK_SPEED_UNKNOWN;
+ link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
+ return rte_eth_linkstatus_set(dev, &link);
+ }
+
link_up = msgbuf[1] & TXGBE_VFSTATUS_UP;
link_speed = (msgbuf[1] & 0xFFF0) >> 1;
@@ -1434,10 +1445,22 @@ static s32 txgbevf_get_pf_link_status(struct rte_eth_dev *dev)
static void txgbevf_check_link_for_intr(struct rte_eth_dev *dev)
{
struct rte_eth_link orig_link, new_link;
+ struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
rte_eth_linkstatus_get(dev, &orig_link);
- txgbevf_dev_link_update(dev, 0);
- rte_eth_linkstatus_get(dev, &new_link);
+
+ if (hw->pf_running) {
+ txgbevf_dev_link_update(dev, 0);
+ rte_eth_linkstatus_get(dev, &new_link);
+ } else {
+ DEBUGOUT("PF ifconfig down, so VF link down");
+ new_link.link_status = RTE_ETH_LINK_DOWN;
+ new_link.link_speed = RTE_ETH_SPEED_NUM_NONE;
+ new_link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
+ new_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
+ RTE_ETH_LINK_SPEED_FIXED);
+ rte_eth_linkstatus_set(dev, &new_link);
+ }
PMD_DRV_LOG(INFO, "orig_link: %d, new_link: %d",
orig_link.link_status, new_link.link_status);
@@ -1450,6 +1473,8 @@ static void txgbevf_check_link_for_intr(struct rte_eth_dev *dev)
static void txgbevf_mbx_process(struct rte_eth_dev *dev)
{
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
+ struct txgbe_mbx_info *mbx = &hw->mbx;
+ u32 msgbuf[TXGBE_VF_PERMADDR_MSG_LEN] = {0};
u32 in_msg = 0;
/* peek the message first */
@@ -1457,14 +1482,33 @@ static void txgbevf_mbx_process(struct rte_eth_dev *dev)
/* PF reset VF event */
if (in_msg & TXGBE_PF_CONTROL_MSG) {
- if (in_msg & TXGBE_NOFITY_VF_LINK_STATUS) {
+ /* msg is not CTS, we need to do reset */
+ if (!(in_msg & TXGBE_VT_MSGTYPE_CTS)) {
+ /* send reset to PF to reconfig CTS flag */
+ int err = 0;
+
+ msgbuf[0] = TXGBE_VF_RESET;
+ err = mbx->write_posted(hw, msgbuf, 1, 0);
+ if (err) {
+ hw->pf_running = false;
+ txgbevf_check_link_for_intr(dev);
+ } else {
+ hw->pf_running = true;
+ rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET,
+ NULL);
+ }
+ }
+
+ if (in_msg & TXGBE_NOFITY_VF_LINK_STATUS)
txgbevf_get_pf_link_status(dev);
- } else {
- /* dummy mbx read to ack pf */
- txgbe_read_mbx(hw, &in_msg, 1, 0);
+ else
/* check link status if pf ping vf */
txgbevf_check_link_for_intr(dev);
- }
+ }
+
+ if (!hw->pf_running) {
+ hw->rx_loaded = true;
+ hw->offset_loaded = true;
}
}
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 4/4] net/txgbe: add VF support for Amber-Lite 40G NIC
2026-06-17 11:33 ` [PATCH v2 0/4] Wangxun new feature Zaiyu Wang
` (2 preceding siblings ...)
2026-06-17 11:33 ` [PATCH v2 3/4] net/txgbe: add support for VF sensing PF down Zaiyu Wang
@ 2026-06-17 11:33 ` Zaiyu Wang
3 siblings, 0 replies; 11+ messages in thread
From: Zaiyu Wang @ 2026-06-17 11:33 UTC (permalink / raw)
To: dev; +Cc: Zaiyu Wang, Jiawen Wu
VF 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.
Signed-off-by: Zaiyu Wang <zaiyuwang@trustnetic.com>
---
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 | 7 ++++---
drivers/net/txgbe/txgbe_ethdev.c | 1 +
drivers/net/txgbe/txgbe_ethdev_vf.c | 2 ++
7 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/net/txgbe/base/txgbe_devids.h b/drivers/net/txgbe/base/txgbe_devids.h
index b7133c7d54..f5454ffbb1 100644
--- a/drivers/net/txgbe/base/txgbe_devids.h
+++ b/drivers/net/txgbe/base/txgbe_devids.h
@@ -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
diff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c
index 0f3db3a1ad..21465d68ff 100644
--- a/drivers/net/txgbe/base/txgbe_hw.c
+++ b/drivers/net/txgbe/base/txgbe_hw.c
@@ -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);
diff --git a/drivers/net/txgbe/base/txgbe_regs.h b/drivers/net/txgbe/base/txgbe_regs.h
index 95c585a025..5eb92c54b6 100644
--- a/drivers/net/txgbe/base/txgbe_regs.h
+++ b/drivers/net/txgbe/base/txgbe_regs.h
@@ -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:
diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index 956080c702..132d5c4eff 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -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
};
diff --git a/drivers/net/txgbe/base/txgbe_vf.c b/drivers/net/txgbe/base/txgbe_vf.c
index 1a8a20f104..4412006f1f 100644
--- a/drivers/net/txgbe/base/txgbe_vf.c
+++ b/drivers/net/txgbe/base/txgbe_vf.c
@@ -134,7 +134,9 @@ 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 +495,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;
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 003a24141c..63b967d71a 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -5228,6 +5228,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;
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 7ec1e009ed..655ccc622f 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -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 */ },
};
--
2.21.0.windows.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/4] Wangxun new feature
2026-06-17 10:59 [PATCH 0/4] Wangxun new feature Zaiyu Wang
` (4 preceding siblings ...)
2026-06-17 11:33 ` [PATCH v2 0/4] Wangxun new feature Zaiyu Wang
@ 2026-06-17 15:36 ` Stephen Hemminger
5 siblings, 0 replies; 11+ messages in thread
From: Stephen Hemminger @ 2026-06-17 15:36 UTC (permalink / raw)
To: Zaiyu Wang; +Cc: dev
On Wed, 17 Jun 2026 18:59:55 +0800
Zaiyu Wang <zaiyuwang@trustnetic.com> wrote:
> This patchset introduces three new features and critical fixes for our
> recent release cycle.
>
> Patch 1/2 adds 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.
>
> Zaiyu Wang (4):
> net/ngbe: add USO support
> net/txgbe: add USO support
> net/txgbe: add support for VF sensing PF down
> net/txgbe: add VF support for Amber-Lite 40G NIC
>
> 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 | 7 ++--
> drivers/net/txgbe/txgbe_ethdev.c | 4 +-
> drivers/net/txgbe/txgbe_ethdev_vf.c | 60 +++++++++++++++++++++++----
> drivers/net/txgbe/txgbe_rxtx.c | 13 +++---
> 9 files changed, 92 insertions(+), 23 deletions(-)
>
Preliminary AI review found some bugs.
Review of [PATCH v2 0/4] net/{txgbe,ngbe}: USO, VF PF-down sensing,
AML 40G VF support
Patch 3/4 (net/txgbe: add support for VF sensing PF down)
Error: dead store in txgbevf_get_pf_link_status() leaves the link
struct status field unmodified when the PF is down.
+ if (!hw->pf_running) {
+ link_up = false;
+ link_speed = TXGBE_LINK_SPEED_UNKNOWN;
+ link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
+ return rte_eth_linkstatus_set(dev, &link);
+ }
The local variables link_up and link_speed are written here and never
read before the function returns, so they have no effect. The actual
fields that need to change are link.link_status and link.link_speed,
neither of which is touched -- the function then publishes a link
struct that still has the previous link.link_status (whatever
rte_eth_linkstatus_get returned a few lines earlier) and only the
duplex updated.
Compare with the parallel code added in the same patch in
txgbevf_check_link_for_intr(), which gets it right:
+ new_link.link_status = RTE_ETH_LINK_DOWN;
+ new_link.link_speed = RTE_ETH_SPEED_NUM_NONE;
+ new_link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
In txgbevf_get_pf_link_status, assign directly to the link fields:
if (!hw->pf_running) {
link.link_status = RTE_ETH_LINK_DOWN;
link.link_speed = RTE_ETH_SPEED_NUM_NONE;
link.link_duplex = RTE_ETH_LINK_HALF_DUPLEX;
return rte_eth_linkstatus_set(dev, &link);
}
Warning: the commit message describes a flag that is not what the code
checks. The message says "Detect PF ifconfig down when
TXGBE_VT_MSGTYPE_SPEC is present in mailbox commands", but the
implementation in txgbevf_mbx_process does:
+ if (!(in_msg & TXGBE_VT_MSGTYPE_CTS)) {
TXGBE_VT_MSGTYPE_SPEC is defined in base/txgbe_mbx.h with a different
bit (0x10000000) and is only used in the 5-tuple-filter request path.
The detection here is "CTS is absent", not "SPEC is present".
Please rewrite the commit message to match the code.
Warning: no release notes entry. This is new VF behavior visible to
applications (a new INTR_RESET callback is dispatched when the PF
comes back up); doc/guides/rel_notes/release_26_07.rst should
mention it.
Info: msgbuf is declared as
u32 msgbuf[TXGBE_VF_PERMADDR_MSG_LEN] = {0}; but only msgbuf[0] is
ever used. Either size it to one element or drop the zero-init since
only the first element is touched before write_posted.
Patch 4/4 (net/txgbe: add VF support for Amber-Lite 40G NIC)
Warning: stray blank line between the if() and its body in
txgbe_reset_hw_vf:
+ if (hw->mac.type == txgbe_mac_aml_vf ||
+ hw->mac.type == txgbe_mac_aml40_vf)
+
wr32(hw, TXGBE_BME_AML, 0x1);
The blank line is a no-op for C but reads as a typo and checkpatch will
flag it. Remove the blank '+' line.
Warning: no release notes entry. New device IDs are user-visible (the
VF binds devices that previously did not work); please add a brief
note to release_26_07.rst.
Info: in txgbe_check_mac_link_vf the patch drops the explicit
sp_vf/aml_vf check before the wait loop:
- if ((mac->type == txgbe_mac_sp_vf ||
- mac->type == txgbe_mac_aml_vf) && wait_to_complete) {
+ if (wait_to_complete) {
The simplification is fine since txgbe_check_mac_link_vf is only ever
called with a VF mac type, but it is an unrelated cleanup that could be
mentioned in the commit message (or split into its own patch).
Patches 1/4 and 2/4 (net/{ngbe,txgbe}: add USO support)
Info: it would help readers if the commit message noted that
RTE_ETH_TX_OFFLOAD_UDP_TSO was already advertised in tx_offload_capa
(see ngbe_get_tx_port_offloads / txgbe_get_tx_port_offloads), so this
patch fills in the data path for a capability that was previously
claimed but unimplemented. Without that context the change looks like
a new feature addition; with it, it is clearly a fix and could carry a
Fixes: tag plus Cc: stable.
Info: a brief features-list or feature-matrix note in release_26_07.rst
would still be welcome since UDP_SEG offload now actually works.
Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 11+ messages in thread