[PATCH v2 2/4] net/af_packet: make Rx VLAN stripped flag handling explicit
William Bland
blandwwa at gmail.com
Wed Aug 26 19:38:39 CEST 2026
Rx VLAN handling set RTE_MBUF_F_RX_VLAN_STRIPPED unconditionally,
relying on rte_vlan_insert() to clear it again. This produced correct
flags, but in a way that was not readily apparent from the driver.
Make the flag handling explicit in the driver itself: only set
RTE_MBUF_F_RX_VLAN_STRIPPED when vlan_strip is requested, or when
reinsertion fails. No behavioral change.
Signed-off-by: William Bland <blandwwa at gmail.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index b0ff22ea55..d95d045a37 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -223,10 +223,14 @@ eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
/* check for vlan info */
if (ppd->tp_status & TP_STATUS_VLAN_VALID) {
mbuf->vlan_tci = ppd->tp_vlan_tci;
- mbuf->ol_flags |= (RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED);
+ mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN;
- if (!pkt_q->vlan_strip && rte_vlan_insert(&mbuf))
+ if (pkt_q->vlan_strip) {
+ mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN_STRIPPED;
+ } else if (rte_vlan_insert(&mbuf) != 0) {
PMD_LOG(ERR, "Failed to reinsert VLAN tag");
+ mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN_STRIPPED;
+ }
}
/* add kernel provided timestamp when offloading is enabled */
--
2.43.0
More information about the dev
mailing list