[dpdk-stable] [PATCH 16.11 3/3] app/testpmd: reserve NUMA node per device port and per ring
Phil Yang
phil.yang at arm.com
Fri Nov 2 08:40:17 CET 2018
[ backported from upstream commit a569af2481cd3bd29e5c6d49f2d2f95586d750a8 ]
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")
Signed-off-by: Phil Yang <phil.yang at arm.com>
Suggested-by: Yigit Ferruh <ferruh.yigit at intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.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 84e7a63..6fe1ee6 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -435,8 +435,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;
}
@@ -496,8 +499,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
More information about the stable
mailing list