From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0059.outbound.protection.outlook.com [104.47.2.59]) by dpdk.org (Postfix) with ESMTP id 290D614EC; Sun, 7 May 2017 08:06:05 +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=FVtbHzBZIDPsnSqBBw84XPOILWMaxmaPZ6uNV2cXeQ8=; b=Mi9FY1vO83FtMh7+8uetYdawNoJuKZ47LkFbBHh5TbP0PQ6nXeG6LIFRrQ48KQQ/G9aXkAuJ11tI+syyvuMm9W6fWhwTPtZGA+Xi1FG6qKXjkK5qYtL8exK23kYS8idGy3MFzNhQuWooksJbV8PTVx8VIlyF8CwtM0j5bYJD5I8= Received: from AM4PR05MB1505.eurprd05.prod.outlook.com (10.164.79.147) by AM4PR05MB1505.eurprd05.prod.outlook.com (10.164.79.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Sun, 7 May 2017 06:06:03 +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; Sun, 7 May 2017 06:06:03 +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: AQHSxBNp1t3OWA7cnEOT0jxDsZdn0qHmi32AgAHagfA= Date: Sun, 7 May 2017 06:06:03 +0000 Message-ID: References: <20170503134429.22723-1-shahafs@mellanox.com> <9BB6961774997848B5B42BEC655768F810D624B2@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810D624B2@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: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1505; 7:sirU85llexdHQ1c2yy4kc0i+fB8vu2oiC7dayG44RUL+eBqdxzOwrP7x3pUjJOSga4mJXnmYSd5/+lQUYUJjKJ/N679oLAahdtU02/uSlSqTJhSVJQGPK4ZP1mY0Bh+aherUP3PofgHxzGzmtSjM9eNRwvsVcupGrxe8M0Fp8WAM56dtHBdo43qaNdR21YzuvZ7odAHejbxK2wr6a1lsYqxXhqzdscDwHOsUghZdZerYS49jd7EEJ1C/peGUDmdNKNSDFDkSrdEDLH82Ikd9KCUy2C4Q7xpptqp/6HWC69yGa3+QWnUOdk8UbtP35ye4PR1Gcx4T80uxxwmC2mJrLg== x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: a34fa29f-8763-46df-1ba1-08d4950f248a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:AM4PR05MB1505; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:AM4PR05MB1505; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1505; x-forefront-prvs: 03008837BD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39840400002)(39860400002)(39400400002)(39850400002)(39450400003)(39410400002)(377454003)(38730400002)(5660300001)(74316002)(25786009)(305945005)(189998001)(110136004)(6506006)(81166006)(54906002)(76176999)(8676002)(6916009)(4326008)(33656002)(2950100002)(2906002)(6436002)(54356999)(6116002)(102836003)(3846002)(50986999)(99286003)(5250100002)(3660700001)(55016002)(478600001)(53936002)(229853002)(3280700002)(6246003)(86362001)(7696004)(8936002)(9686003)(2900100001)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1505; 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: 07 May 2017 06:06:03.5380 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1505 Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: support non contiguous socket ids 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: Sun, 07 May 2017 06:06:05 -0000 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 f= ail. > > > > 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.=20 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_so= cket_id return a valid id and not need to add 1.