From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <david.hunt@intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id D78F695DB
 for <dev@dpdk.org>; Thu,  4 Feb 2016 18:34:48 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga102.jf.intel.com with ESMTP; 04 Feb 2016 09:34:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,396,1449561600"; d="scan'208";a="877101583"
Received: from dhunt5x-mobl3.ger.corp.intel.com (HELO [10.237.221.96])
 ([10.237.221.96])
 by orsmga001.jf.intel.com with ESMTP; 04 Feb 2016 09:34:46 -0800
To: Olivier MATZ <olivier.matz@6wind.com>, dev@dpdk.org
References: <1453829155-1366-1-git-send-email-david.hunt@intel.com>
 <1453829155-1366-2-git-send-email-david.hunt@intel.com>
 <56B365A0.3080206@6wind.com>
From: "Hunt, David" <david.hunt@intel.com>
Message-ID: <56B38BB6.7080701@intel.com>
Date: Thu, 4 Feb 2016 17:34:46 +0000
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <56B365A0.3080206@6wind.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH 1/5] mempool: add external mempool manager
	support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Feb 2016 17:34:49 -0000

On 04/02/2016 14:52, Olivier MATZ wrote:
> Hi David,

[snip]

Just a comment on one of your comments:

> Why not using a similar mechanism than what we have for PMDs?
>
>      void rte_eal_driver_register(struct rte_driver *driver)
>      {
>          TAILQ_INSERT_TAIL(&dev_driver_list, driver, next);
>      }
>
> To do that, you just need to add a TAILQ_ENTRY() in your
> rte_mempool_handler structure. This would avoid to duplicate the
> structure into a static array whose size is limited.
>
> Accessing to the callbacks would be easier:
>
>      return mp->mp_handler->put(mp->rt_pool, obj_table, n);

One of the iterations of the code did indeed use this mechanism, however 
I ran into problems with multiple processes using the same mempool. In 
that case, the 'mp_handler' element of the mempool in your return 
statement  is only valid for one of the processes. Hence the need for 
and index that's valid for all processes rather than a pointer that's 
valid for only one. And it's not easy to quickly index into an element 
in a queue, hence the array of 16 mempool_handler structs.

[snip]

Rgds,
Dave.