Skip to contentSkip to conversation

doc: gro API changes notice

PATCH In review Maayan Kashani 2 participants 4 messages Jun 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 doc: gro API changes notice

when using --no-numa option,
gro should be initiated with SOCKET_ID_ANY
to allow using cross NUMA.

API changes notice:
Changed socket_id field in struct rte_gro_param from uint16 to int32 to support negative value -1 (== SOCKET_ID_ANY). Changed gro_tbl_create typedef to receive negative socket input.

---
 doc/guides/rel_notes/deprecation.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
doc/guides/rel_notes/deprecation.rst +8 -0
index 36489f6e68f..5d534f49d53 100644
@@ -142,3 +142,11 @@ Deprecation Notices
 * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in
   ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK.
   Those API functions are used internally by DPDK core and netvsc PMD.
+
+* lib/gro: Starting DPDK 25.11, to enable using negative socket value
+  (``SOCKET_ID_ANY`` = -1) for gro init for cross NUMA initialization support,
+  perform the next changes in API:
+
+  - In ``struct rte_gro_param``: ``socket_id`` type changed from ``uint16_t`` to ``int32_t``.
+  - Update all ``gro_xxx_create`` functions to use updated socket_id type.
+
Signature · 1 line
2.21.0
#1 lore raw

PATCH 2/3 gro: cross NUMA support

when using --no-numa option,
gro should be initiated with SOCKET_ID_ANY
to allow using cross NUMA.

Changed socket_id field in struct rte_gro_param from uint16 to int32 to support negative value -1 (== SOCKET_ID_ANY).

---
 lib/gro/gro_tcp4.c       | 2 +-
 lib/gro/gro_tcp4.h       | 2 +-
 lib/gro/gro_tcp6.c       | 2 +-
 lib/gro/gro_tcp6.h       | 2 +-
 lib/gro/gro_udp4.c       | 2 +-
 lib/gro/gro_udp4.h       | 2 +-
 lib/gro/gro_vxlan_tcp4.c | 2 +-
 lib/gro/gro_vxlan_tcp4.h | 2 +-
 lib/gro/gro_vxlan_udp4.c | 2 +-
 lib/gro/gro_vxlan_udp4.h | 2 +-
 lib/gro/rte_gro.c        | 2 +-
 lib/gro/rte_gro.h        | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)
lib/gro/gro_tcp4.c +1 -1
index 855cc7a71d3..2352e2d9e64 100644
@@ -10,7 +10,7 @@
 #include "gro_tcp_internal.h"
 
 void *
-gro_tcp4_tbl_create(uint16_t socket_id,
+gro_tcp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow)
 {
lib/gro/gro_tcp4.h +1 -1
index 245e5da4861..0b695f1e906 100644
@@ -57,7 +57,7 @@ struct gro_tcp4_tbl {
  *  - Return the table pointer on success.
  *  - Return NULL on failure.
  */
-void *gro_tcp4_tbl_create(uint16_t socket_id,
+void *gro_tcp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow);
 
lib/gro/gro_tcp6.c +1 -1
index ab4cd6c68bf..10e97b006db 100644
@@ -10,7 +10,7 @@
 #include "gro_tcp_internal.h"
 
 void *
-gro_tcp6_tbl_create(uint16_t socket_id,
+gro_tcp6_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow)
 {
lib/gro/gro_tcp6.h +1 -1
index acf3971bb6e..1be01db9194 100644
@@ -60,7 +60,7 @@ struct gro_tcp6_tbl {
  *  - Return the table pointer on success.
  *  - Return NULL on failure.
  */
-void *gro_tcp6_tbl_create(uint16_t socket_id,
+void *gro_tcp6_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow);
 
lib/gro/gro_udp4.c +1 -1
index 019e05bcdea..ed738f60ece 100644
@@ -9,7 +9,7 @@
 #include "gro_udp4.h"
 
 void *
-gro_udp4_tbl_create(uint16_t socket_id,
+gro_udp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow)
 {
lib/gro/gro_udp4.h +1 -1
index 6467d7bc3b8..ad423731d50 100644
@@ -98,7 +98,7 @@ struct gro_udp4_tbl {
  *  - Return the table pointer on success.
  *  - Return NULL on failure.
  */
-void *gro_udp4_tbl_create(uint16_t socket_id,
+void *gro_udp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow);
 
lib/gro/gro_vxlan_tcp4.c +1 -1
index 29d4a2e13d5..d258cdc8561 100644
@@ -10,7 +10,7 @@
 #include "gro_vxlan_tcp4.h"
 
 void *
-gro_vxlan_tcp4_tbl_create(uint16_t socket_id,
+gro_vxlan_tcp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow)
 {
lib/gro/gro_vxlan_tcp4.h +1 -1
index 662db01a88d..beac866b5a1 100644
@@ -77,7 +77,7 @@ struct gro_vxlan_tcp4_tbl {
  *  - Return the table pointer on success.
  *  - Return NULL on failure.
  */
-void *gro_vxlan_tcp4_tbl_create(uint16_t socket_id,
+void *gro_vxlan_tcp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow);
 
lib/gro/gro_vxlan_udp4.c +1 -1
index ca8cee270d3..13e69ec904b 100644
@@ -10,7 +10,7 @@
 #include "gro_vxlan_udp4.h"
 
 void *
-gro_vxlan_udp4_tbl_create(uint16_t socket_id,
+gro_vxlan_udp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow)
 {
lib/gro/gro_vxlan_udp4.h +1 -1
index d0452212430..a412a23fd1f 100644
@@ -78,7 +78,7 @@ struct gro_vxlan_udp4_tbl {
  *  - Return the table pointer on success.
  *  - Return NULL on failure.
  */
-void *gro_vxlan_udp4_tbl_create(uint16_t socket_id,
+void *gro_vxlan_udp4_tbl_create(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow);
 
lib/gro/rte_gro.c +1 -1
index 578cc9b8010..776a553d5bb 100644
@@ -14,7 +14,7 @@
 #include "gro_vxlan_tcp4.h"
 #include "gro_vxlan_udp4.h"
 
-typedef void *(*gro_tbl_create_fn)(uint16_t socket_id,
+typedef void *(*gro_tbl_create_fn)(int32_t socket_id,
 		uint16_t max_flow_num,
 		uint16_t max_item_per_flow);
 typedef void (*gro_tbl_destroy_fn)(void *tbl);
lib/gro/rte_gro.h +1 -1
index c83dfd9ad14..572b41bf6fd 100644
@@ -53,7 +53,7 @@ struct rte_gro_param {
 	/**< max flow number */
 	uint16_t max_item_per_flow;
 	/**< max packet number per flow */
-	uint16_t socket_id;
+	int32_t socket_id;
 	/**< socket index for allocating GRO related data structures,
 	 * like reassembly tables. When use rte_gro_reassemble_burst(),
 	 * applications don't need to set this value.
Signature · 1 line
2.21.0
#2 lore raw

PATCH 3/3 app/testpmd: cross NUMA support for gro init

In reply to Maayan Kashani

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.

---
 app/test-pmd/testpmd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
app/test-pmd/testpmd.c +6 -5
index b5f0c022612..b00c93c4536 100644
@@ -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
 }
Signature · 1 line
2.21.0
#3 lore raw
In reply to Maayan Kashani
Quoted 10 lines · On Tue, 17 Jun 2025 18:42:52 +0300 Maayan Kashani <[email protected]> wrote:

when using --no-numa option,
gro should be initiated with SOCKET_ID_ANY
to allow using cross NUMA.

API changes notice:
Changed socket_id field in struct rte_gro_param from uint16 to int32 to support negative value -1 (== SOCKET_ID_ANY). Changed gro_tbl_create typedef to receive negative socket input.

GRO has experimental in the comments, but not the exported symbol that was a mistake. It either is experimental or not. Given that the tools check the exported symbol table, I would argue it is not experimental now.

Most of the API's in ethdev use "unsigned int socket_id", I see no reason for GRO to be different.

Why not use function versioning to do it now?