From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: error in testpmd when CONFIG_RTE_BUILD_SHARED_LIB=y Date: Wed, 12 Apr 2017 14:43:36 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583FAE8610@IRSMSX109.ger.corp.intel.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Thomas Monjalon , john miller , "dev@dpdk.org" , "olivier.matz@6wind.com" To: Shreyansh Jain , "Richardson, Bruce" Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 872EE377A for ; Wed, 12 Apr 2017 16:43:41 +0200 (CEST) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Shreyansh Jain > Sent: Wednesday, April 12, 2017 12:02 PM > To: Richardson, Bruce > 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 > > -----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_L= IB=3Dy > > > > 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.c= om > > > > > 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= .com > > > > > > 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 = master > > > > > 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: Inval= id > > argument > > > > > > > > > > > > > > > > > > This error occurs as a result of the rte mempool ops tabl= e > > 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 sta= tic > > > > > > initialization > > > > > > > > MACRO MEMPOOL_REGISTER_OPS and exists in librte_mempool_rin= g.so. > > > > > However > > > > > > > > this library is not loaded when the rte_eal_init() gets cal= led 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 othe= r > > shared > > > > > lib. > > > > > > > > > > > > > > > > > > > I think this is a bug that should be fixed. The user should not= need > > to > > > > > > have to specify a mempool driver just to get testpmd working, s= o I > > think > > > > > > the ring handler as default should be compiled in automatically= so 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 sh= ared > > library case, this still means "-d". > > > > > > > > > > Not necessarily. That only applies if we don't explicitly link it lik= e > > > 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 loa= d > > > them at runtime. This is one case where I think all apps should > > > explicitly link against the ring mempool driver. There is no reason w= e > > > 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 dri= ver is > > > > > > available. > > > > > > > > > > > > > > Yes, that is something to be improved. > > > > > > > > > > > > This should be fixed by always having a mempool driver installe= d. > > > > > > > > > > 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 wit= h testpmd. > For Shared library, the idea is to have small footprint and leave it to u= ser to link what is required, and what is not. >=20 > 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= option when creating the mempool (ring_mp_mc) > 3. Don't link any >=20 > (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 always say 'n' in config file). >=20 > So, if we are going to select the mempool as inbuild, we might as well ha= ve it only for Ring (2). My vote would be for option 2. Konstantin