net/bnxt: fix mbuf VLAN in scalar Rx

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: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Kalesh AP 2021-08-23 13:42:12 +05:30 committed by Ajit Khaparde
parent 8908691632
commit 167978c167
2 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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 & \