[dpdk-stable] patch 'net/bnxt: fix ping with MTU change' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 10 15:59:08 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

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/16/19. 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. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/5326842b58bd8570c3b8303216da70f82a661895

Thanks.

Kevin.

---
>From 5326842b58bd8570c3b8303216da70f82a661895 Mon Sep 17 00:00:00 2001
From: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
Date: Thu, 24 Oct 2019 13:14:17 +0530
Subject: [PATCH] net/bnxt: fix ping with MTU change

[ upstream commit 7d4e9e2606752678aacc96e017ebc3c44a260ff1 ]

Driver was setting maximum receive unit differently in bnxt_mtu_set_op
and bnxt_hwrm_vnic_alloc. Moreover firmware adds the 4 bytes for FCS.
Fixed it by setting correct maximum receive unit value.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")

Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur at broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  3 +++
 drivers/net/bnxt/bnxt_ethdev.c |  3 +--
 drivers/net/bnxt/bnxt_hwrm.c   | 11 +++--------
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0ef5afcba..eeced3a47 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -23,4 +23,7 @@
 #define BNXT_MAX_MTU		9574
 #define VLAN_TAG_SIZE		4
+/* FW adds extra 4 bytes for FCS */
+#define BNXT_VNIC_MRU(mtu)\
+	((mtu) + ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS)
 #define BNXT_VF_RSV_NUM_RSS_CTX	1
 #define BNXT_VF_RSV_NUM_L2_CTX	4
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 9da3a46c6..925ea42e6 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1692,6 +1692,5 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
 		uint16_t size = 0;
 
-		vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN +
-					ETHER_CRC_LEN + VLAN_TAG_SIZE * 2;
+		vnic->mru = BNXT_VNIC_MRU(new_mtu);
 		rc = bnxt_hwrm_vnic_cfg(bp, vnic);
 		if (rc)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 74f046c29..596ab3658 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1333,6 +1333,5 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 	vnic->cos_rule = (uint16_t)HWRM_NA_SIGNATURE;
 	vnic->lb_rule = (uint16_t)HWRM_NA_SIGNATURE;
-	vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN +
-				ETHER_CRC_LEN + VLAN_TAG_SIZE;
+	vnic->mru = BNXT_VNIC_MRU(bp->eth_dev->data->mtu);
 	HWRM_PREP(req, VNIC_ALLOC, BNXT_USE_CHIMP_MB);
 
@@ -2528,7 +2527,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int tx_rings)
 	req.flags = rte_cpu_to_le_32(bp->pf.func_cfg_flags);
 	req.mtu = rte_cpu_to_le_16(BNXT_MAX_MTU);
-	req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
-				   ETHER_CRC_LEN + VLAN_TAG_SIZE *
-				   BNXT_NUM_VLANS);
+	req.mru = rte_cpu_to_le_16(BNXT_VNIC_MRU(bp->eth_dev->data->mtu));
 	req.num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx);
 	req.num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx);
@@ -2569,7 +2566,5 @@ static void populate_vf_func_cfg_req(struct bnxt *bp,
 				    ETHER_CRC_LEN + VLAN_TAG_SIZE *
 				    BNXT_NUM_VLANS);
-	req->mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
-				    ETHER_CRC_LEN + VLAN_TAG_SIZE *
-				    BNXT_NUM_VLANS);
+	req->mru = rte_cpu_to_le_16(BNXT_VNIC_MRU(bp->eth_dev->data->mtu));
 	req->num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx /
 						(num_vfs + 1));
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-10 14:49:41.399037258 +0000
+++ 0034-net-bnxt-fix-ping-with-MTU-change.patch	2019-12-10 14:49:39.057457674 +0000
@@ -1 +1 @@
-From 7d4e9e2606752678aacc96e017ebc3c44a260ff1 Mon Sep 17 00:00:00 2001
+From 5326842b58bd8570c3b8303216da70f82a661895 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7d4e9e2606752678aacc96e017ebc3c44a260ff1 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index e5bdf6360..975bcf9c6 100644
+index 0ef5afcba..eeced3a47 100644
@@ -26,3 +27,3 @@
-@@ -78,4 +78,7 @@
- 				 RTE_ETHER_CRC_LEN +\
- 				 (BNXT_NUM_VLANS * VLAN_TAG_SIZE))
+@@ -23,4 +23,7 @@
+ #define BNXT_MAX_MTU		9574
+ #define VLAN_TAG_SIZE		4
@@ -31 +32 @@
-+	((mtu) + RTE_ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS)
++	((mtu) + ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS)
@@ -35 +36 @@
-index e7ec99e15..c97fcaceb 100644
+index 9da3a46c6..925ea42e6 100644
@@ -38 +39 @@
-@@ -2175,6 +2175,5 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
+@@ -1692,6 +1692,5 @@ static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
@@ -41,2 +42,2 @@
--		vnic->mru = new_mtu + RTE_ETHER_HDR_LEN +
--				RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE * 2;
+-		vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN +
+-					ETHER_CRC_LEN + VLAN_TAG_SIZE * 2;
@@ -47 +48 @@
-index 18e7429a7..018113c4c 100644
+index 74f046c29..596ab3658 100644
@@ -50,5 +51,5 @@
-@@ -1593,6 +1593,5 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)
- 
- skip_ring_grps:
--	vnic->mru = bp->eth_dev->data->mtu + RTE_ETHER_HDR_LEN +
--				RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE;
+@@ -1333,6 +1333,5 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+ 	vnic->cos_rule = (uint16_t)HWRM_NA_SIGNATURE;
+ 	vnic->lb_rule = (uint16_t)HWRM_NA_SIGNATURE;
+-	vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN +
+-				ETHER_CRC_LEN + VLAN_TAG_SIZE;
@@ -58 +59 @@
-@@ -2955,7 +2954,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int tx_rings)
+@@ -2528,7 +2527,5 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int tx_rings)
@@ -61,2 +62,2 @@
--	req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + RTE_ETHER_HDR_LEN +
--				   RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE *
+-	req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
+-				   ETHER_CRC_LEN + VLAN_TAG_SIZE *
@@ -67,2 +68,2 @@
-@@ -2996,7 +2993,5 @@ static void populate_vf_func_cfg_req(struct bnxt *bp,
- 				    RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE *
+@@ -2569,7 +2566,5 @@ static void populate_vf_func_cfg_req(struct bnxt *bp,
+ 				    ETHER_CRC_LEN + VLAN_TAG_SIZE *
@@ -70,2 +71,2 @@
--	req->mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + RTE_ETHER_HDR_LEN +
--				    RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE *
+-	req->mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN +
+-				    ETHER_CRC_LEN + VLAN_TAG_SIZE *



More information about the stable mailing list