patch 'net/nfp: fix MTU configuration order' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Sun Apr 9 17:24:02 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.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 04/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/bb296faffc9f2cf9d068709aa9683047c32d082d

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From bb296faffc9f2cf9d068709aa9683047c32d082d Mon Sep 17 00:00:00 2001
From: Peng Zhang <peng.zhang at corigine.com>
Date: Wed, 8 Mar 2023 10:33:18 +0800
Subject: [PATCH] net/nfp: fix MTU configuration order
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ]

If rte_eth_dev_set_mtu() is called before rte_eth_rx_queue_setup() the
NFP driver setup fails. This is because the default values evaluated
when setting the MTU are initialized in the rte_eth_rx_queue_setup()
code path. Fix this by instead initializing the MTU default values in
the device initialization, in nfp_net_init() and the check also is
conducted in nfp_net_start(), so it doesn't influence the result.

This was found by using DPDK with OVS.

Fixes: dbad6f64f921 ("net/nfp: fix internal buffer size and MTU check")

Signed-off-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c | 1 -
 drivers/net/nfp/nfp_common.c        | 4 ++--
 drivers/net/nfp/nfp_common.h        | 1 +
 drivers/net/nfp/nfp_ethdev.c        | 1 +
 drivers/net/nfp/nfp_ethdev_vf.c     | 1 +
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 6857732028..9c237bdb72 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -25,7 +25,6 @@
 #include "nfp_flower_cmsg.h"
 
 #define CTRL_VNIC_NB_DESC 512
-#define DEFAULT_FLBUF_SIZE 9216
 
 static void
 nfp_pf_repr_enable_queues(struct rte_eth_dev *dev)
diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index c9eeaa02fc..b673370f20 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -977,9 +977,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return -EBUSY;
 	}
 
-	/* MTU larger then current mbufsize not supported */
+	/* MTU larger than current mbufsize not supported */
 	if (mtu > hw->flbufsz) {
-		PMD_DRV_LOG(ERR, "MTU (%u) larger then current mbufsize (%u) not supported",
+		PMD_DRV_LOG(ERR, "MTU (%u) larger than current mbufsize (%u) not supported",
 			    mtu, hw->flbufsz);
 		return -ERANGE;
 	}
diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index 8cf99c0eae..67c8dc33d8 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -111,6 +111,7 @@ struct nfp_net_adapter;
 
 /* Maximum supported NFP frame size (MTU + layer 2 headers) */
 #define NFP_FRAME_SIZE_MAX	10048
+#define DEFAULT_FLBUF_SIZE        9216
 
 #include <linux/types.h>
 #include <rte_io.h>
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index cf7a4389b3..dc63b05bd6 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -604,6 +604,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	hw->mtu = RTE_ETHER_MTU;
+	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
 	/* VLAN insertion is incompatible with LSOv2 */
 	if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 865cac7741..1877d6b76b 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -361,6 +361,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	hw->mtu = RTE_ETHER_MTU;
+	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
 	/* VLAN insertion is incompatible with LSOv2 */
 	if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.180394400 +0800
+++ 0054-net-nfp-fix-MTU-configuration-order.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 Mon Sep 17 00:00:00 2001
+From bb296faffc9f2cf9d068709aa9683047c32d082d Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ]
@@ -19 +21,0 @@
-Cc: stable at dpdk.org
@@ -33 +35 @@
-index 2c797ae751..6f197396a4 100644
+index 6857732028..9c237bdb72 100644
@@ -36 +38 @@
-@@ -24,7 +24,6 @@
+@@ -25,7 +25,6 @@
@@ -45 +47 @@
-index 5922bfea8e..5d92b476e2 100644
+index c9eeaa02fc..b673370f20 100644
@@ -48 +50 @@
-@@ -1126,9 +1126,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -977,9 +977,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
@@ -61 +63 @@
-index 49c89ac327..4486ffa72c 100644
+index 8cf99c0eae..67c8dc33d8 100644
@@ -73 +75 @@
-index 47d5dff16c..56fb8e8c73 100644
+index cf7a4389b3..dc63b05bd6 100644
@@ -76 +78 @@
-@@ -603,6 +603,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -604,6 +604,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -85 +87 @@
-index 7834b2ee0c..d69ac8cd37 100644
+index 865cac7741..1877d6b76b 100644
@@ -88 +90 @@
-@@ -365,6 +365,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
+@@ -361,6 +361,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)


More information about the stable mailing list