From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00046.outbound.protection.outlook.com [40.107.0.46]) by dpdk.org (Postfix) with ESMTP id EA65FF72; Mon, 8 May 2017 19:36:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PzNJR5lbPaWq6wTqDejcIBWSVRUSvTayESJRbCq8JpA=; b=v53QGpWHvifgxyaEivQFXxPrDzbfp6P85PKXWjuHfjyfJCNY8n+KrISogoDIlpqV8wHEMw4hFUUcQ+8lVeVnAw0QRwfeZ9PnMBIDIreczaGqTw71JpCTCPSjUJw7j2TB4tJiixrwr63U7dm57OKzdlIAEzMK/BoI/62SHdRhwx4= Received: from AM4PR05MB1505.eurprd05.prod.outlook.com (10.164.79.147) by AM4PR05MB1507.eurprd05.prod.outlook.com (10.164.79.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Mon, 8 May 2017 17:35:48 +0000 Received: from AM4PR05MB1505.eurprd05.prod.outlook.com ([fe80::80f1:6d48:a372:7ebe]) by AM4PR05MB1505.eurprd05.prod.outlook.com ([fe80::80f1:6d48:a372:7ebe%14]) with mapi id 15.01.1075.019; Mon, 8 May 2017 17:35:48 +0000 From: Shahaf Shuler To: "Wu, Jingjing" CC: "dev@dpdk.org" , Thomas Monjalon , "stable@dpdk.org" Thread-Topic: [PATCH v2] app/testpmd: support non contiguous socket ids Thread-Index: AQHSxBNp1t3OWA7cnEOT0jxDsZdn0qHmi32AgAHagfCAAT0ZAIABFxOg Date: Mon, 8 May 2017 17:35:48 +0000 Message-ID: References: <20170503134429.22723-1-shahafs@mellanox.com> <9BB6961774997848B5B42BEC655768F810D624B2@SHSMSX103.ccr.corp.intel.com> <9BB6961774997848B5B42BEC655768F810D6383D@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810D6383D@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [31.154.10.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1507; 7:AzSB2TAATMJAtC04HjXMfvuVZpuwg+3FpXrbY7T1trw1bu5oE37MnCcRxm1MwqCNKjOnLsDKVqzRj85W6rMHaAMhhunp4WXBpJOnllXcoir8F0OXLF4qgfQ1sbc0vzDZ/zNGHnvtWV2CiIQUQQavqHmVMHgQASVWHWz3TwP2gg2lvMsa7xcYJgpj+V0kndg4c2lBxeVqGmOI8UnL2ZSTU7b5606thAksSSRdT1Zmt1GJj9idi8h/NJ3D3I/UBj5i1DFKAVAshbJJVnvtJxWSiGwRYQ5+bVlG+tjufKDPaG75I6GWAAq4Y5jA5Txv4bObgxtFfchsJtTV6Uq6TH66aw== x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: d954c2ad-d518-4c83-b3a1-08d49638aa62 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:AM4PR05MB1507; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148); SRVR:AM4PR05MB1507; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1507; x-forefront-prvs: 0301360BF5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39840400002)(39860400002)(39410400002)(39850400002)(13464003)(76104003)(377454003)(9686003)(8936002)(74316002)(6116002)(8676002)(81166006)(305945005)(478600001)(102836003)(3846002)(229853002)(5660300001)(53936002)(110136004)(6916009)(7696004)(2950100002)(38730400002)(93886004)(189998001)(53546009)(5250100002)(33656002)(76176999)(99286003)(54906002)(55016002)(50986999)(54356999)(25786009)(2900100001)(6506006)(7736002)(2906002)(86362001)(4326008)(6436002)(3660700001)(3280700002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1507; H:AM4PR05MB1505.eurprd05.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2017 17:35:48.5293 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1507 Subject: Re: [dpdk-stable] [PATCH v2] app/testpmd: support non contiguous socket ids X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2017 17:36:52 -0000 --Shahaf > -----Original Message----- > From: Wu, Jingjing [mailto:jingjing.wu@intel.com] > Sent: Monday, May 8, 2017 3:54 AM > To: Shahaf Shuler > Cc: dev@dpdk.org; Thomas Monjalon ; > stable@dpdk.org > Subject: RE: [PATCH v2] app/testpmd: support non contiguous socket ids >=20 >=20 >=20 > > -----Original Message----- > > From: Shahaf Shuler [mailto:shahafs@mellanox.com] > > Sent: Sunday, May 7, 2017 2:06 PM > > To: Wu, Jingjing > > Cc: dev@dpdk.org; Thomas Monjalon ; > > stable@dpdk.org > > Subject: RE: [PATCH v2] app/testpmd: support non contiguous socket ids > > > > Saturday, May 6, 2017 4:41 AM, Wu, Jingjing: > > > > > > > > The test assumes the socket ids are contiguous. This is not > > > > necessarily the case on all servers and may cause mempool creation = to > fail. > > > > > > > > Fixing it by detecting the list of valid socket ids and use it for > > > > the mempool creation. > > > > > > > > Fixes: 7acf894d07d1 ("app/testpmd: detect numa socket count") > > > > > > > > CC: stable@dpdk.org > > > > Signed-off-by: Shahaf Shuler > > > > --- > > > > on v2: > > > > * fix minor typo on commit message : be->by. > > > > --- > > > > app/test-pmd/parameters.c | 38 ++++++++++++++++++++++++++++- > ---- > > > ----- > > > > app/test-pmd/testpmd.c | 38 +++++++++++++++++++++++++++++- > ----- > > > --- > > > > app/test-pmd/testpmd.h | 4 +++- > > > > 3 files changed, 60 insertions(+), 20 deletions(-) > > > > > > > > [..] > > > > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > > > > dfe64427d..a556a8aff 100644 > > > > --- a/app/test-pmd/testpmd.c > > > > +++ b/app/test-pmd/testpmd.c > > > > [..] > > > > > > +/* > > > > * Setup default configuration. > > > > */ > > > > static void > > > > @@ -388,12 +405,14 @@ set_default_fwd_lcores_config(void) > > > > > > > > nb_lc =3D 0; > > > > for (i =3D 0; i < RTE_MAX_LCORE; i++) { > > > > - sock_num =3D 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 =3D sock_num; > > > > + sock_num =3D rte_lcore_to_socket_id(i); > > > +1 is missed? > > > > I don't think so. > > On previous implementation this logic was meant to find the max_socket. > > max_socket was the first invalid socket_id and was used, for example : > > > > if (socket_id >=3D max_socket) { > > > > or > > > > for (i =3D 0; i < max_socket; i++) > > > > now, on above logic, we list the valid socket id. Therefore > > rte_lcore_to_socket_id return a valid id and not need to add 1. > > > > > OK, but at list the following check "if (sock_num > > RTE_MAX_NUMA_NODES)" > Should be "if (sock_num +1 > RTE_MAX_NUMA_NODES)", right? >=20 Right, i prefer the following though, what do you think? for (i =3D 0; i < RTE_MAX_LCORE; i++) { sock_num =3D rte_lcore_to_socket_id(i); if (new_socket_id(sock_num)) { if (num_sockets >=3D RTE_MAX_NUMA_NODES) { rte_exit(EXIT_FAILURE, "Total sockets greater than %u\n", RTE_MAX_NUMA_NODES); } socket_ids[num_sockets++] =3D sock_num; } > One more thing, if this patch is fixing a bug, I think "fix" should be ad= ded in > title. OK, I guess I can change the commit title and message. BTW note that there is a V3 with Thomas requested changes. If we agree on above I can submit a v4 with the last updates. >=20 > Thanks > Jingjing