DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] test-flow-perf: fix the incorrect array length
@ 2025-11-17  7:28 Bing Zhao
  2025-11-17 12:02 ` Dariusz Sosnowski
  0 siblings, 1 reply; 2+ messages in thread
From: Bing Zhao @ 2025-11-17  7:28 UTC (permalink / raw)
  To: viacheslavo, dev, rasland
  Cc: orika, dsosnowski, suanmingm, matan, thomas, wisamm

The array used to save the flow rules pointer was allocated with an
incorrect length. 1 more rule space should be appended but not 1 byte.

Fixes: 070316d01d3e ("app/flow-perf: add multi-core rule insertion and deletion")
Cc: wisamm@nvidia.com

Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
 app/test-flow-perf/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index b2084b93dd..a8876acf1f 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -1487,7 +1487,7 @@ insert_flows(int port_id, uint8_t core_id, uint16_t dst_port_id)
 	global_actions[0] = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_JUMP);
 
 	flows_list = rte_zmalloc("flows_list",
-		(sizeof(struct rte_flow *) * rules_count_per_core) + 1, 0);
+		(sizeof(struct rte_flow *) * (rules_count_per_core + 1)), 0);
 	if (flows_list == NULL)
 		rte_exit(EXIT_FAILURE, "No Memory available!\n");
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-flow-perf: fix the incorrect array length
  2025-11-17  7:28 [PATCH] test-flow-perf: fix the incorrect array length Bing Zhao
@ 2025-11-17 12:02 ` Dariusz Sosnowski
  0 siblings, 0 replies; 2+ messages in thread
From: Dariusz Sosnowski @ 2025-11-17 12:02 UTC (permalink / raw)
  To: Bing Zhao
  Cc: viacheslavo, dev, rasland, orika, suanmingm, matan, thomas, wisamm

On Mon, Nov 17, 2025 at 09:28:58AM +0200, Bing Zhao wrote:
> The array used to save the flow rules pointer was allocated with an
> incorrect length. 1 more rule space should be appended but not 1 byte.
> 
> Fixes: 070316d01d3e ("app/flow-perf: add multi-core rule insertion and deletion")
> Cc: wisamm@nvidia.com
> 
> Signed-off-by: Bing Zhao <bingz@nvidia.com>

Looks good to me.

Reviewed-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Best regards,
Dariusz Sosnowski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-17 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17  7:28 [PATCH] test-flow-perf: fix the incorrect array length Bing Zhao
2025-11-17 12:02 ` Dariusz Sosnowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).