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 9CB2BA0C56; Mon, 23 Aug 2021 09:51:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE9EF41159; Mon, 23 Aug 2021 09:51:44 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 0572F4114A for ; Mon, 23 Aug 2021 09:51:43 +0200 (CEST) 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 B70A224779 for ; Mon, 23 Aug 2021 00:51:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com B70A224779 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1629705102; bh=l+oWcxrpbT9vk0Di5yg1O2jUMloclWsjftNpnVmNpD8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=X1APERv/D5KdXPhkHGUVgCaAnHvBi8mnCIz6SnM8mrGR0B/D7p1M4tX9Ee87adQll 0B7IN555DHU4kspZPeyNcOak2XbBO7JSCopVtuDPdMcIIGMAy+lZLHOuUzFxGWIObf GnxsKRG4O5gEuyD8bBubFfqOGkVsf/DKMLRUk9ss= From: Kalesh A P To: dev@dpdk.org Date: Mon, 23 Aug 2021 13:42:14 +0530 Message-Id: <20210823081214.9725-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20210823081214.9725-1-kalesh-anakkur.purayil@broadcom.com> References: <20210823081214.9725-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 3/3] net/bnxt: fix VLAN indication in Rx mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP 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") Cc: stable@dpdk.org 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 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 3ccc06c..a64b138 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -745,6 +745,7 @@ struct bnxt { #define BNXT_VNIC_CAP_OUTER_RSS BIT(1) #define BNXT_VNIC_CAP_RX_CMPL_V2 BIT(2) #define BNXT_VNIC_CAP_VLAN_RX_STRIP BIT(3) +#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 5d8b738..1da9a7d 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -272,7 +272,7 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq, mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID; } - if (tpa_info->vlan_valid) { + if (tpa_info->vlan_valid && BNXT_RX_VLAN_STRIP_EN(rxq->bp)) { mbuf->vlan_tci = tpa_info->vlan; mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; } @@ -574,8 +574,10 @@ bnxt_init_ol_flags_tables(struct bnxt_rx_queue *rxq) for (i = 0; i < BNXT_OL_FLAGS_TBL_DIM; i++) { pt[i] = 0; - if (i & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) - pt[i] |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp)) { + if (i & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) + pt[i] |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; + } if (i & (RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC << 3)) { /* Tunnel case. */ -- 2.10.1