From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 419B57CA9 for ; Thu, 4 May 2017 11:37:13 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2017 02:37:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,287,1491289200"; d="scan'208";a="83546438" Received: from ypei-25.sh.intel.com ([10.239.129.173]) by orsmga004.jf.intel.com with ESMTP; 04 May 2017 02:37:11 -0700 From: Yulong Pei To: dev@dpdk.org Cc: jingjing.wu@intel.com, thomas@monjalon.net Date: Wed, 3 May 2017 18:29:47 +0800 Message-Id: <1493807387-135918-1-git-send-email-yulong.pei@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1493344915-127542-1-git-send-email-yulong.pei@intel.com> References: <1493344915-127542-1-git-send-email-yulong.pei@intel.com> Subject: [dpdk-dev] [PATCH v5] app/testpmd: fix port_numa and ring_numa not initialize issue 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: , X-List-Received-Date: Thu, 04 May 2017 09:37:13 -0000 Previous numa_support = 0 by default, it need to add --numa to testpmd command line to enable numa, so port_numa and ring_numa were initialized at function launch_args_parse(), now testpmd change numa_support = 1 as default, so port_numa and ring_numa also need to initialize by default, otherwise port->socket_id will be probed to wrong value. Fixes: 999b2ee0fe45 ("app/testpmd: enable NUMA support by default") Signed-off-by: Yulong Pei --- app/test-pmd/parameters.c | 6 +----- app/test-pmd/testpmd.c | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 787e143..36f7dd8 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -680,12 +680,8 @@ launch_args_parse(int argc, char** argv) parse_fwd_portmask(optarg); if (!strcmp(lgopts[opt_idx].name, "no-numa")) numa_support = 0; - if (!strcmp(lgopts[opt_idx].name, "numa")) { + if (!strcmp(lgopts[opt_idx].name, "numa")) numa_support = 1; - memset(port_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS); - memset(rxring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS); - memset(txring_numa,NUMA_NO_CONFIG,RTE_MAX_ETHPORTS); - } if (!strcmp(lgopts[opt_idx].name, "mp-anon")) { mp_anon = 1; } diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index dfe6442..78423ee 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -529,6 +529,13 @@ init_config(void) uint8_t port_per_socket[RTE_MAX_NUMA_NODES]; memset(port_per_socket,0,RTE_MAX_NUMA_NODES); + + if (numa_support) { + memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); + memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); + memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); + } + /* Configuration of logical cores. */ fwd_lcores = rte_zmalloc("testpmd: fwd_lcores", sizeof(struct fwd_lcore *) * nb_lcores, -- 2.5.0