patch 'common/sfc_efx/base: fix flex array in netport stat describe' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 13:59:15 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/7e0e27b10280176ea005993bc40bcb689913d1ca
Thanks.
Kevin
---
>From 7e0e27b10280176ea005993bc40bcb689913d1ca Mon Sep 17 00:00:00 2001
From: Andy Moreton <andy.moreton at amd.com>
Date: Fri, 14 Aug 2026 16:54:35 +0400
Subject: [PATCH] common/sfc_efx/base: fix flex array in netport stat describe
[ upstream commit 8411eef8e06b72536e80213a97795f09aaeb578f ]
Code analysis reported returning uninitialised memory at *lut and
*nprocessedp. Refactor to ensure these parameters are only used
when non-NULL.
This function should also be using the ENTRY_COUNT field for the
number of descriptors returned, as the descriptor size is not
known statically (they are extensible). Also use the MORE_ENTRIES
flag to determine if all of the descriptors have been fetched.
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 | 39 +++++++++++++++++++---------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/drivers/common/sfc_efx/base/efx_np.c b/drivers/common/sfc_efx/base/efx_np.c
index e7ca6d3302..ec76985054 100644
--- a/drivers/common/sfc_efx/base/efx_np.c
+++ b/drivers/common/sfc_efx/base/efx_np.c
@@ -783,8 +783,9 @@ efx_np_stats_describe(
{
uint8_t *payload = NULL;
- uint32_t nprocessed;
efx_mcdi_req_t req;
uint8_t *entries;
uint32_t stride;
+ uint32_t count;
+ uint32_t more;
unsigned int i;
size_t out_sz;
@@ -829,27 +830,41 @@ efx_np_stats_describe(
}
- if (lut_nentries == 0 || lut == NULL || nprocessedp == NULL)
- goto out;
-
stride = MCDI_OUT_DWORD(req, MAC_STATISTICS_DESCRIPTOR_OUT_ENTRY_SIZE);
- nprocessed = MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_ENTRIES_NUM(out_sz);
- if (nprocessed == 0) {
+ count = MCDI_OUT_DWORD(req, MAC_STATISTICS_DESCRIPTOR_OUT_ENTRY_COUNT);
+ more = MCDI_OUT_DWORD_FIELD(req,
+ MAC_STATISTICS_DESCRIPTOR_OUT_FLAGS,
+ MAC_STATISTICS_DESCRIPTOR_OUT_MORE_ENTRIES);
+
+ if ((count == 0) && (more != 0)) {
rc = EMSGSIZE;
goto fail4;
}
- entries = MCDI_OUT2(req, uint8_t,
- MAC_STATISTICS_DESCRIPTOR_OUT_ENTRIES);
+ if (count > 0 && (stride < MC_CMD_STAT_DESC_LEN || count >
+ (out_sz - MC_CMD_MAC_STATISTICS_DESCRIPTOR_OUT_ENTRIES_OFST) /
+ stride)) {
+ rc = EMSGSIZE;
+ goto fail5;
+ }
- for (i = 0; i < nprocessed; ++i)
- efx_np_stat_describe(entries + i * stride, lut_nentries, lut);
+ if (lut != NULL) {
+ entries = MCDI_OUT2(req, uint8_t,
+ MAC_STATISTICS_DESCRIPTOR_OUT_ENTRIES);
- *nprocessedp = nprocessed;
+ for (i = 0; i < count; ++i) {
+ efx_np_stat_describe(entries + i * stride,
+ lut_nentries, lut);
+ }
+ }
+
+ if (nprocessedp != NULL)
+ *nprocessedp = count;
-out:
EFSYS_KMEM_FREE(enp->en_esip, size, payload);
return (0);
+fail5:
+ EFSYS_PROBE(fail5);
fail4:
EFSYS_PROBE(fail4);
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:40.177387928 +0000
+++ 0029-common-sfc_efx-base-fix-flex-array-in-netport-stat-d.patch 2026-12-03 12:52:39.033379935 +0000
@@ -1 +1 @@
-From 8411eef8e06b72536e80213a97795f09aaeb578f Mon Sep 17 00:00:00 2001
+From 7e0e27b10280176ea005993bc40bcb689913d1ca Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8411eef8e06b72536e80213a97795f09aaeb578f ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list