From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0058.outbound.protection.outlook.com [104.47.40.58]) by dpdk.org (Postfix) with ESMTP id 1BA717D4E for ; Thu, 7 Sep 2017 10:16:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=U74oRmXI18unj9HK0PXOl7GJbqwv6GiD/h1VJDOLon8=; b=lq8qaMIz6hMFEv+R7VCeWl/dzkzvRhudSLPoXJBOpfJOrNqnZQsdSXoAbodiQucB2B4Tto+uCkFiS4j/J0sIU3DcI/pVgKjb8wIqn6HXgklhfZzVp2xc4K/DGNn9t8cxP/uQwJljaF8x7e5s8T9eBKaytTTr2rYWblkD0Txb/x4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [192.168.0.105] (103.76.56.167) by MWHPR07MB3104.namprd07.prod.outlook.com (10.172.95.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 7 Sep 2017 08:16:17 +0000 To: Olivier MATZ References: <20170815060743.21076-1-santosh.shukla@caviumnetworks.com> <20170906112834.32378-1-santosh.shukla@caviumnetworks.com> <20170906112834.32378-6-santosh.shukla@caviumnetworks.com> <20170907075903.jyohovh3h3mabvnz@neon> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <318a36fa-7c20-d13e-5c91-8a8887c65a99@caviumnetworks.com> Date: Thu, 7 Sep 2017 13:45:58 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170907075903.jyohovh3h3mabvnz@neon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [103.76.56.167] X-ClientProxiedBy: SG2PR06CA0138.apcprd06.prod.outlook.com (10.175.208.144) To MWHPR07MB3104.namprd07.prod.outlook.com (10.172.95.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7b741ea-b446-4389-ef1a-08d4f5c8b848 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR07MB3104; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3104; 3:rMHxNPsLAtd6tKkgqkbuakhu+b9tof6BwmVV0FrJ3cy7BYcz0qdvpNo6htf7T/aRlENAqKmbucf+TJOX9EYC69BqdRMmlyveTeOByJwLhQUAB3Ud9aPCvsL62g38fYomBtxDWmgZszv1YZcmOvfuxdNgIYXv5vsyr0na9Lm33cnAReskKpzUgKa28tyXzJUNqF+GymumKdeuOP/59naM7caqHbH7nUhHQr/lS0R/3dm8FSXhZjkLtxnRGGLX8UFj; 25:IbhDPpJGUiWAtP7287xh58+G1teA+vOqGwlWooNepJiZDs9suXwA4nLQ4k38g5zhPl57m6r8k/s4Ey8fEH/01iIiq/FVmnMm+sHOrxzDsGAcXRgJFBTEcfHwy9rAdfPxiZW9rhJHdw+AQpzcqHFK084785DIDEo2244lr+/x8BrShFsPRm/3+jhlATtH5Pyu+WO5fKLre+WgoduPx37qeD8noi110UcMbJcS0qcqlJZpkPSvSvxkm9+MDzUv4S7R9BQzYaGMG5LuagwYJRLxJn9IJWYs7nivUQlFkAChqjxniB6RaFPNxcmWQ3d/Epnqhx5NwPZ1ISSAuNf6q9jtaA==; 31:Kw7FpLsZ+mSuVInifNP5jTNZv89wY87XpLDtbRDAYo2fz5Q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Bdq9ee8XZzQrH/1yDH2JalivdRSyCVIApXrQxRUNX+ddbTHLILIDetP X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3104; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3104; X-Forefront-PRVS: 04238CD941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(199003)(132844002)(377454003)(189002)(24454002)(90366009)(77096006)(117156002)(106356001)(8656003)(25786009)(105586002)(83506001)(6486002)(4001350100001)(23746002)(54356999)(50986999)(101416001)(4326008)(76176999)(33646002)(229853002)(36756003)(97736004)(68736007)(189998001)(93886005)(6246003)(230700001)(50466002)(110136004)(86152003)(65956001)(65806001)(47776003)(66066001)(305945005)(7736002)(53936002)(5660300001)(42186005)(65826007)(64126003)(2906002)(6116002)(3846002)(31686004)(478600001)(6916009)(6666003)(31696002)(72206003)(81166006)(81156014)(42882006)(8676002)(2950100002)(8936002)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3104; H:[192.168.0.105]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR07MB3104; 23:190zROM4rhEiicDiNnDiOyf1C9YCYrrWaK37w?= =?Windows-1252?Q?L5NXqdn515qOEMIhLH+jAp0WJQUMIBe0tp9qJMaexCnN+hl1XYRFXtNl?= =?Windows-1252?Q?zosRjZ8akQQ12zvbzeVjHA3uC/CKNDLsRtmHgilvqTDv1cry2FUTvHaE?= =?Windows-1252?Q?7DlZHZK/8ykqUH6/xTqC3IeXPdYyCuiBv9RDh/YmmUxslwRpPkbj8YDw?= =?Windows-1252?Q?xByDiVDGRgDAJ1miPKUvgcJD5q6CRgsXHBddNEuSzQHuU2X14bti1QYy?= =?Windows-1252?Q?k64APRdkDaCJWso4iwy5hnsVxLHJRU+pz1cDoOp4RHmRAgBGV53YRcsA?= =?Windows-1252?Q?mzznoYIC+rKQCaMCcbt8kjTpcwKRxvLnfb8F7ARkVT+N2I+ixe+gOuMJ?= =?Windows-1252?Q?FHa/8IZlMbqCFDppxmjm3s6XBZgI5ofAammRRw1mOJPmXRaQx0ZJ4o+g?= =?Windows-1252?Q?RR0mzMiACCPzlPjH0p1NRB4DdF9CsxS1xqKbJ5MrGUyUEF0hhDAN7iKG?= =?Windows-1252?Q?B1wzVzOKmocWmplT+MBfLb61SkG7BPLkBYvJCX2ep0Uua+cbqicSzqK/?= =?Windows-1252?Q?sa+qrMDV0Nt1DBcTwQohtNfRQRKRvq7e6Ra9Ww81E7moZ8jAEDTocLTO?= =?Windows-1252?Q?J1eihtT4vlTkhYmacc3Z6Ho8dDJy+nlGY42/qeG33Z93jY6FqUjV6R2y?= =?Windows-1252?Q?5kIqurchp6ghdwYc3x9MC9Eu+/pYRzvGXK5/d/KThDQTPmkfSoP/79TP?= =?Windows-1252?Q?VmTNejC/6hQ/2R/MR3Z6m8ejAnlCvvjkW8SAn7lHUTqbv1nPsRLnQ/ky?= =?Windows-1252?Q?gulqIUByGoKktVZUpJsMqf1SlyhNt1e6M84aE/JbrsHYoxU+brrlWOn0?= =?Windows-1252?Q?/go+YYLZrPJZgCx0+jLNMyB7XQ+NciGONq9imIzQ+Z7QQfT6Shf/sNLb?= =?Windows-1252?Q?NU4oauY/O64GPDiTY56Q7LBAIjuT9FZytO9Yqn8Si7gGGVmsjZrJCcl3?= =?Windows-1252?Q?LMEb0glRqnk2DgPVnCpIaubnXrJW4phTnS8zk+P3CPIh2oKrrDcqgM9t?= =?Windows-1252?Q?lcr1/hv4yiyjPMdPlUz2W+Xj5uNTwrKWmYw1kkKmjvw0R06ovz/EmIWn?= =?Windows-1252?Q?7p1ua3jxoWLAt17WFyRPS2eqiAwLsx/FWc1EzI7xRUkGZuySUQ2so7/F?= =?Windows-1252?Q?6vVFGukkTyaPXAlTIWbt/Io0pzchdfovMr/FRS8U1rpjKqDd/KJqk+S5?= =?Windows-1252?Q?WCYHuvS3RnRy8pdS+z40FhiBeMFzUzCTyuJVjHvAQymtPii3GnLp3b+W?= =?Windows-1252?Q?6QiIov3gqRgENc3J0FvilQYAhdMwKY21+WdnQFF2l8+g+0YhPBvXykAJ?= =?Windows-1252?Q?B0U++ay8oI38bclIwoAxONoWtuxytM99n2DU4qIks62+cfWBWYg8yxJ8?= =?Windows-1252?Q?PmyXf1JmdUcaafDGnE52FILC9+V67/CBXmxYrpUJmF8z2wabRXiNzLtI?= =?Windows-1252?Q?RS5O+5o9m+8fxZez0vDugPAzr1i4UHaEOSXlJbsx7R1Shdat14hLegEL?= =?Windows-1252?Q?32ysx1whxffFGY=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3104; 6:qQcHlRGJStg2wqcdUJdE5Dr/X1eAl7Hw2CdLQ3VPesYslxl8MkO/OtikC9keFw99l5mskDIZJQUotBIq32SJ66/mwzNYow2GLwg7abKjO0UecD6yNmwLev3j+rpG7gwO/4iiJvN4mWWgSxNjDKb/vun+WlFN3C0KzFWsWGK4ddSTBfAoYo9qU9CBmCzCnG1su4duczYnKwkp9Enc611FmvIz+xSDJ98ltEfwUHcZdyjG2ZW2rY4N/ja1JlIr43PRuUsicPKhHHH4Epy+caGOoXFkvndqtGCfvSSJNy5U5qQFh24GA5E0SZs8C2kdVE5Byb0Dt7XzpqJNeAAqsfDmLA==; 5:g9ED4t+fxn9m7PL1ZjGSBPKZcbAgfNQjtOwiCeI3Avg4/XBYui3tSAtN9mgARqzzqtcmySRn/yd71Oq4l0KR5yADEpY9FbQnspl+5VlUFgdlgddbRrW5s8MSdHlZyrs5Hiv/h4aipg8rocjIiUGVlg==; 24:BVkh+B/OrM8v4LigvtNlv97+lUFVzdIxa5APwYp+zy36xsHWDKZNj/khddLR0X9LnikbhmvQpsm0IW34HH5wsA3kCHYL51B2jsiZVTMZiGQ=; 7:4Pe8epWeyI0p1z5ESzSIMAjolpuJgNhL4T3+tPBJQinuro+eewvWpHT0llS8vTONopUBFs5XasGa0gqXSlJWJgHzbD/H1AJeSEwa1TdbsWXKroXASHxU8JQxn/Hu4vlWHMgCPM+XSeK1CkEZ1msMfycGzcI5FKSBbAcAa0hk/VYrRK5vs7TH3eHCZwzW6GvUZGmTXcszMt3j4VliQXAln2qoWctf1h8OhsYLr/nb3CU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2017 08:16:17.9277 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3104 Subject: Re: [dpdk-dev] [PATCH v5 5/8] mempool: get the mempool capability 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: Thu, 07 Sep 2017 08:16:23 -0000 On Thursday 07 September 2017 01:29 PM, Olivier MATZ wrote: > On Wed, Sep 06, 2017 at 04:58:31PM +0530, Santosh Shukla wrote: >> Allow mempool driver to advertise his pool capability. >> For that pupose, an api(rte_mempool_ops_get_capabilities) > typo: pupose -> purpose v6. >> ... >> --- a/lib/librte_mempool/rte_mempool.c >> +++ b/lib/librte_mempool/rte_mempool.c >> @@ -528,6 +528,12 @@ rte_mempool_populate_default(struct rte_mempool *mp) >> if (mp->nb_mem_chunks != 0) >> return -EEXIST; >> >> + /* Get mempool capability */ > capability -> capabilities v6. >> + ret = rte_mempool_ops_get_capabilities(mp, &mp->flags); >> + if (ret < 0) >> + RTE_LOG(DEBUG, MEMPOOL, "get_capability not supported for %s\n", >> + mp->name); >> + > I think the error can be ignored only if it's -ENOTSUP. > Else, the error should be propagated. v6. > >> --- a/lib/librte_mempool/rte_mempool.h >> +++ b/lib/librte_mempool/rte_mempool.h >> @@ -389,6 +389,12 @@ typedef int (*rte_mempool_dequeue_t)(struct rte_mempool *mp, >> */ >> typedef unsigned (*rte_mempool_get_count)(const struct rte_mempool *mp); >> >> +/** >> + * Get the mempool capability. >> + */ > capability -> capabilities > v6. >> +typedef int (*rte_mempool_get_capabilities_t)(const struct rte_mempool *mp, >> + unsigned int *flags); >> + >> /** Structure defining mempool operations structure */ >> struct rte_mempool_ops { >> char name[RTE_MEMPOOL_OPS_NAMESIZE]; /**< Name of mempool ops struct. */ >> @@ -397,6 +403,10 @@ struct rte_mempool_ops { >> rte_mempool_enqueue_t enqueue; /**< Enqueue an object. */ >> rte_mempool_dequeue_t dequeue; /**< Dequeue an object. */ >> rte_mempool_get_count get_count; /**< Get qty of available objs. */ >> + /** >> + * Get the pool capability >> + */ >> + rte_mempool_get_capabilities_t get_capabilities; > capability -> capabilities > v6. >> } __rte_cache_aligned; >> >> #define RTE_MEMPOOL_MAX_OPS_IDX 16 /**< Max registered ops structs */ >> @@ -509,6 +519,22 @@ unsigned >> rte_mempool_ops_get_count(const struct rte_mempool *mp); >> >> /** >> + * @internal wrapper for mempool_ops get_capabilities callback. >> + * >> + * @param mp [in] >> + * Pointer to the memory pool. >> + * @param flags [out] >> + * Pointer to the mempool flag. >> + * @return >> + * - 0: Success; mempool driver has advetised his pool capability by Oring to >> + * flags param. >> + * - <0: Error; code of capability function. >> + */ >> +int >> +rte_mempool_ops_get_capabilities(const struct rte_mempool *mp, >> + unsigned int *flags); >> + >> +/** > The API is correct, but the flags should simply be returned, not or-ed. > I think it should be kept as simple as possible: a function called > get_somthing() is expected to return it without doing anything else. > Sorry if I wasn't clear in my previous message. > > If there is a need to do a OR with mp->flags, it has to be done in the caller, > i.e. rte_mempool_populate_default(). > pl. confirm : you want below approach: unsigned int flags; rte_mempool_ops_get_capabilities(mp, &flags) mp->flags |= flags; is that okay with you? i'll queue in v6