When NUMA is disabled, mbuf pools are allocated on SOCKET_ID_ANY,
but rx_queue_setup() looked them up using port->socket_id. Per-segment
pool lookup failed and all segments fell back to the first pool,
causing Rx queue setup to fail when a later segment needed a larger
mbuf (e.g. --mbuf-size=314,978 --rxpkts=186,978).

Check numa_support inside mbuf_pool_find() and drop the duplicate
NUMA socket remapping from start_port().

Fixes: 0be0ad196b52 ("app/testpmd: support selective Rx")
Cc: [email protected]

Signed-off-by: Maayan Kashani <[email protected]>
---
 app/test-pmd/testpmd.c | 3 +--
 app/test-pmd/testpmd.h | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index fcd8a909670..9a85657840a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3153,8 +3153,7 @@ start_port(portid_t pid)
                                } else {
                                        struct rte_mempool *mp =
                                                mbuf_pool_find_first
-                                                       ((numa_support ? 
port->socket_id :
-                                                       (unsigned 
int)SOCKET_ID_ANY));
+                                                       (port->socket_id);
                                        if (mp == NULL) {
                                                fprintf(stderr,
                                                        "Failed to setup RX 
queue: No mempool allocation on the socket %d\n",
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 3d4b36d6683..c1f3650f484 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -891,6 +891,9 @@ mbuf_pool_find(unsigned int sock_id, uint16_t idx)
 {
        char pool_name[RTE_MEMPOOL_NAMESIZE];
 
+       if (!numa_support)
+               sock_id = (unsigned int)SOCKET_ID_ANY;
+
        mbuf_poolname_build(sock_id, pool_name, sizeof(pool_name), idx);
        return rte_mempool_lookup((const char *)pool_name);
 }
-- 
2.21.0

Reply via email to