From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0071.outbound.protection.outlook.com [104.47.36.71]) by dpdk.org (Postfix) with ESMTP id 9B53F7D4B for ; Mon, 4 Sep 2017 18:29:33 +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=dMHfBq5eCaaCj2FvKcyuD0MxW5QIj4ARtSQQ6WDjaWI=; b=hJSUUCrzjGqfM4UE+I1evCN5mNokN6wOhDEg0F652d/7corj0eQP3k4MmsiQCSHg7GT7M3l6Xei0/1RjG7pFrdexKVvClee6qRH6iIqxGzvJvHifjVw7NT3M3Inc8sqEnqN8YBANfzZ5ELapuFVXtVnhuTdfJXjjEn8QxjzrFk4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [10.89.1.1] (14.140.2.178) by CY4PR07MB3095.namprd07.prod.outlook.com (10.172.115.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Mon, 4 Sep 2017 16:29:29 +0000 To: Olivier MATZ References: <20170720134759.4680-1-santosh.shukla@caviumnetworks.com> <20170815060743.21076-1-santosh.shukla@caviumnetworks.com> <20170815060743.21076-5-santosh.shukla@caviumnetworks.com> <20170904143206.uoc5mniecpb3v744@neon> <20170904155629.usczyoejbozmobkc@neon> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: Date: Mon, 4 Sep 2017 21:59:09 +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: <20170904155629.usczyoejbozmobkc@neon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0008.INDPRD01.PROD.OUTLOOK.COM (10.174.214.146) To CY4PR07MB3095.namprd07.prod.outlook.com (10.172.115.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f913648f-15e5-42c3-56e9-08d4f3b21efb 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:CY4PR07MB3095; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3095; 3:RIAP8WunZmddYrYB51NJlCpjlh6SMOdCjKqZyQh/mlsJwPNKLeFW4rcaMmb4U+M5W0mW4BbgHjZ0Uf31PE1lNiSxiO0+zezxmlXBUsUCSIUqDbuivQ8lE74IeDrOVQdrjbqXoyQ32juAW/tbiYOGCbTSu+D15O3ofUspSFwAJO9SkJAPl4J33XkKVna31b453kfpWLw8rkKhWBfy0J4nI2wQCS1u7R5U3l7Q3nwPAF8DBgmNVfPXNwl3k41afnHm; 25:7KAMIMDzMcOZdcVMotO3VGzdHqdFqr0STDRncmClZ81epl5SW0k/TXhwHzZHQGftTuxbJ6H7kUMj179AWUDgVYnGHH5+gFL0g3wC7aPL/QWkwpGbwe/0lnJB7UOZKJZao9nmADi3QoNtKTl1ch0pyPwfB6rLsDIFzK58a64bf2fLMVDfLmLErkMsy1BCbb1W46JZeURIKo9iBv8OKc5sHkFEmlZuXd5x/iSSiZ7HAAfW2NWEqU7lYfQtIdMXm7xs0ceBOLt8Y1Zw+E6gzO8jRcMeeOvmc4cA3HozdoFv8k/6IuugheEizWBFDSCvBjIKbXtgHXVLjHx3qtTvmjmr9g==; 31:5qf0ZYVlK1BAqXMYl3OnLt34IRUOP+pCrhf6Tkqbs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5Zhp1Y7ESi1UFJjHh5IY2UuEpgkgGcaX/EliLxtvqsDheBFHk 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)(10201501046)(3002001)(93006095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3095; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3095; X-Forefront-PRVS: 0420213CCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(24454002)(377454003)(189002)(199003)(6246003)(47776003)(2950100002)(72206003)(66066001)(65956001)(65806001)(6666003)(478600001)(42882006)(97736004)(4001350100001)(229853002)(83506001)(101416001)(6916009)(23746002)(110136004)(77096006)(5660300001)(25786009)(90366009)(36756003)(189998001)(65826007)(6486002)(53936002)(64126003)(4326008)(8676002)(31696002)(8936002)(230700001)(81156014)(81166006)(8656003)(76176999)(305945005)(50986999)(93886005)(2906002)(54356999)(3846002)(7736002)(33646002)(6116002)(5009440100003)(50466002)(105586002)(106356001)(31686004)(42186005)(68736007)(86152003)(110426004)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3095; H:[10.89.1.1]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY4PR07MB3095; 23:ih0tuDvygNktW4O/qjVqtWRn12/+Bd0Yzkm0g?= =?Windows-1252?Q?np60i4VnDh2BrQJw0eeObUhp7UnpKt1whVgsukpBcIlrHjEmwUg0/qCb?= =?Windows-1252?Q?DyNVvRNLMv69sANxHFnFJRFX03+yT4dp6wfZvhFSzceUH7QaQYFG91Z2?= =?Windows-1252?Q?WQ+bNZGBxAJj0T7sbMWCELVi2Jj3qoigDE1nEf4w/09dFVKBOROGldQg?= =?Windows-1252?Q?1Rc27rlkErI5sr3Ir8kCD+zZ9R6PZpSm7RA/rRYtQPvM4Cxmyi44F8as?= =?Windows-1252?Q?f92A/9fjuDY0lxG8plpxd1z8rFUu3F6LS2mmvtTlveXURDGvD2mF0h7a?= =?Windows-1252?Q?jumToY3f65NfRqlbh6CC1qtwdafui3LKf4Atbwc4cIXgY2KIdwDW+5o9?= =?Windows-1252?Q?uPkKThkyQLjtbRxo8/o7llt21L6Y6n/BtaF4qPmln59OUjqed5rhxWjT?= =?Windows-1252?Q?z5JmSQmEc+uNfyX8pjjN66fFxJCWDlSGSIM5H0t5mV4dqnjNm5tS1Gat?= =?Windows-1252?Q?mI63ZTUM14lS7HMcTR45IVfi0YjtH2s5m1Lw03GRnctIkqA55/fzfoDc?= =?Windows-1252?Q?/zZnl7i13kKUvtoa0XfeMXDD3nGZ2Y0VnZOdZlq6co8c+h/IMmInZNT1?= =?Windows-1252?Q?EppviFwLkZ5vuhXZqKHsiHu1ftai7Kqany05LbnrkOcRhLqc9hUnhMwx?= =?Windows-1252?Q?3VeMtX7UsGnfDY+JR/Q7xv6Ty+nr1EEK2KxIvpFXQ6R+iTGyzU/71A02?= =?Windows-1252?Q?/qEX9POlt/emejavPPR9caOM+gHEe9TKpywFKETjltlSbRX51zwCSOvJ?= =?Windows-1252?Q?mNBgty1nhiKSi1xV2gvcv/CY0iafRGF7yPDylgkae7JHG28LBWIwS+OE?= =?Windows-1252?Q?SP2iB2v0XHg21IdTvRDqLO1QakZ1p9xcFn3JyQrdHzXizQ8y0X4WQ1ei?= =?Windows-1252?Q?ycp35u8wK+cgzJtzpVaC0CYEI5clbXCEdn3o8MOpaA+BJOSShwkeBf7y?= =?Windows-1252?Q?SR3lC/NwJ8E5VaY6oLX8JsRBANuaOXNDi1YXc9oioZ+4awTny+s/sKK7?= =?Windows-1252?Q?09xXwhUgqqnuYn7l/wqRZB1fRVlMkWnN37D9CH4pCohOrX2MVYD/btjI?= =?Windows-1252?Q?lMp2IEckLEz2IBg9vVrsXzSVR+qvMTFQJ1m6+wdeUesxcTLlKGMMjmkN?= =?Windows-1252?Q?0DJLHbF5Uqi2rIPOb4v/G6n7KxRnJcdbTanU/+BEvdzCw6bbN72CIF96?= =?Windows-1252?Q?VOyqfvrOwypi2IGpJLtsD7TGeDoj41Xxfh9qTF0yF2h2e1fOWzS/BBOa?= =?Windows-1252?Q?2eEfAFYlNv5m9S0qXdw/CmgISjOP+OdFdUdpmntAX5KwepCJx0DHxqnv?= =?Windows-1252?Q?kKEFPGfiPucwOi1crAm8g/i6u06vQ0X5sl/8SOe1fjenJ9Knwzgo2fPK?= =?Windows-1252?Q?VvaB0E5ZAj2FUmWZzFPY1TA1rOc0OmX0HOC8tg2kWJWoYELpJ08ufg9B?= =?Windows-1252?Q?qQTNb1y97F6yrZHN7Cr5v46Mop0n1zdEFKPXPVcWT+3QGSP6/vwbcNlA?= =?Windows-1252?Q?zTpkeDrDOZPEOjGkuJEU1yBkR5EGQyJFDtB?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3095; 6:BMAGImKK9TFBFXp5wrcaDwKjDuvP6sCWpP8fCgwpc+50hFj5f2G2Rrt66h8335yrGJB9myHbT+jqwjX8Z6vTMLuWMG1Ev8gXqMrSKEAdiXVebZgObtWtJsgPoWOX503di0DFCEFE0y2s+ZLba4SBg+GCNpipZNaem8fwWwqtU/KpndcLwM0Lfkg+Sffd8roDA9PvnVtT+IBD7uKqP8VpLAqdFZhttKgQH1zgiWGlby7CzRLLvMQK5fhmIbJ3VmtWM6gV/sJtdaALmN98GmhZ4IjfnP8iWioCBzm5KVf2ct371sFxy/aLE873ySxoR6HHJc445+DkyWZRW4Z/WylI/w==; 5:bXnhrvuxvYDwcm3HafAWZFnHGenupvtjPvoOhnVLyaCqaZcEk2JF7ZbNf0VbNZ6qk6aVv1VtS7mdT4hH/K/n6q9OstYXhR3TYiQc8FzLlA7PZQMWaeQcJEdmAWQzwI94fgrvydgGtG7T3GuLSzvdBw==; 24:hDUhXJwoRmbnW4D/T0HYuA7UALxKzXBXh0tMbFoCumLgQ1x7LvjT7wKAl3I95VIaUw95bNTug2pWo/WsxZmmD3gvG1sHDA8tbcGOZhF9OA0=; 7:as1HNZJQpN6xxOR0tIOy5xS7eR8yGHr5aCY+De5xsunGvzTJZpjGvjN6AEtHcJeFaigVYGYSIt/l3rWa8nWvxS0aeeNU7Uu0sZpeJ7FQcq/bIQCnYbuPjxoE288JwWR5Zov7iQ4To4AVSod7dTx7yUk/NLCWEuyKzxkE8EBgrm3jjnaeZSfpz7sEO7zgsWraRZSsrX50HI6rAy+fVGM1xvm8JybkIPdgho1jivKQHp8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2017 16:29:29.1158 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3095 Subject: Re: [dpdk-dev] [PATCH v4 4/7] 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: Mon, 04 Sep 2017 16:29:34 -0000 On Monday 04 September 2017 09:26 PM, Olivier MATZ wrote: > On Mon, Sep 04, 2017 at 08:14:39PM +0530, santosh wrote: >> Hi Olivier, >> >> >> On Monday 04 September 2017 08:02 PM, Olivier MATZ wrote: >>> On Tue, Aug 15, 2017 at 11:37:40AM +0530, Santosh Shukla wrote: >>>> Allow mempool to advertise its capability. >>>> A handler been introduced called rte_mempool_ops_get_capabilities. >>>> - Upon ->get_capabilities call, mempool driver will advertise >>>> capability by updating to 'mp->flags'. >>>> >>>> Signed-off-by: Santosh Shukla >>>> Signed-off-by: Jerin Jacob >>>> --- >>>> lib/librte_mempool/rte_mempool.c | 5 +++++ >>>> lib/librte_mempool/rte_mempool.h | 20 ++++++++++++++++++++ >>>> lib/librte_mempool/rte_mempool_ops.c | 14 ++++++++++++++ >>>> lib/librte_mempool/rte_mempool_version.map | 7 +++++++ >>>> 4 files changed, 46 insertions(+) >>>> >>>> diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c >>>> index f95c01c00..d518c53de 100644 >>>> --- a/lib/librte_mempool/rte_mempool.c >>>> +++ b/lib/librte_mempool/rte_mempool.c >>>> @@ -529,6 +529,11 @@ rte_mempool_populate_default(struct rte_mempool *mp) >>>> if (mp->nb_mem_chunks != 0) >>>> return -EEXIST; >>>> >>>> + /* Get mempool capability */ >>>> + ret = rte_mempool_ops_get_capabilities(mp); >>>> + if (ret) >>>> + RTE_LOG(DEBUG, MEMPOOL, "get_capability not supported for %s\n", mp->name); >>>> + >>> there is probably a checkpatch error here (80 cols) >> for debug, line over 80 char warning acceptable, right? >> anyways, I will reduce verbose to less than 80 in v5. > What do you mean by "for debug"? > > All lines should be shorter than 80 cols, except if that is not > possible without spliting a string or making the code hard to > read or maintain. > >>>> +/** >>>> + * @internal wrapper for mempool_ops get_capabilities callback. >>>> + * >>>> + * @param mp >>>> + * Pointer to the memory pool. >>>> + * @return >>>> + * - 0: Success; Capability updated to mp->flags >>>> + * - <0: Error; code of capability function. >>>> + */ >>>> +int >>>> +rte_mempool_ops_get_capabilities(struct rte_mempool *mp); >>>> + >>> What does "Capability updated to mp->flags" mean? >> it says that external mempool driver has updated his pool capability in mp->flags. >> I'll reword in v5. > Please, can you explain what does "update" mean? > Is it masked? Or-ed? Or-ed. >>> Why not having instead: >>> int rte_mempool_ops_get_capabilities(struct rte_mempool *mp, >>> unsigned int *flags); >>> >>> ? >> No strong opinion, But Since we already passing mempool as param why not update >> flag info into mp->flag. > From an API perspective, we expect that a function called > "mempool_ops_get_capabilities" returns something. Current API return info: 0 : for success ..meaning driver supports capability and advertised same by Or-ing to mp->flags (now in v5, mempool driver will update to second flag param) <0 : error. Is return info fine with you for v5. Pl. confirm. Thanks. >> However I see your, I guess you want explicitly highlight flag as capability update {action} >> in second param, in that case how about keeping first mempool param 'const' like below: >> >> int rte_mempool_ops_get_capabilities(const struct rte_mempool *mp, >> unsigned int *flags); >> >> are you ok with const change in above API. > Yes, adding the const makes sense here. queued v6, Thanks.