From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <shreyansh.jain@nxp.com>
Received: from emea01-db3-obe.outbound.protection.outlook.com
 (mail-db3on0079.outbound.protection.outlook.com [157.55.234.79])
 by dpdk.org (Postfix) with ESMTP id 05ED6C51A
 for <dev@dpdk.org>; Thu, 16 Jun 2016 06:35:23 +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=NqOQupp+5JtgWaga3qORbci4p2YOpuMGOBC4zp5b5n4=;
 b=BIAxaklxk3G7Z+e9UzXu3zN1INwEJlIKgFwxUZOHPbHIaXIwg342eqvhphZcHp4pYrXKL8/msrCpokK1oFfuo+PEZA4COLxuDofZhnH8c3WrUVSk/42msks56RsqL5ZkAOeRhkseQRIHGQfYqK9jZcAUoRvUVC/hKEDJVLKiaPU=
Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) by
 DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) with Microsoft SMTP
 Server (TLS) id 15.1.517.8; Thu, 16 Jun 2016 04:35:21 +0000
Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) by
 DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) with
 mapi id 15.01.0517.014; Thu, 16 Jun 2016 04:35:21 +0000
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Olivier MATZ <olivier.matz@6wind.com>, "Hunt, David"
 <david.hunt@intel.com>, Jan Viktorin <viktorin@rehivetech.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, "jerin.jacob@caviumnetworks.com"
 <jerin.jacob@caviumnetworks.com>
Thread-Topic: [PATCH v12 0/3] mempool: add external mempool manager
Thread-Index: AQHRxtom50tvB6kvdUyaa1muiFBxWp/qT44AgAAaEICAAAR3AIAAS+aAgAABiYCAAMX+sA==
Date: Thu, 16 Jun 2016 04:35:14 +0000
Deferred-Delivery: Thu, 16 Jun 2016 04:35:00 +0000
Message-ID: <DB5PR0401MB2054868836F2EBF18439440790560@DB5PR0401MB2054.eurprd04.prod.outlook.com>
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>
In-Reply-To: <576184F7.3040206@6wind.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=shreyansh.jain@nxp.com; 
x-originating-ip: [192.88.169.1]
x-ms-office365-filtering-correlation-id: 6434e05d-782a-4a7e-0a10-08d3959fa0c0
x-microsoft-exchange-diagnostics: 1; DB5PR0401MB2054;
 6:He1VzDUCXtanZP/LOAkE8VsMOH/oD4EUt0cT+EJ4LamrknfhI5eVmYZ4EzFzqyrUEtHZ/kSQgoq/jA/e/sD0TwzXVxnY8aI6BJmZSAOcNk385X3frJL3MiRILJLAUjKF+JDf/VVycYx7K32xRqqU70ILBZCqStiETqQiLIrCnjUCIv8ZsHuNp5pEoZHgWwpN9i4GUa5BXKi9HkFehzkcFidMyhHMYJUSJlYBCwawfPzLyyK+/OuqcHbFIcFWaSqrXutgHzT+6GgPY5/AfJ3sZH4FleTZeuvnbMCgUDPumBuzQMKgO3r69insabKi1bYL;
 5:8Fl9zUScZ3JiheVPmWZ/2HBlDShzKnhVfWXHt20JvELl+EfP4t+C49u0QhnhJ3CjIcktgIKP6W0+gCGYebLoik4hyeYVnSCmud5tJWxs1Ypb7rYeOuBA+C6XINlnYOrwcE2hjtfEEod4vTJYw8p4hQ==;
 24:2FFgwWoDEQnYE1vPV0yiDDILMmcATqj8TWHTzQMzgPidMxQjwW83J39F3gx2WEAVwNRyP9AzIZPkRWmRHTDA04JamChVxcjg1Aw5JOY7P5I=;
 7:Jr7GzUx0qGz6pjjJS3WIQrb9t13U9rOKI/Yy8Bh+pODrwnv/Dh9TR2FGv4Grsu9NnVQuBAlbqnqjMhXVSGRn6Ea/LdioGPyk3Q5VWBin8okWoXbQlRl5MrSOVwpTCfKCJapYiS+wsX3Inylup9A9Jsr+b2tvvu3xoOm3jVJ3vrey3pg/4h+4sPnD7tB1Dc1S7P+qEROoICH9pcZw4wU5VQ==
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR0401MB2054;
x-microsoft-antispam-prvs: <DB5PR0401MB2054D22CE5CAD6B4FD0876C590560@DB5PR0401MB2054.eurprd04.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(185117386973197)(228905959029699);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
 RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);
 SRVR:DB5PR0401MB2054; BCL:0; PCL:0; RULEID:; SRVR:DB5PR0401MB2054; 
x-forefront-prvs: 09752BC779
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(6009001)(7916002)(377454003)(189002)(24454002)(199003)(13464003)(101416001)(2900100001)(2950100001)(3280700002)(10400500002)(8936002)(2906002)(81166006)(5004730100002)(77096005)(5008740100001)(8676002)(81156014)(33656002)(5001770100001)(87936001)(68736007)(586003)(54356999)(3846002)(97736004)(5002640100001)(4326007)(19580405001)(5003600100002)(102836003)(74316001)(19580395003)(106116001)(106356001)(76176999)(3660700001)(86362001)(105586002)(50986999)(122556002)(189998001)(6116002)(9686002)(93886004)(92566002)(11100500001)(76576001)(66066001);
 DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0401MB2054;
 H:DB5PR0401MB2054.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords;
 MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; 
received-spf: None (protection.outlook.com: nxp.com does not designate
 permitted sender hosts)
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: 16 Jun 2016 04:35:21.7789 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0401MB2054
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 <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, 16 Jun 2016 04:35:23 -0000

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 <david.hunt@intel.com>; Jan Viktorin
> <viktorin@rehivetech.com>
> Cc: dev@dpdk.org; jerin.jacob@caviumnetworks.com; Shreyansh Jain
> <shreyansh.jain@nxp.com>
> Subject: Re: [PATCH v12 0/3] mempool: add external mempool manager
>=20
>=20
>=20
> 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)
>=20
> 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 understan=
d it (opaque).
As for 'ops_arg', it would be to control 'assignment-of-operations' to the =
framework.

Maybe just my point of view.

>=20
>=20
> >
> > 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 =3D i;
> > +       mp->ops_args =3D ops_args;
> >          return 0;
> >
> > Then (actually) finally, add a null to all the calls to
> > rte_mempool_set_ops_byname.
> >
> > OK? :)
> >
>=20
> Else, looks good to me! Thanks David.

Me too. Though I would like to clarify something for my understanding:

Mempool->pool_data =3D> Used by allocator to store private data
Mempool->pool_config =3D> (or ops_arg) used by allocator to access user/app=
 provided value.

Is that correct?

-
Shreyansh