patch 'common/sfc_efx/base: reduce stack in netport stat describe' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 13:59:08 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.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/08/26. 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/60bd80e324ef28edeb2c0144a622f098b2455b0d

Thanks.

Kevin

---
>From 60bd80e324ef28edeb2c0144a622f098b2455b0d Mon Sep 17 00:00:00 2001
From: Andy Moreton <andy.moreton at amd.com>
Date: Fri, 14 Aug 2026 16:54:28 +0400
Subject: [PATCH] common/sfc_efx/base: reduce stack in netport stat describe

[ upstream commit 49781f958dd9b863e5f953196080f3589dfba372 ]

Code analysis reports an error for excessive stack consumption
(over 1KB). Use a heap allocated payload buffer instead.

Fixes: f2f77453cb9f ("common/sfc_efx/base: fill in software LUT for MAC statistics")

Signed-off-by: Andy Moreton <andy.moreton at amd.com>
Reviewed-by: Ivan Malov <ivan.malov at arknetworks.am>
Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov at arknetworks.am>
---
 drivers/common/sfc_efx/base/efx_np.c | 37 +++++++++++++++++++---------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index 45f3cd07ed..3ac9094a30 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -779,7 +779,5 @@ efx_np_stats_describe(
 	__out_opt			uint32_t *nstats_maxp)
 {
-	EFX_MCDI_DECLARE_BUF(payload,
-	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN,
-	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2);
+	uint8_t *payload = NULL;
 	uint32_t nprocessed;
 	efx_mcdi_req_t req;
@@ -788,11 +786,21 @@ efx_np_stats_describe(
 	unsigned int i;
 	size_t out_sz;
+	size_t size;
 	efx_rc_t rc;
 
-	req.emr_out_length = MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2;
-	req.emr_in_length = MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN;
+	size = EFX_MCDI_BUF_SIZE(MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN,
+	    MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2);
+
+	EFSYS_KMEM_ALLOC(enp->en_esip, size, payload);
+	if (payload == NULL) {
+		rc = ENOMEM;
+		goto fail1;
+	}
+
 	req.emr_cmd = MC_CMD_MAC_STATISTICS_DESCRIPTOR;
-	req.emr_out_buf = payload;
 	req.emr_in_buf = payload;
+	req.emr_in_length = MC_CMD_MAC_STATISTICS_DESCRIPTOR_IN_LEN;
+	req.emr_out_buf = payload;
+	req.emr_out_length = MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMAX_MCDI2;
 
 	MCDI_IN_SET_DWORD(req, MAC_STATISTICS_DESCRIPTOR_IN_PORT_HANDLE, nph);
@@ -803,5 +811,5 @@ efx_np_stats_describe(
 	if (req.emr_rc != 0) {
 		rc = req.emr_rc;
-		goto fail1;
+		goto fail2;
 	}
 
@@ -809,5 +817,5 @@ efx_np_stats_describe(
 	if (out_sz < MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_LENMIN) {
 		rc = EMSGSIZE;
-		goto fail2;
+		goto fail3;
 	}
 
@@ -819,5 +827,5 @@ efx_np_stats_describe(
 
 	if (lut_nentries == 0 || lut == NULL || nprocessedp == NULL)
-		return (0);
+		goto out;
 
 	stride = MCDI_OUT_DWORD(req, MAC_STATISTICS_DESCRIPTOR_OUT_ENTRY_SIZE);
@@ -825,5 +833,5 @@ efx_np_stats_describe(
 	if (nprocessed == 0) {
 		rc = EMSGSIZE;
-		goto fail3;
+		goto fail4;
 	}
 
@@ -835,12 +843,17 @@ efx_np_stats_describe(
 
 	*nprocessedp = nprocessed;
+
+out:
+	EFSYS_KMEM_FREE(enp->en_esip, size, payload);
+
 	return (0);
 
+fail4:
+	EFSYS_PROBE(fail4);
 fail3:
 	EFSYS_PROBE(fail3);
-
 fail2:
 	EFSYS_PROBE(fail2);
-
+	EFSYS_KMEM_FREE(enp->en_esip, size, payload);
 fail1:
 	EFSYS_PROBE1(fail1, efx_rc_t, rc);
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:39.983476817 +0000
+++ 0022-common-sfc_efx-base-reduce-stack-in-netport-stat-des.patch	2026-12-03 12:52:39.028938573 +0000
@@ -1 +1 @@
-From 49781f958dd9b863e5f953196080f3589dfba372 Mon Sep 17 00:00:00 2001
+From 60bd80e324ef28edeb2c0144a622f098b2455b0d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 49781f958dd9b863e5f953196080f3589dfba372 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list