From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yskoh@mellanox.com>
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id 9462D1B512
 for <stable@dpdk.org>; Fri, 30 Nov 2018 00:14:05 +0100 (CET)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 yskoh@mellanox.com)
 with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:19:56 +0200
Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx
 [10.101.0.96])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7r032075;
 Fri, 30 Nov 2018 01:14:01 +0200
From: Yongseok Koh <yskoh@mellanox.com>
To: Bei Sun <bei.sun@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>, dpdk stable <stable@dpdk.org>
Date: Thu, 29 Nov 2018 15:10:47 -0800
Message-Id: <20181129231202.30436-53-yskoh@mellanox.com>
X-Mailer: git-send-email 2.11.0
In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com>
References: <20181129231202.30436-1-yskoh@mellanox.com>
Subject: [dpdk-stable] patch 'net/bnxt: set VLAN strip mode before default
	VNIC cfg' has been queued to LTS release 17.11.5
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Nov 2018 23:14:06 -0000

Hi,

FYI, your patch has been queued to LTS release 17.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/01/18. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Yongseok

---
>>From d58e3cd8c34b45c19f6256363c73879466260169 Mon Sep 17 00:00:00 2001
From: Bei Sun <bei.sun@broadcom.com>
Date: Fri, 28 Sep 2018 19:00:04 -0700
Subject: [PATCH] net/bnxt: set VLAN strip mode before default VNIC cfg

[ upstream commit 3153ec8bd1eedbc6d34671b0e2b51bf97896caa3 ]

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")

Signed-off-by: Bei Sun <bei.sun@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 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 7466a642e..109112142 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -204,7 +204,9 @@ static int bnxt_init_chip(struct bnxt *bp)
 	unsigned int i, rss_idx, fw_idx;
 	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;
@@ -275,6 +277,16 @@ static int bnxt_init_chip(struct bnxt *bp)
 			goto err_out;
 		}
 
+		/*
+		 * 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) {
 			RTE_LOG(ERR, PMD, "HWRM vnic %d cfg failure rc: %x\n",
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-29 15:01:47.573529556 -0800
+++ 0053-net-bnxt-set-VLAN-strip-mode-before-default-VNIC-cfg.patch	2018-11-29 15:01:45.118959000 -0800
@@ -1,15 +1,16 @@
-From 3153ec8bd1eedbc6d34671b0e2b51bf97896caa3 Mon Sep 17 00:00:00 2001
+From d58e3cd8c34b45c19f6256363c73879466260169 Mon Sep 17 00:00:00 2001
 From: Bei Sun <bei.sun@broadcom.com>
 Date: Fri, 28 Sep 2018 19:00:04 -0700
 Subject: [PATCH] net/bnxt: set VLAN strip mode before default VNIC cfg
 
+[ upstream commit 3153ec8bd1eedbc6d34671b0e2b51bf97896caa3 ]
+
 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 <bei.sun@broadcom.com>
 Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
@@ -18,11 +19,11 @@
  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
+index 7466a642e..109112142 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;
+@@ -204,7 +204,9 @@ static int bnxt_init_chip(struct bnxt *bp)
+ 	unsigned int i, rss_idx, fw_idx;
  	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;
@@ -31,8 +32,8 @@
  	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)
- 			}
+@@ -275,6 +277,16 @@ static int bnxt_init_chip(struct bnxt *bp)
+ 			goto err_out;
  		}
  
 +		/*
@@ -47,7 +48,7 @@
 +
  		rc = bnxt_hwrm_vnic_cfg(bp, vnic);
  		if (rc) {
- 			PMD_DRV_LOG(ERR, "HWRM vnic %d cfg failure rc: %x\n",
+ 			RTE_LOG(ERR, PMD, "HWRM vnic %d cfg failure rc: %x\n",
 -- 
 2.11.0