From patchwork Mon Jun 8 07:01:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jayakumar, Muthurajan" X-Patchwork-Id: 5276 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A691358DD; Mon, 8 Jun 2015 09:01:31 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B72A95688 for ; Mon, 8 Jun 2015 09:01:29 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 08 Jun 2015 00:01:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,572,1427785200"; d="scan'208";a="583889687" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by orsmga003.jf.intel.com with ESMTP; 08 Jun 2015 00:01:28 -0700 Received: from orsmsx112.amr.corp.intel.com ([169.254.12.72]) by ORSMSX110.amr.corp.intel.com ([169.254.3.114]) with mapi id 14.03.0224.002; Mon, 8 Jun 2015 00:01:28 -0700 From: "Jayakumar, Muthurajan" To: "Liang, Cunming" , "dev@dpdk.org" Thread-Topic: [PATCH v1] app/test: fix pmd_perf issue in no NUMA case Thread-Index: AQHQobUD3OIIojmM8ka+oDb2xc1PXJ2iLjfg Date: Mon, 8 Jun 2015 07:01:27 +0000 Message-ID: <5D695A7F6F10504DBD9B9187395A21797D23C344@ORSMSX112.amr.corp.intel.com> References: <1433745194-27771-1-git-send-email-cunming.liang@intel.com> In-Reply-To: <1433745194-27771-1-git-send-email-cunming.liang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] app/test: fix pmd_perf issue in no NUMA case 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thank you Steve. Acked. Thanks M Jay http://www.dpdk.org -----Original Message----- From: Liang, Cunming Sent: Sunday, June 07, 2015 11:33 PM To: dev@dpdk.org Cc: Jayakumar, Muthurajan; Liang, Cunming Subject: [PATCH v1] app/test: fix pmd_perf issue in no NUMA case Reported-by: Jayakumar, Muthurajan Signed-off-by: Cunming Liang --- app/test/test_pmd_perf.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) slave_id, socketid); } - if (socketid != rte_eth_dev_socket_id(portid)) { + if (socketid != get_socket_id(portid)) { printf("Skip port %d\n", portid); continue; } @@ -818,7 +831,7 @@ test_pmd_perf(void) /* port tear down */ for (portid = 0; portid < nb_ports; portid++) { - if (socketid != rte_eth_dev_socket_id(portid)) + if (socketid != get_socket_id(portid)) continue; rte_eth_dev_stop(portid); -- 1.8.1.4 diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 1fd6843..6f218f7 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -321,6 +321,19 @@ alloc_lcore(uint16_t socketid) return (uint16_t)-1; } +static int +get_socket_id(uint8_t port_id) +{ + int socket_id; + + socket_id = rte_eth_dev_socket_id(port_id); + if (socket_id < 0) + /* enforce using socket 0 when no NUMA support */ + socket_id = 0; + + return socket_id; +} + volatile uint64_t stop; uint64_t count; uint64_t drop; @@ -727,7 +740,7 @@ test_pmd_perf(void) num = 0; for (portid = 0; portid < nb_ports; portid++) { if (socketid == -1) { - socketid = rte_eth_dev_socket_id(portid); + socketid = get_socket_id(portid); slave_id = alloc_lcore(socketid); if (slave_id == (uint16_t)-1) { printf("No avail lcore to run test\n"); @@ -737,7 +750,7 @@ test_pmd_perf(void)