From patchwork Thu Oct 18 10:39:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Yang X-Patchwork-Id: 47041 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A8995B38; Thu, 18 Oct 2018 12:39:40 +0200 (CEST) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id B73EB5B32 for ; Thu, 18 Oct 2018 12:39:38 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DB35DA78; Thu, 18 Oct 2018 03:39:37 -0700 (PDT) Received: from phil-VirtualBox.shanghai.arm.com (unknown [10.169.109.164]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 155A13F5D3; Thu, 18 Oct 2018 03:39:36 -0700 (PDT) From: Phil Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, nd@arm.com Date: Thu, 18 Oct 2018 18:39:25 +0800 Message-Id: <1539859165-7925-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] app/testpmd: reserve NUMA node per device port and per ring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Phil Yang Reviewed-by: Ferruh Yigit --- 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)) {