From patchwork Sat Sep 22 04:55:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 45166 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 200A95B40; Sat, 22 Sep 2018 06:56:48 +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 9A1F64C93 for ; Sat, 22 Sep 2018 06:56:18 +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 1AADB30C069; Fri, 21 Sep 2018 21:56:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 1AADB30C069 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1537592174; bh=Bk0HvgHHfnACbCEs31fUMxktuT6Pp46+TliLz1goums=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8alR1xCsPOiRRvEGEf/sHoHY7TcB79bvXLPJNUov01vAYB4mzJZYOyBsBOfYkQGb 7LuxwzHdicm7hxs8GlR+0mPwL082CoI2En5tmsQVdlIt8vYtYrAGOepZ7PgEFFdTjd a+KzpDWY8rLhrt3F3Ic17ViVcpzIiGQCDv9uBP6k= Received: from C02VPB22HTD6.vpn.broadcom.net (unknown [10.10.118.131]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 83430AC0752; Fri, 21 Sep 2018 21:56:13 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Bei Sun Date: Fri, 21 Sep 2018 21:55:58 -0700 Message-Id: <20180922045559.27438-12-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.17.1 (Apple Git-112) In-Reply-To: <20180922045559.27438-1-ajit.khaparde@broadcom.com> References: <20180922045559.27438-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH v2 11/12] 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. Signed-off-by: Bei Sun Signed-off-by: Ajit Khaparde --- 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 e1b684c2e..e605df424 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",