From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1AAF6C55A for ; Thu, 16 Jun 2016 09:04:57 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 16 Jun 2016 00:04:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,478,1459839600"; d="scan'208";a="122858882" Received: from dhunt5-mobl.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by fmsmga004.fm.intel.com with ESMTP; 16 Jun 2016 00:04:47 -0700 To: Shreyansh Jain , Olivier MATZ , Jan Viktorin References: <1465919341-3209-1-git-send-email-david.hunt@intel.com> <1465976824-83823-1-git-send-email-david.hunt@intel.com> <20160615121358.5ef9f142@pcviktorin.fit.vutbr.cz> <57614043.9090603@intel.com> <57614402.6020708@6wind.com> <576183AD.8070200@intel.com> <576184F7.3040206@6wind.com> Cc: "dev@dpdk.org" , "jerin.jacob@caviumnetworks.com" From: "Hunt, David" Message-ID: <57624F8C.20602@intel.com> Date: Thu, 16 Jun 2016 08:04:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v12 0/3] mempool: add external mempool manager 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: Thu, 16 Jun 2016 07:04:58 -0000 Hi Shreyansh, On 16/6/2016 5:35 AM, Shreyansh Jain wrote: > Though I am late to the discussion... > >> -----Original Message----- >> From: Olivier MATZ [mailto:olivier.matz@6wind.com] >> Sent: Wednesday, June 15, 2016 10:10 PM >> To: Hunt, David ; Jan Viktorin >> >> Cc: dev@dpdk.org; jerin.jacob@caviumnetworks.com; Shreyansh Jain >> >> Subject: Re: [PATCH v12 0/3] mempool: add external mempool manager >> >> >> >> On 06/15/2016 06:34 PM, Hunt, David wrote: >>> >>> On 15/6/2016 1:03 PM, Olivier MATZ wrote: >>>> [...] >>>> >>>> The opaque pointer would be saved in mempool structure, and used >>>> when the mempool is populated (calling mempool_ops_alloc). >>>> The type of the structure pointed by the opaque has to be defined >>>> (and documented) into each mempool_ops manager. >>>> >>>> >>>> Olivier >>> >>> OK, just to be sure before I post another patchset..... >>> >>> For the rte_mempool_struct: >>> struct rte_mempool_memhdr_list mem_list; /**< List of memory >>> chunks */ >>> + void *ops_args; /**< optional args for ops >>> alloc. */ >>> >>> (at the end of the struct, as it's just on the control path, not to >>> affect fast path) >> Hmm, I would put it just after pool_data. > +1 > And, would 'pool_config' (picked from a previous email from David) a better name? > > From a user perspective, the application is passing a configuration item to the pool to work one. Only the application and mempool allocator understand it (opaque). > As for 'ops_arg', it would be to control 'assignment-of-operations' to the framework. > > Maybe just my point of view. I agree. I was originally happy with pool_config, sits well with pool_data. And it's data for configuring the pool during allocation. I'll go with that, then. >>> Then change function params: >>> int >>> -rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name); >>> +rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name, >>> + void *ops_args); >>> >>> And (almost) finally in the rte_mempool_set_ops_byname function: >>> mp->ops_index = i; >>> + mp->ops_args = ops_args; >>> return 0; >>> >>> Then (actually) finally, add a null to all the calls to >>> rte_mempool_set_ops_byname. >>> >>> OK? :) >>> >> Else, looks good to me! Thanks David. > Me too. Though I would like to clarify something for my understanding: > > Mempool->pool_data => Used by allocator to store private data > Mempool->pool_config => (or ops_arg) used by allocator to access user/app provided value. > > Is that correct? Yes, that's correct. Regard, David.