All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: reserve NUMA node per device port and per ring
@ 2018-10-18 10:39 Phil Yang
  2018-10-18 12:56 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Yang @ 2018-10-18 10:39 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, nd

If user explicitly requested memory to be allocated from a socket via
`port-numa-config` and `rxring-numa-config`, and if that socket is
valid, add that socket into socket_ids[] so that mempool allocated for
that socket.

Fixes: dbfb8ec ("app/testpmd: optimize mbuf pool allocation")

Suggested-by: Yigit Ferruh <ferruh.yigit@intel.com>
Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 app/test-pmd/parameters.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 4a4debb..38b4197 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -416,8 +416,11 @@ parse_portnuma_config(const char *q_arg)
 		}
 		socket_id = (uint8_t)int_fld[FLD_SOCKET];
 		if (new_socket_id(socket_id)) {
-			print_invalid_socket_id_error();
-			return -1;
+			if (num_sockets >= RTE_MAX_NUMA_NODES) {
+				print_invalid_socket_id_error();
+				return -1;
+			}
+			socket_ids[num_sockets++] = socket_id;
 		}
 		port_numa[port_id] = socket_id;
 	}
@@ -473,8 +476,11 @@ parse_ringnuma_config(const char *q_arg)
 		}
 		socket_id = (uint8_t)int_fld[FLD_SOCKET];
 		if (new_socket_id(socket_id)) {
-			print_invalid_socket_id_error();
-			return -1;
+			if (num_sockets >= RTE_MAX_NUMA_NODES) {
+				print_invalid_socket_id_error();
+				return -1;
+			}
+			socket_ids[num_sockets++] = socket_id;
 		}
 		ring_flag = (uint8_t)int_fld[FLD_FLAG];
 		if ((ring_flag < RX_RING_ONLY) || (ring_flag > RXTX_RING)) {
-- 
2.7.4

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

* Re: [PATCH] app/testpmd: reserve NUMA node per device port and per ring
  2018-10-18 10:39 [PATCH] app/testpmd: reserve NUMA node per device port and per ring Phil Yang
@ 2018-10-18 12:56 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-10-18 12:56 UTC (permalink / raw)
  To: phil.yang, dev; +Cc: nd

On 10/18/2018 11:39 AM, phil.yang@arm.com wrote:
> If user explicitly requested memory to be allocated from a socket via
> `port-numa-config` and `rxring-numa-config`, and if that socket is
> valid, add that socket into socket_ids[] so that mempool allocated for
> that socket.
> 
> Fixes: dbfb8ec ("app/testpmd: optimize mbuf pool allocation")
> 
> Suggested-by: Yigit Ferruh <ferruh.yigit@intel.com>
> Signed-off-by: Phil Yang <phil.yang@arm.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.


Thanks Phil.

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

end of thread, other threads:[~2018-10-18 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-18 10:39 [PATCH] app/testpmd: reserve NUMA node per device port and per ring Phil Yang
2018-10-18 12:56 ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.