From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B1D4A0C4E for ; Sun, 5 Dec 2021 04:42:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4A9140E01; Sun, 5 Dec 2021 04:42:36 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvacalvio01.broadcom.com [192.19.166.228]) by mails.dpdk.org (Postfix) with ESMTP id 9CB9B40040 for ; Sun, 5 Dec 2021 04:42:35 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 67B52C0008AF for ; Sat, 4 Dec 2021 19:42:34 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 67B52C0008AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1638675755; bh=ttwzvWsaujp/EBy8GFTWz5bJFsEYpt3bJ5lwsDLpO38=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SVWh5XO+LZY052n9Ber49fzfsLjpeXtYG3vb9r0/zRyf9mJDEO1t8nTywGf34THJY AUw8z3w5GIue2d9LS17NIspJFfvQ3eKd41SgtVWSP9XF9Pva9bRgd7Yv8SQPUJAmIE m5Th4PAYiU602Np049pDDFPuUwWuVm5t/i/mJIg4= From: Kalesh A P To: stable@dpdk.org Subject: [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf Date: Sun, 5 Dec 2021 09:32:06 +0530 Message-Id: <20211205040206.8050-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20211205040206.8050-1-kalesh-anakkur.purayil@broadcom.com> References: <20211205040206.8050-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Kalesh AP [ upstream commit 620e0290d14cc9a1126ef1af4eaa71ef9eadca72 ] Fix to ignore the RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN when the firmware doesn't support the VLAN strip offload. Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Lance Richardson Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_rxr.c | 8 +++++--- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 63d7475..73001b1 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -599,6 +599,7 @@ struct bnxt { uint32_t vnic_cap_flags; #define BNXT_VNIC_CAP_COS_CLASSIFY BIT(0) #define BNXT_VNIC_CAP_VLAN_RX_STRIP BIT(1) +#define BNXT_RX_VLAN_STRIP_EN(bp) ((bp)->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP) unsigned int rx_nr_rings; unsigned int rx_cp_nr_rings; unsigned int rx_num_qs_per_vnic; diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 56213f0..3355e00 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -209,8 +209,9 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq, mbuf->hash.fdir.id = rte_le_to_cpu_16(tpa_start1->cfa_code); mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID; } - if (tpa_start1->flags2 & - rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) { + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) && + (tpa_start1->flags2 & + rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN))) { mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata); mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; } @@ -601,7 +602,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, if (agg_buf) bnxt_rx_pages(rxq, mbuf, &tmp_raw_cons, agg_buf, NULL); - if (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) { + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) && + (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) { mbuf->vlan_tci = rxcmp1->metadata & (RX_PKT_CMPL_METADATA_VID_MASK | RX_PKT_CMPL_METADATA_DE | diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c index 9c3ae39..3d2081b 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c @@ -287,8 +287,9 @@ recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (rxcmp->flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID) mbuf->ol_flags |= PKT_RX_RSS_HASH; - if (rxcmp1->flags2 & - RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) { + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) && + (rxcmp1->flags2 & + RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) { mbuf->vlan_tci = rxcmp1->metadata & (RX_PKT_CMPL_METADATA_VID_MASK | RX_PKT_CMPL_METADATA_DE | -- 2.10.1