DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] doc: gro API changes notice
@ 2025-06-17 15:42 Maayan Kashani
  2025-06-17 15:42 ` [PATCH 2/3] gro: cross NUMA support Maayan Kashani
  2025-06-17 15:42 ` [PATCH 3/3] app/testpmd: cross NUMA support for gro init Maayan Kashani
  0 siblings, 2 replies; 3+ messages in thread
From: Maayan Kashani @ 2025-06-17 15:42 UTC (permalink / raw)
  To: dev; +Cc: mkashani, dsosnowski, rasland

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.

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
---
 doc/guides/rel_notes/deprecation.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 36489f6e68f..5d534f49d53 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -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.
+
-- 
2.21.0


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

* [PATCH 2/3] gro: cross NUMA support
  2025-06-17 15:42 [PATCH 1/3] doc: gro API changes notice Maayan Kashani
@ 2025-06-17 15:42 ` Maayan Kashani
  2025-06-17 15:42 ` [PATCH 3/3] app/testpmd: cross NUMA support for gro init Maayan Kashani
  1 sibling, 0 replies; 3+ messages in thread
From: Maayan Kashani @ 2025-06-17 15:42 UTC (permalink / raw)
  To: dev; +Cc: mkashani, dsosnowski, rasland, Jiayu Hu

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).

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
---
 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(-)

diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c
index 855cc7a71d3..2352e2d9e64 100644
--- a/lib/gro/gro_tcp4.c
+++ b/lib/gro/gro_tcp4.c
@@ -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)
 {
diff --git a/lib/gro/gro_tcp4.h b/lib/gro/gro_tcp4.h
index 245e5da4861..0b695f1e906 100644
--- a/lib/gro/gro_tcp4.h
+++ b/lib/gro/gro_tcp4.h
@@ -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);
 
diff --git a/lib/gro/gro_tcp6.c b/lib/gro/gro_tcp6.c
index ab4cd6c68bf..10e97b006db 100644
--- a/lib/gro/gro_tcp6.c
+++ b/lib/gro/gro_tcp6.c
@@ -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)
 {
diff --git a/lib/gro/gro_tcp6.h b/lib/gro/gro_tcp6.h
index acf3971bb6e..1be01db9194 100644
--- a/lib/gro/gro_tcp6.h
+++ b/lib/gro/gro_tcp6.h
@@ -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);
 
diff --git a/lib/gro/gro_udp4.c b/lib/gro/gro_udp4.c
index 019e05bcdea..ed738f60ece 100644
--- a/lib/gro/gro_udp4.c
+++ b/lib/gro/gro_udp4.c
@@ -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)
 {
diff --git a/lib/gro/gro_udp4.h b/lib/gro/gro_udp4.h
index 6467d7bc3b8..ad423731d50 100644
--- a/lib/gro/gro_udp4.h
+++ b/lib/gro/gro_udp4.h
@@ -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);
 
diff --git a/lib/gro/gro_vxlan_tcp4.c b/lib/gro/gro_vxlan_tcp4.c
index 29d4a2e13d5..d258cdc8561 100644
--- a/lib/gro/gro_vxlan_tcp4.c
+++ b/lib/gro/gro_vxlan_tcp4.c
@@ -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)
 {
diff --git a/lib/gro/gro_vxlan_tcp4.h b/lib/gro/gro_vxlan_tcp4.h
index 662db01a88d..beac866b5a1 100644
--- a/lib/gro/gro_vxlan_tcp4.h
+++ b/lib/gro/gro_vxlan_tcp4.h
@@ -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);
 
diff --git a/lib/gro/gro_vxlan_udp4.c b/lib/gro/gro_vxlan_udp4.c
index ca8cee270d3..13e69ec904b 100644
--- a/lib/gro/gro_vxlan_udp4.c
+++ b/lib/gro/gro_vxlan_udp4.c
@@ -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)
 {
diff --git a/lib/gro/gro_vxlan_udp4.h b/lib/gro/gro_vxlan_udp4.h
index d0452212430..a412a23fd1f 100644
--- a/lib/gro/gro_vxlan_udp4.h
+++ b/lib/gro/gro_vxlan_udp4.h
@@ -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);
 
diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c
index 578cc9b8010..776a553d5bb 100644
--- a/lib/gro/rte_gro.c
+++ b/lib/gro/rte_gro.c
@@ -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);
diff --git a/lib/gro/rte_gro.h b/lib/gro/rte_gro.h
index c83dfd9ad14..572b41bf6fd 100644
--- a/lib/gro/rte_gro.h
+++ b/lib/gro/rte_gro.h
@@ -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.
-- 
2.21.0


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

* [PATCH 3/3] app/testpmd: cross NUMA support for gro init
  2025-06-17 15:42 [PATCH 1/3] doc: gro API changes notice Maayan Kashani
  2025-06-17 15:42 ` [PATCH 2/3] gro: cross NUMA support Maayan Kashani
@ 2025-06-17 15:42 ` Maayan Kashani
  1 sibling, 0 replies; 3+ messages in thread
From: Maayan Kashani @ 2025-06-17 15:42 UTC (permalink / raw)
  To: dev; +Cc: mkashani, dsosnowski, rasland, Aman Singh

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@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


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

end of thread, other threads:[~2025-06-17 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-17 15:42 [PATCH 1/3] doc: gro API changes notice Maayan Kashani
2025-06-17 15:42 ` [PATCH 2/3] gro: cross NUMA support Maayan Kashani
2025-06-17 15:42 ` [PATCH 3/3] app/testpmd: cross NUMA support for gro init Maayan Kashani

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).