[PATCH 3/3] app/testpmd: cross NUMA support for gro init
Maayan Kashani
mkashani at nvidia.com
Tue Jun 17 17:42:54 CEST 2025
If gro context allocation with specified socket failed,
Testpmd init function would return an error.
With current change,
if --no-numa option is used,
testpmd init will use SOCKET_ID_ANY for gro init.
Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
---
app/test-pmd/testpmd.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index b5f0c022612..b00c93c4536 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1768,13 +1768,14 @@ init_config(void)
gro_param.max_flow_num = GRO_MAX_FLUSH_CYCLES;
gro_param.max_item_per_flow = MAX_PKT_BURST;
for (lc_id = 0; lc_id < nb_lcores; lc_id++) {
- gro_param.socket_id = rte_lcore_to_socket_id(
+ if (!numa_support)
+ gro_param.socket_id = SOCKET_ID_ANY;
+ else
+ gro_param.socket_id = rte_lcore_to_socket_id(
fwd_lcores_cpuids[lc_id]);
fwd_lcores[lc_id]->gro_ctx = rte_gro_ctx_create(&gro_param);
- if (fwd_lcores[lc_id]->gro_ctx == NULL) {
- rte_exit(EXIT_FAILURE,
- "rte_gro_ctx_create() failed\n");
- }
+ if (fwd_lcores[lc_id]->gro_ctx == NULL)
+ rte_exit(EXIT_FAILURE, "rte_gro_ctx_create() failed\n");
}
#endif
}
--
2.21.0
More information about the dev
mailing list