From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gw3-out.broadcom.com (mail-gw3-out.broadcom.com [216.31.210.64]) by dpdk.org (Postfix) with ESMTP id 911D58E69 for ; Wed, 13 Jan 2016 23:21:08 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.22,291,1449561600"; d="scan'208";a="85278566" Received: from irvexchcas07.broadcom.com (HELO IRVEXCHCAS07.corp.ad.broadcom.com) ([10.9.208.55]) by mail-gw3-out.broadcom.com with ESMTP; 13 Jan 2016 14:59:49 -0800 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.3.235.1; Wed, 13 Jan 2016 14:21:06 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.235.1; Wed, 13 Jan 2016 14:21:06 -0800 Received: from DPDK-C1.broadcom.com (lab-irv-114-50 [10.13.114.50]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id EF54D40FE8; Wed, 13 Jan 2016 14:17:21 -0800 (PST) From: Stephen Hurd To: Date: Wed, 13 Jan 2016 14:20:38 -0800 Message-ID: <1452723638-73093-1-git-send-email-shurd@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <24888901-A45C-4E23-871E-3485AF2423D2@intel.com> References: <24888901-A45C-4E23-871E-3485AF2423D2@intel.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [dpdk-dev] [PATCH] app/testpmd Fix max_socket detection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 22:21:09 -0000 Previously, max_socket was set to the highest numbered socket with an enabled lcore. The intent is to set it to the highest socket regardless of it being enabled. Change-Id: I6306af0f90aa3c1fc5ffed75d1eed8297d29e132 Signed-off-by: Stephen Hurd --- app/test-pmd/testpmd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 6129c26..26a2cce 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -359,17 +359,17 @@ set_default_fwd_lcores_config(void) nb_lc = 0; for (i = 0; i < RTE_MAX_LCORE; i++) { + if (sock_num > max_socket) { + if (sock_num > RTE_MAX_NUMA_NODES) + rte_exit(EXIT_FAILURE, "Total sockets greater than %u\n", RTE_MAX_NUMA_NODES); + max_socket = sock_num; + } if (! rte_lcore_is_enabled(i)) continue; if (i == rte_get_master_lcore()) continue; fwd_lcores_cpuids[nb_lc++] = i; sock_num = rte_lcore_to_socket_id(i) + 1; - if (sock_num > max_socket) { - if (sock_num > RTE_MAX_NUMA_NODES) - rte_exit(EXIT_FAILURE, "Total sockets greater than %u\n", RTE_MAX_NUMA_NODES); - max_socket = sock_num; - } } nb_lcores = (lcoreid_t) nb_lc; nb_cfg_lcores = nb_lcores; -- 1.9.1