From patchwork Sat Sep 29 02:00:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 45634 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 10C791B141; Sat, 29 Sep 2018 04:01:23 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 1F30C1B3B9; Sat, 29 Sep 2018 04:00:22 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id D6A2530C054; Fri, 28 Sep 2018 19:00:20 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com D6A2530C054 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1538186420; bh=J3Y1WzhdXcwXSZwzIxHbumC8EzDxMbsgUaC76mu637I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sMlGHgZTNnqCDrujHHsGZKmcl/6Gtnu6QzIX5XUmyJCdQg1Ovz+5TCN6Bgx9f5gna nF9FNSoBX1Bu/r922rxD1G/Ymz+AwMTjyEGKluAvnKuv9qLgodLWnjyA7PtgzVP4Ff vM1PHbUWDa35KzqeuxP28eM8nWgKS4nHninCoHNg= Received: from C02VPB22HTD6.vpn.broadcom.net (unknown [10.10.118.196]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 79760AC074A; Fri, 28 Sep 2018 19:00:20 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Bei Sun , stable@dpdk.org Date: Fri, 28 Sep 2018 19:00:04 -0700 Message-Id: <20180929020006.71505-14-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.17.1 (Apple Git-112) In-Reply-To: <20180929020006.71505-1-ajit.khaparde@broadcom.com> References: <95301884-14c8-bbfd-ade9-ded04bdb6a95@intel.com> <20180929020006.71505-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH v3 13/15] net/bnxt: set VLAN strip mode before default VNIC cfg X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Bei Sun Firmware sets pf pair in default VNIC cfg. If the VLAN strip setting is not available at this time, it will not be configured correctly in the CFA. Set the desired VLAN strip mode before default VNIC configuration. Fixes: 7fe5668d2ea3 ("net/bnxt: support VLAN filter and strip") Cc: stable@dpdk.org Signed-off-by: Bei Sun Signed-off-by: Ajit Khaparde --- v1->v2: Update commit message as per review comment --- drivers/net/bnxt/bnxt_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 0bc8c5004..88e026c7d 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -202,7 +202,9 @@ static int bnxt_init_chip(struct bnxt *bp) struct bnxt_rx_queue *rxq; struct rte_eth_link new; struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(bp->eth_dev); + struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf; struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; + uint64_t rx_offloads = dev_conf->rxmode.offloads; uint32_t intr_vector = 0; uint32_t queue_id, base = BNXT_MISC_VEC_ID; uint32_t vec = BNXT_MISC_VEC_ID; @@ -283,6 +285,16 @@ static int bnxt_init_chip(struct bnxt *bp) } } + /* + * Firmware sets pf pair in default vnic cfg. If the VLAN strip + * setting is not available at this time, it will not be + * configured correctly in the CFA. + */ + if (rx_offloads & DEV_RX_OFFLOAD_VLAN_STRIP) + vnic->vlan_strip = true; + else + vnic->vlan_strip = false; + rc = bnxt_hwrm_vnic_cfg(bp, vnic); if (rc) { PMD_DRV_LOG(ERR, "HWRM vnic %d cfg failure rc: %x\n",