From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6748D2C50 for ; Wed, 26 Apr 2017 12:36:18 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 26 Apr 2017 03:36:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,254,1488873600"; d="scan'208";a="1161145453" Received: from dpdktest46-2.sh.intel.com ([10.239.129.144]) by fmsmga002.fm.intel.com with ESMTP; 26 Apr 2017 03:36:15 -0700 From: Yulong Pei To: dev@dpdk.org Cc: bruce.richardson@intel.com, jingjing.wu@intel.com, thomas@monjalon.net Date: Wed, 26 Apr 2017 12:31:03 +0800 Message-Id: <1493181063-14145-1-git-send-email-yulong.pei@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] app/testpmd: initalize port_numa and ring_numa 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: Wed, 26 Apr 2017 10:36:18 -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 initalized at function launch_args_parse(), now testpmd change numa_support = 1 as default, so port_numa and ring_numa also need to initalize by default, otherwise port->socket_id will be probed to wrong value. Signed-off-by: Yulong Pei --- app/test-pmd/parameters.c | 6 +----- app/test-pmd/testpmd.c | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 3f4d3a2..3296b3a 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -665,12 +665,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 3a57348..d52315a 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -543,6 +543,12 @@ init_config(void) fwd_lcores[lc_id]->cpuid_idx = lc_id; } + 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); + } + /* * Create pools of mbuf. * If NUMA support is disabled, create a single pool of mbuf in -- 2.1.0