From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30047.outbound.protection.outlook.com [40.107.3.47]) by dpdk.org (Postfix) with ESMTP id 1D3B33005 for ; Wed, 12 Apr 2017 13:02:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=o9gwy6SJ2R1WlzHTf44VaqcG2/WuirzyjNDtnZlIa8k=; b=adnrBO7BK9uBpwu5fSB4CMUHP3pssPr8NQpbdD18CnQSQyTsrepsFkurbpFFZdW/GQq2KrodVud1Jxz01PFv5vE8o/gD4Jif+AAnuUYZwnvJbZZQSAi7zykArFEa7c3J6o17y/tgyynHFWJjrjs71ncYTrpubC1qz/Jz6dF/ee8= Received: from VI1PR0401MB2464.eurprd04.prod.outlook.com (10.168.64.147) by VI1PR0401MB2461.eurprd04.prod.outlook.com (10.168.64.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Wed, 12 Apr 2017 11:02:26 +0000 Received: from VI1PR0401MB2464.eurprd04.prod.outlook.com ([10.168.64.147]) by VI1PR0401MB2464.eurprd04.prod.outlook.com ([10.168.64.147]) with mapi id 15.01.1019.025; Wed, 12 Apr 2017 11:02:26 +0000 From: Shreyansh Jain To: Bruce Richardson CC: Thomas Monjalon , john miller , "dev@dpdk.org" , "olivier.matz@6wind.com" Thread-Topic: [dpdk-dev] error in testpmd when CONFIG_RTE_BUILD_SHARED_LIB=y Thread-Index: AQHSsvnI2e0Pji/1mkmkConF81MA66HBKgfwgABYnQCAAATLkIAAAhIggAACg4CAAADggIAAAaxg Date: Wed, 12 Apr 2017 11:02:25 +0000 Deferred-Delivery: Wed, 12 Apr 2017 11:02:06 +0000 Message-ID: References: <357262EF-AA7B-4064-963E-FF130E4607E6@atomicrules.com> <1675520.qVeAGBHxLM@xps13> <20170412100521.GB20092@bricha3-MOBL3.ger.corp.intel.com> <20170412103855.GA36092@bricha3-MOBL3.ger.corp.intel.com> <20170412104203.GA38724@bricha3-MOBL3.ger.corp.intel.com> In-Reply-To: <20170412104203.GA38724@bricha3-MOBL3.ger.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=nxp.com; x-originating-ip: [192.88.169.1] x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2461; 7:UhCp1oY9tVsQmr7ourPOSckdAlBx4h3+hbRJNYN06qIw2i5VPViwQndMvbEfoDVegPckl5EjO4MtJPTNeDoQvCDNkyl3aySv3So8NmrwztyJQX1B3nBZ1t0Kjq+74LtqWxQBdgpOa6VufuDj+JyTnnsB6AJpJ0QySKuvxC7K9Oa82EKm4UHJ8nNS2zU4SuLpR1NEmzabipijhuqQQoQyesm/c5GE2BXyT5ziWN2nV4+b0kmOSY24nBtqyFsX+HSD7AoKGglQeW/15ErqKC94j9Dzy51Km2Cd/ISLDrsre9oMBQ4PCRfSPrAXFLrd1GSdAva5Fd2Pmii46Feb2+KQEw== x-ms-office365-filtering-correlation-id: fa0c5c34-0cfe-4f48-78c1-08d4819367b5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:VI1PR0401MB2461; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:VI1PR0401MB2461; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2461; x-forefront-prvs: 027578BB13 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(39400400002)(39410400002)(39450400003)(39840400002)(39850400002)(13464003)(377454003)(377424004)(24454002)(76176999)(53936002)(2950100002)(54356999)(77096006)(6916009)(54906002)(7696004)(6116002)(6436002)(6506006)(7736002)(81166006)(55016002)(305945005)(229853002)(6246003)(8676002)(5660300001)(74316002)(38730400002)(110136004)(2906002)(66066001)(122556002)(99286003)(3660700001)(3846002)(50986999)(53546009)(3280700002)(4326008)(25786009)(86362001)(102836003)(2900100001)(33656002)(189998001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2461; H:VI1PR0401MB2464.eurprd04.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: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2017 11:02:26.4102 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2461 Subject: Re: [dpdk-dev] error in testpmd when CONFIG_RTE_BUILD_SHARED_LIB=y 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: Wed, 12 Apr 2017 11:02:28 -0000 > -----Original Message----- > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: Wednesday, April 12, 2017 4:12 PM > To: Shreyansh Jain > Cc: Thomas Monjalon ; john miller > ; dev@dpdk.org; olivier.matz@6wind.com > Subject: Re: [dpdk-dev] error in testpmd when CONFIG_RTE_BUILD_SHARED_LIB= =3Dy >=20 > On Wed, Apr 12, 2017 at 11:38:55AM +0100, Bruce Richardson wrote: > > On Wed, Apr 12, 2017 at 10:33:10AM +0000, Shreyansh Jain wrote: > > > My bad - I was too quick in replying - some clarification beneath. > > > > > > > -----Original Message----- > > > > From: Shreyansh Jain > > > > Sent: Wednesday, April 12, 2017 3:55 PM > > > > To: 'Bruce Richardson' > > > > Cc: Thomas Monjalon ; john miller > > > > ; dev@dpdk.org; olivier.matz@6wind.com > > > > Subject: RE: [dpdk-dev] error in testpmd when > CONFIG_RTE_BUILD_SHARED_LIB=3Dy > > > > > > > > > -----Original Message----- > > > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > > > Sent: Wednesday, April 12, 2017 3:35 PM > > > > > To: Shreyansh Jain > > > > > Cc: Thomas Monjalon ; john miller > > > > > ; dev@dpdk.org; olivier.matz@6wind.c= om > > > > > Subject: Re: [dpdk-dev] error in testpmd when > CONFIG_RTE_BUILD_SHARED_LIB=3Dy > > > > > > > > > > On Wed, Apr 12, 2017 at 04:52:47AM +0000, Shreyansh Jain wrote: > > > > > > > -----Original Message----- > > > > > > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > > > > > Sent: Wednesday, April 12, 2017 12:58 AM > > > > > > > To: john miller > > > > > > > Cc: dev@dpdk.org; olivier.matz@6wind.com; Shreyansh Jain > > > > > > > > > > > > > > Subject: Re: [dpdk-dev] error in testpmd when > > > > > CONFIG_RTE_BUILD_SHARED_LIB=3Dy > > > > > > > > > > > > > > 2017-04-11 14:02, john miller: > > > > > > > > > > > > > > > > We are seeing an issue when running from the head of the ma= ster > > > > branch > > > > > in > > > > > > > dpdk-next-net and building with CONFIG_RTE_BUILD_SHARED_LIB= =3Dy. > When > > > > we > > > > > run > > > > > > > testpmd using -d to point to our PMD we get this error > > > > > > > > > > > > > > > > EAL: Error - exiting with code: 1 > > > > > > > > Cause: Creation of mbuf pool for socket 0 failed: Invalid > argument > > > > > > > > > > > > > > > > This error occurs as a result of the rte mempool ops table > having 0 > > > > > > > entries. This table is populated from a call to > > > > > rte_mempool_register_ops(). > > > > > > > This function gets called in rte_mempool_ring.c via the stati= c > > > > > initialization > > > > > > > MACRO MEMPOOL_REGISTER_OPS and exists in librte_mempool_ring.= so. > > > > However > > > > > > > this library is not loaded when the rte_eal_init() gets calle= d so > the > > > > > static > > > > > > > initializers are not yet loaded. > > > > > > > > > > > > > > > > I am requesting advice on the proper way to repair this. > > > > > > > > > > > > "-d" the ring library (rte_mempool_ring) - just like any other > shared > > > > lib. > > > > > > > > > > > > > > > > I think this is a bug that should be fixed. The user should not n= eed > to > > > > > have to specify a mempool driver just to get testpmd working, so = I > think > > > > > the ring handler as default should be compiled in automatically s= o as > to > > > > > allow regular mempools to just work as before. > > > > > > > > For Ring Mempool as default enabled, +1 > > > > > > Actually, Ring mempool is enabled by default. But, obviously for shar= ed > library case, this still means "-d". > > > > > > > Not necessarily. That only applies if we don't explicitly link it like > > the other shared libraries. We "special-case" our drivers in that we > > don't add them with a -l flag, but expect the user to dynamically load > > them at runtime. This is one case where I think all apps should > > explicitly link against the ring mempool driver. There is no reason we > > can't make some drivers mandatory. > > > > > > > > > > > > > > > > > This change was done recently to move ring handler into its > separate > > > > > drivers/mempool/ring directory. That also means it no longer is > compiled > > > > into > > > > > the librte_mempool. > > > > > > > > > > > > > > > > > > > > We should just add a better error message if no mempool drive= r is > > > > > available. > > > > > > > > > > > > Yes, that is something to be improved. > > > > > > > > > > This should be fixed by always having a mempool driver installed. > > > > > > > > Agree. > > > > > > Probably, as ring mempool is a driver and compiled in shared mode, > enabled by default will not fix this. > > > > But linked in by default will fix it. > > > And as follow-up to my own mail, I think we can actually go further > here. Mempool is a core library, and very little can be done in DPDK > without it. It's also not what most people would think as needing a > driver loaded, so from a usability point of view, I don't see why we > shouldn't link in all mempool drivers by default, like we do other libs. > It will make users life easier, and I can't see any downside to doing > so - they are just .so's after all! =20 I don't have a particularly strong opinion against this. For static build, we are already 'there' - mempool would be linked in with = testpmd. For Shared library, the idea is to have small footprint and leave it to use= r to link what is required, and what is not. Still, for usability sakes, we have three options: 1. Link all library - which might be more than just ring (stack, more to be= added soon...) 2. Only link ring by default - because that is also being used as default o= ption when creating the mempool (ring_mp_mc) 3. Don't link any (3) is a cleaner approach, but may not be a good usecase. But, going by (1)= would mean linking in unused mempool handler by default (yes, user could a= lways say 'n' in config file). So, if we are going to select the mempool as inbuild, we might as well have= it only for Ring (2). It's more important to make DPDK useful than to make it idealistic. :) >=20 > /Bruce