patch 'net/bnxt: disallow MTU change when device is started' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Tue Jun 28 17:19:36 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/30/22. 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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/9fe3dcd614db1a005ed76ffe0b19296e65fc0bcc

Thanks.

Kevin

---
>From 9fe3dcd614db1a005ed76ffe0b19296e65fc0bcc Mon Sep 17 00:00:00 2001
From: Damodharam Ammepalli <damodharam.ammepalli at broadcom.com>
Date: Wed, 15 Jun 2022 20:27:01 +0530
Subject: [PATCH] net/bnxt: disallow MTU change when device is started

[ upstream commit a42ab1eb33ff4d9358e746782365d7de0b1ed98b ]

With this patch, bnxt_mtu_set_op() will return an error code if the
device has already started. The user application will have to take
care to bring down device before invoking the mtu_set()

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

Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli at broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 00129c76e6..93d17b7670 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3021,7 +3021,5 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
 {
-	uint32_t overhead = BNXT_MAX_PKT_LEN - BNXT_MAX_MTU;
 	struct bnxt *bp = eth_dev->data->dev_private;
-	uint32_t new_pkt_size;
 	uint32_t rc;
 	uint32_t i;
@@ -3031,23 +3029,13 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
 		return rc;
 
+	/* Return if port is active */
+	if (eth_dev->data->dev_started) {
+		PMD_DRV_LOG(ERR, "Stop port before changing MTU\n");
+		return -EPERM;
+	}
+
 	/* Exit if receive queues are not configured yet */
 	if (!eth_dev->data->nb_rx_queues)
-		return rc;
-
-	new_pkt_size = new_mtu + overhead;
-
-	/*
-	 * Disallow any MTU change that would require scattered receive support
-	 * if it is not already enabled.
-	 */
-	if (eth_dev->data->dev_started &&
-	    !eth_dev->data->scattered_rx &&
-	    (new_pkt_size >
-	     eth_dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) {
-		PMD_DRV_LOG(ERR,
-			    "MTU change would require scattered rx support. ");
-		PMD_DRV_LOG(ERR, "Stop port before changing MTU.\n");
-		return -EINVAL;
-	}
+		return -ENOTSUP;
 
 	if (new_mtu > RTE_ETHER_MTU)
@@ -3058,5 +3046,5 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
 	/* Is there a change in mtu setting? */
 	if (eth_dev->data->mtu == new_mtu)
-		return rc;
+		return 0;
 
 	for (i = 0; i < bp->nr_vnics; i++) {
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-28 16:18:04.616837478 +0100
+++ 0024-net-bnxt-disallow-MTU-change-when-device-is-started.patch	2022-06-28 16:18:04.066387174 +0100
@@ -1 +1 @@
-From a42ab1eb33ff4d9358e746782365d7de0b1ed98b Mon Sep 17 00:00:00 2001
+From 9fe3dcd614db1a005ed76ffe0b19296e65fc0bcc Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a42ab1eb33ff4d9358e746782365d7de0b1ed98b ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 4e4791c2db..f040cdcf94 100644
+index 00129c76e6..93d17b7670 100644
@@ -24 +25 @@
-@@ -3020,7 +3020,5 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+@@ -3021,7 +3021,5 @@ bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
@@ -32 +33 @@
-@@ -3030,23 +3028,13 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
+@@ -3031,23 +3029,13 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
@@ -63 +64 @@
-@@ -3057,5 +3045,5 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)
+@@ -3058,5 +3046,5 @@ int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu)



More information about the stable mailing list