patch 'common/sfc_efx/base: reduce stack in get addr regions MCDI' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Oct 27 12:48:32 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4664695208e02353057656810b8ebd7e0b5cd84f

Thanks.

Luca Boccassi

---
>From 4664695208e02353057656810b8ebd7e0b5cd84f Mon Sep 17 00:00:00 2001
From: Andy Moreton <andy.moreton at amd.com>
Date: Fri, 14 Aug 2026 16:54:26 +0400
Subject: [PATCH] common/sfc_efx/base: reduce stack in get addr regions MCDI

[ upstream commit 8620e8b6879854f8a2a40a62f4657bf82c87cb50 ]

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

Fixes: 60fb370c7bc9 ("common/sfc_efx/base: support NIC DMA memory regions API")

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_mcdi.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx_mcdi.c b/drivers/common/sfc_efx/base/efx_mcdi.c
index acf7f02246b..62d381f950f 100644
--- a/drivers/common/sfc_efx/base/efx_mcdi.c
+++ b/drivers/common/sfc_efx/base/efx_mcdi.c
@@ -3425,15 +3425,24 @@ efx_mcdi_get_nic_addr_regions(
 	__in		efx_nic_t *enp,
 	__out		efx_nic_dma_region_info_t *endrip)
 {
-	EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_DESC_ADDR_REGIONS_IN_LEN,
-		MC_CMD_GET_DESC_ADDR_REGIONS_OUT_LENMAX_MCDI2);
+	uint8_t *payload = NULL;
 	efx_xword_t *regions;
 	efx_mcdi_req_t req;
+	size_t size;
 	efx_rc_t rc;
 	size_t alloc_size;
 	unsigned int nregions;
 	unsigned int i;
 
+	size = EFX_MCDI_BUF_SIZE(MC_CMD_GET_DESC_ADDR_REGIONS_IN_LEN,
+	    MC_CMD_GET_DESC_ADDR_REGIONS_OUT_LENMAX_MCDI2);
+
+	EFSYS_KMEM_ALLOC(enp->en_esip, size, payload);
+	if (payload == NULL) {
+		rc = ENOMEM;
+		goto fail1;
+	}
+
 	req.emr_cmd = MC_CMD_GET_DESC_ADDR_REGIONS;
 	req.emr_in_buf = payload;
 	req.emr_in_length = MC_CMD_GET_DESC_ADDR_REGIONS_IN_LEN;
@@ -3444,13 +3453,13 @@ efx_mcdi_get_nic_addr_regions(
 
 	if (req.emr_rc != 0) {
 		rc = req.emr_rc;
-		goto fail1;
+		goto fail2;
 	}
 
 	if (req.emr_out_length_used <
 	    MC_CMD_GET_DESC_ADDR_REGIONS_OUT_LENMIN) {
 		rc = EMSGSIZE;
-		goto fail2;
+		goto fail3;
 	}
 
 	nregions = MC_CMD_GET_DESC_ADDR_REGIONS_OUT_REGIONS_NUM(
@@ -3463,7 +3472,7 @@ efx_mcdi_get_nic_addr_regions(
 	alloc_size = nregions * sizeof(endrip->endri_regions[0]);
 	if (alloc_size / sizeof (endrip->endri_regions[0]) != nregions) {
 		rc = ENOMEM;
-		goto fail3;
+		goto fail4;
 	}
 
 	EFSYS_KMEM_ALLOC(enp->en_esip,
@@ -3471,7 +3480,7 @@ efx_mcdi_get_nic_addr_regions(
 	    endrip->endri_regions);
 	if (endrip->endri_regions == NULL) {
 		rc = ENOMEM;
-		goto fail4;
+		goto fail5;
 	}
 
 	endrip->endri_count = nregions;
@@ -3503,14 +3512,19 @@ efx_mcdi_get_nic_addr_regions(
 		        DESC_ADDR_REGION_TRGT_ADDR_ALIGN_LOG2);
 	}
 
+	EFSYS_KMEM_FREE(enp->en_esip, size, payload);
+
 	return (0);
 
+fail5:
+	EFSYS_PROBE(fail5);
 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.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-10-27 11:43:54.464923704 +0000
+++ 0018-common-sfc_efx-base-reduce-stack-in-get-addr-regions.patch	2026-10-27 11:43:53.510059325 +0000
@@ -1 +1 @@
-From 8620e8b6879854f8a2a40a62f4657bf82c87cb50 Mon Sep 17 00:00:00 2001
+From 4664695208e02353057656810b8ebd7e0b5cd84f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8620e8b6879854f8a2a40a62f4657bf82c87cb50 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 670b0d5cda..4be736dcb9 100644
+index acf7f02246b..62d381f950f 100644
@@ -23 +24 @@
-@@ -3439,15 +3439,24 @@ efx_mcdi_get_nic_addr_regions(
+@@ -3425,15 +3425,24 @@ efx_mcdi_get_nic_addr_regions(
@@ -50 +51 @@
-@@ -3458,13 +3467,13 @@ efx_mcdi_get_nic_addr_regions(
+@@ -3444,13 +3453,13 @@ efx_mcdi_get_nic_addr_regions(
@@ -66 +67 @@
-@@ -3477,7 +3486,7 @@ efx_mcdi_get_nic_addr_regions(
+@@ -3463,7 +3472,7 @@ efx_mcdi_get_nic_addr_regions(
@@ -75 +76 @@
-@@ -3485,7 +3494,7 @@ efx_mcdi_get_nic_addr_regions(
+@@ -3471,7 +3480,7 @@ efx_mcdi_get_nic_addr_regions(
@@ -84 +85 @@
-@@ -3517,14 +3526,19 @@ efx_mcdi_get_nic_addr_regions(
+@@ -3503,14 +3512,19 @@ efx_mcdi_get_nic_addr_regions(


More information about the stable mailing list