From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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: , X-List-Received-Date: Mon, 08 Jun 2015 07:01:30 -0000 Thank you Steve. Acked. Thanks=20 M Jay http://www.dpdk.org -----Original Message----- From: Liang, Cunming=20 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(-) diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 1fd6= 843..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; } =20 +static int +get_socket_id(uint8_t port_id) +{ + int socket_id; + + socket_id =3D rte_eth_dev_socket_id(port_id); + if (socket_id < 0) + /* enforce using socket 0 when no NUMA support */ + socket_id =3D 0; + + return socket_id; +} + volatile uint64_t stop; uint64_t count; uint64_t drop; @@ -727,7 +740,7 @@ test_pmd_perf(void) num =3D 0; for (portid =3D 0; portid < nb_ports; portid++) { if (socketid =3D=3D -1) { - socketid =3D rte_eth_dev_socket_id(portid); + socketid =3D get_socket_id(portid); slave_id =3D alloc_lcore(socketid); if (slave_id =3D=3D (uint16_t)-1) { printf("No avail lcore to run test\n"); @@ -737,7 +750,7 @@ test_pmd_p= erf(void) slave_id, socketid); } =20 - if (socketid !=3D rte_eth_dev_socket_id(portid)) { + if (socketid !=3D get_socket_id(portid)) { printf("Skip port %d\n", portid); continue; } @@ -818,7 +831,7 @@ test_pmd_perf(void) =20 /* port tear down */ for (portid =3D 0; portid < nb_ports; portid++) { - if (socketid !=3D rte_eth_dev_socket_id(portid)) + if (socketid !=3D get_socket_id(portid)) continue; =20 rte_eth_dev_stop(portid); -- 1.8.1.4