patch 'net/nfp: fix initialization of physical representors' has been queued to stable release 22.11.4

Xueming Li xuemingl at nvidia.com
Sun Oct 22 16:22:07 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/15/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/commit/?h=22.11-staging&id=06cd13b57e238c55ad359ea171040b2564351722

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 06cd13b57e238c55ad359ea171040b2564351722 Mon Sep 17 00:00:00 2001
From: Zerun Fu <zerun.fu at corigine.com>
Date: Tue, 10 Oct 2023 14:03:12 +0800
Subject: [PATCH] net/nfp: fix initialization of physical representors
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit ae23bfd0291a40222ec2acb802d519ac4d61cb7c ]

The former logic of initializing the array of physical port
representors is according to 'nfp_idx', but referencing based
on 'port_id'. This is a potential bug and will cause segment
fault when these two values are not equal. Fix it by using the
'port_id' as index at all time.

Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework")

Signed-off-by: Zerun Fu <zerun.fu at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index d319aefb08..b9f2f631ff 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -637,6 +637,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
 		void *init_params)
 {
 	int ret;
+	uint16_t index;
 	unsigned int numa_node;
 	char ring_name[RTE_ETH_NAME_MAX_LEN];
 	struct nfp_app_fw_flower *app_fw_flower;
@@ -710,10 +711,13 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
 	}

 	/* Add repr to correct array */
-	if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT)
-		app_fw_flower->phy_reprs[repr->nfp_idx] = repr;
-	else
-		app_fw_flower->vf_reprs[repr->vf_id] = repr;
+	if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) {
+		index = NFP_FLOWER_CMSG_PORT_PHYS_PORT_NUM(repr->port_id);
+		app_fw_flower->phy_reprs[index] = repr;
+	} else {
+		index = repr->vf_id;
+		app_fw_flower->vf_reprs[index] = repr;
+	}

 	return 0;

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-22 22:17:37.972977700 +0800
+++ 0098-net-nfp-fix-initialization-of-physical-representors.patch	2023-10-22 22:17:34.366723700 +0800
@@ -1 +1 @@
-From ae23bfd0291a40222ec2acb802d519ac4d61cb7c Mon Sep 17 00:00:00 2001
+From 06cd13b57e238c55ad359ea171040b2564351722 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit ae23bfd0291a40222ec2acb802d519ac4d61cb7c ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index 55ca3e6db0..e4c5d765e7 100644
+index d319aefb08..b9f2f631ff 100644
@@ -27 +29 @@
-@@ -646,6 +646,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
+@@ -637,6 +637,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
@@ -35 +37 @@
-@@ -719,10 +720,13 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
+@@ -710,10 +711,13 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,


More information about the stable mailing list