From: Kalesh AP <kalesh-anakkur.pura...@broadcom.com> In the scalar Rx path, for the VLAN packet, TCI is not saved in the "mbuf->vlan_tci", however the STRIPPED offload flag is set along with PKT_RX_VLAN flag.
Fixes: c1b33d40315f ("net/bnxt: use table based mbuf flags handling") Cc: sta...@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.pura...@broadcom.com> Reviewed-by: Somnath Kotur <somnath.ko...@broadcom.com> Reviewed-by: Lance Richardson <lance.richard...@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khapa...@broadcom.com> --- drivers/net/bnxt/bnxt_rxr.c | 2 ++ drivers/net/bnxt/bnxt_rxr.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index aea7170..5d8b738 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -962,6 +962,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1); + bnxt_set_vlan(rxcmp1, mbuf); + if (BNXT_TRUFLOW_EN(bp)) mark_id = bnxt_ulp_set_mark_in_mbuf(rxq->bp, rxcmp1, mbuf, &vfr_flag); diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h index dc2b1b7..59adb72 100644 --- a/drivers/net/bnxt/bnxt_rxr.h +++ b/drivers/net/bnxt/bnxt_rxr.h @@ -185,6 +185,16 @@ bnxt_check_ptype_constants(void) extern uint32_t bnxt_ptype_table[BNXT_PTYPE_TBL_DIM]; +static inline void bnxt_set_vlan(struct rx_pkt_cmpl_hi *rxcmp1, + struct rte_mbuf *mbuf) +{ + uint32_t metadata = rte_le_to_cpu_32(rxcmp1->metadata); + + mbuf->vlan_tci = metadata & (RX_PKT_CMPL_METADATA_VID_MASK | + RX_PKT_CMPL_METADATA_DE | + RX_PKT_CMPL_METADATA_PRI_MASK); +} + /* Stingray2 specific code for RX completion parsing */ #define RX_CMP_VLAN_VALID(rxcmp) \ (((struct rx_pkt_v2_cmpl *)rxcmp)->metadata1_payload_offset & \ -- 2.10.1