From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0076.outbound.protection.outlook.com [104.47.33.76]) by dpdk.org (Postfix) with ESMTP id 1612F16829 for ; Thu, 7 Sep 2017 13:08:47 +0200 (CEST) Received: from DM5PR03CA0056.namprd03.prod.outlook.com (10.174.189.173) by MWHPR03MB3326.namprd03.prod.outlook.com (10.174.249.144) 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 11:08:46 +0000 Received: from BL2FFO11FD024.protection.gbl (2a01:111:f400:7c09::158) by DM5PR03CA0056.outlook.office365.com (2603:10b6:4:3b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Thu, 7 Sep 2017 11:08:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none; caviumnetworks.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD024.mail.protection.outlook.com (10.173.161.103) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Thu, 7 Sep 2017 11:08:45 +0000 Received: from [10.232.133.65] (B10814-12.ap.freescale.net [10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v87B8dhb028234; Thu, 7 Sep 2017 04:08:40 -0700 To: santosh , Olivier MATZ References: <20170720070613.18211-2-santosh.shukla@caviumnetworks.com> <20170815080717.9413-1-santosh.shukla@caviumnetworks.com> <20170815080717.9413-3-santosh.shukla@caviumnetworks.com> <20170904121113.jdilonuhw77c4vx7@neon> <5fc11fd6-3741-ae25-d5e1-3bc8a643661c@caviumnetworks.com> <0df45c69-6e54-5e6a-354e-e5c2ba6d578e@nxp.com> <08aaa47a-b2e2-4b02-a9c3-6e3638503f1f@caviumnetworks.com> <4cfc26cb-18bf-76b3-af3c-5dacd86cd52e@caviumnetworks.com> CC: , , From: Hemant Agrawal Message-ID: <8e66eab5-51a5-af0c-8b0c-3879c516364c@nxp.com> Date: Thu, 7 Sep 2017 16:38:39 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <4cfc26cb-18bf-76b3-af3c-5dacd86cd52e@caviumnetworks.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131492561255689728; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(377454003)(199003)(24454002)(189002)(65806001)(33646002)(106466001)(105606002)(561944003)(50986999)(54356999)(65956001)(76176999)(2906002)(47776003)(31696002)(86362001)(498600001)(230700001)(4326008)(36756003)(6246003)(53376002)(626005)(68736007)(4001350100001)(93886005)(8936002)(97736004)(81156014)(8676002)(81166006)(966005)(53546010)(305945005)(23746002)(104016004)(65826007)(5660300001)(50466002)(64126003)(189998001)(356003)(2950100002)(229853002)(77096006)(53936002)(54906002)(31686004)(6306002)(85426001)(83506001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB3326; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD024; 1:fOMya1EIbm1q1JSl6aYAdkDHHLlEIQK6h4fLRSt5AkxF2W79Y7sevHxakFjMNwCRkwDzVWReLyKrgeNpJPB6WyL3tR6rxalr1pXnncp5qGev6LXQJ/NNUafcBAXgpf9s X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88fbdb2b-8a94-4c4d-6e00-08d4f5e0ceb7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR03MB3326; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 3:lKd06Ae89vYpOUCacUgf+7itL7qmUbv/ozmK94j7tvTbXpN3yCErhuVlQMLS7elLBWxz2vxxg8qiQF63rQ1bscxxoezhfDtiS23ssa7ost1TSXOdj8+1dNIs+k9Oxf84prBpowKLMdep09+XMM8dgK74EuVulyqRd+BhsHubc9Hqfw4lh5n5/7W9IW9PQYtjMWt2FFEQA5XLVNc7MOH30lR746hHUzt0oxiT0qhVIUnncSfOMyF+LLgj/vQ/eZC/wH3Ny1G9eU6NEsvfCDLNDIPFx63Lusd6HLgN9ux3Bgf3pGR67VXLYWDLTa+cUq58OXA5b99zMV2E0sgifAC6w5oeEI7y8Nw5wBNaHC6qrvI=; 25:A+zaxYRyhUkWTgnYuF8U8N9lsQtLDir47LNTdYvfsLkXnwiSsJOP5fLa+ZTRBt/CyhgovO0celvbMlk5L4iPAfk0V4U6QwLydDunlWUv27E5z6moBulBEhnaTLhO94CR9WqMI/hnAaiPOwq2p4AhNtIKRclx0boFXxYvDo7sfXUJb2lnAa25PYH8MOYxdOLgQ9brKkMMMWmSHYFT5w8AqIrLNcXcxRnxYUmUe3Ba3KCSNMFBFm/Fvrteg9rdl65Hem+xyVAjJQG6NrCbL4guloS3KJS82TJvUX6tTDPmyy2NBq36PWOhu/57Ay3in65QXKfDJuJ5CuR+ldu3tpoSAQ== X-MS-TrafficTypeDiagnostic: MWHPR03MB3326: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 31:myTZ9rbHf6FoT7rQnAsptAzlMxmEwCdJOGWrOUfBosI9bfp+WuJUSDl6+4Q6pXMph7NEYw5R+3L9UgZg4glllZhkO0kfszD/LIRRKYajnFzFhnyFZ3md/jOoG2PCp0UcbsbDUJfsrakaI2Hd112/10dy+AvK/P+xBw22tqNJDSXiv0NJU89sDRHNU9osfdkZid2l33/rQDiBLQSPHByW+7ukAKVMYTOUYH5yo4MyOWI=; 4:+N0pCc8rKgRcSGa5vCWnwzb0WlRcLhFMjb7lN0UOkAp0dfkHbaTxUSw7gWWz+4737ixV3ncQqPRN4glzdyu5ggWMrPUY1Y9GFEX5EXx260oh7Y6wUdP/9gb3A703RfmBpxkXJUyqYsPjimLeiEN7OpnRXJb7MCzGzCJgcidzLWLIxz/I6NKj5QzAfHg7m2jNgjOoUC5xglITKRdu4X5zwA+QQ0I34Vnjsg1s8g5z2YGmNmm5VvuXRIMJuzBcUZHP 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)(6095135)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123563025)(20161123556025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB3326; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB3326; X-Forefront-PRVS: 04238CD941 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR03MB3326; 23:jL9DAWfn00V4xyNY27+SbAhtJHymGbU5rZUdu?= =?Windows-1252?Q?264KzBJlGA7XF7iYuooS+AF1Xlb+aYb5L+qXsDGybt5PBhQy8feGB8Ob?= =?Windows-1252?Q?YUVpY9iSbhqp4MxgqNt6V/WqBTZ1RWKveSnVPH8xdrePVY0tfKGHiUZr?= =?Windows-1252?Q?axkhzEc2qdJWZFfB2poSUv8JDorWI6Ukq1uum1ElzEXy24CAODYjqjJW?= =?Windows-1252?Q?3DAMkzhalI53BYgH0T5HXyEjG0nj+jb2bMigBIyQjheF+t75JKS/8Lzp?= =?Windows-1252?Q?B6mrE7Dm0EoRjlEPEbR/8zn9EuNYkv1tp5aysbFgE9hKSQagR84K5I8x?= =?Windows-1252?Q?uebe6x4pFghd0olqEkpKh0AkMX2XYPSohPCCNFgE25rbMu3Yfl6EJwOY?= =?Windows-1252?Q?LFjh1JBPAIhVIsvYUw3vSgpXQil63uJHnWcmCGsxY0nawDcCwmi0Wm0N?= =?Windows-1252?Q?+PFFWb28fIzO1s9KDuQhz6Kw2u0C2cTjCN7iAnhhLA5muSI4CZg39ciE?= =?Windows-1252?Q?vv9tR4IrJbWwe0bE6YJMNMAuVEJYepQOtMNunLaNR9I1rRgTwzkqHvy0?= =?Windows-1252?Q?b3SDeGiRJpvJo/YFP/Zc1NvF9YuxvYtpE2tmSf5XuBXTI8vZVVO0S9ZL?= =?Windows-1252?Q?L0eT32TZXT9KEaoKsMshVAJePP1C6X+es/C4gpo/ITpISzyTAgj8RmD7?= =?Windows-1252?Q?WXmmrVX9Pt0WMkdTW4nLp+LYQabQvz8UWWKXRFZzluddiSi6HAsxusob?= =?Windows-1252?Q?YESmKs2GEoBebxmLxTE16EZuQRPObM5+YbcpnbUg2+2rRT+l4iTPh03y?= =?Windows-1252?Q?napRQ2SuVMie+0Ee94vV/F75DMa7JZ6LlGefpy1PVOEKSjMtlhimX9on?= =?Windows-1252?Q?F5gVbOFs3eK3JG9SNsoWJgcVtPAG9p6V0GxND5I7iH6XqQu31ELtt+iz?= =?Windows-1252?Q?HHCyMCeSQH8OY2tKaBVOgDcdZgIOtwOqNezKcs7b8lnO2AO4yaJqHLzV?= =?Windows-1252?Q?UG+VzuTg4z24wPsPTwnsFj6qU2uISqcu4xomJBAqOiHSSHGq95nBgHmm?= =?Windows-1252?Q?c6+apR+jt3rmDA/1o868Yf7QVGC9Bal57ZPiBsNzFJ+tVe40F+M7WT6B?= =?Windows-1252?Q?kGtSwIIzBbXwvpPSGHpbz31K6vz1qpjU79ZjMXUoo2ysqj+dmMyBFK7F?= =?Windows-1252?Q?CmzQJqJdHv7xNoKZt7/0U9Kqx0gU4Ge/U1jS2z2PxDYbPXM+Amqkxdmd?= =?Windows-1252?Q?w5AVsiHd69sjtDAuK3cDG+LBIBV9+C0FC2Wlp5vP9Qava++mHB/8xGBS?= =?Windows-1252?Q?PXCB9lKzBf+fbolVoqPGSyJJ8znG/GbzEf43blcFNp7AomZt3W0BW7l+?= =?Windows-1252?Q?IBEnkxceLaaT1uFjB9hEbwn0vMgLvpBk8OBHdopo1019O28hGtLngRlh?= =?Windows-1252?Q?3YUVdg6rcKyDUP8BHWHGWT7AA8aQpmuhI5mHnWMzmLVmqCiEGeAOWqJi?= =?Windows-1252?Q?y5I9W8ciDHUpMS/yEC0oSmnS+k6S85bDb/Ck0q0in76JBl9EA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB3326; 6:gkjqxfrRT0e7NQQt6TsjnyB2to90meBHR4N4OjbHrnIyCvn745JrZBh4PRZ5JkOvfN0Tpcu0gV3zzztmyfLPXuR39cINdbxrqcFlkikBPZCJX49h59gDn75mCc5iHy9TGfQyCYV6UF8x0Uj7C18CmkNl7512fl46PR5UXxcRyoaN3pv8JpvHjrt8RlKPBgNz6IuwIYzkUwwQNiH/B+CealgIiZA61WFpTjmXkJuWLCS8EfotHAfwrWXKNiLFPKHLzj7jiY8Uoid1Lthi0UFGYlxkm0DjZUSs5EtEst1AyKkjC7nQSvEmIz/XhIop8x2wYEaPNQRph9Oz79UAn3Cf/w==; 5:daHSP1cKWsDgjB91We3DOcdcfIKVjwy+DpFy1txATsE2etYJ2LI0zsLfBwuVeFV35ErrryjDiRyBcw5sPZo7cY/IUlI3hyeHlTs6ksdt3hcWenTCjiRuMrRucvMfQJwUT+K0AgaJovhH2n+c7ijKgQ==; 24:qL6JdYDF/I1etNv910f+dZ46FgSpVaVxYibu1YO/NxiQFPb/Iq1/XY69/qR84luuZ+UzzlgFRNCSXLFOBxpQf245vFPM/86m7jOL+KvNG+Q=; 7:vwnXO6CQaHvDs5Ov2rkAi6wkkNVf5OtrdaZBP8xty8GXRn3G+aAW4rdVTTPPZzWy+kv79Ec4Y0ptgALTrb/OerkkUxKl3jIoGHBFoM2pWzHOCdOMANL/88sybCuu2ECDqiD4MZKnRJQY7J7gnNaPu0e/QWexguFA42Hm3Kzd6r4LJIBNyRptYrIXgucoM1/jyOsy7P8DE7FCWDx1RyeJTMDvcLi0E0PPA5v9tmTafK0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2017 11:08:45.3661 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB3326 Subject: Re: [dpdk-dev] [PATCH v3 2/2] ethdev: allow pmd to advertise pool handle 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 11:08:48 -0000 On 9/7/2017 3:41 PM, santosh wrote: > > > On Thursday 07 September 2017 03:36 PM, santosh wrote: >> Hi Hemant, >> >> >> On Thursday 07 September 2017 02:51 PM, Hemant Agrawal wrote: >>> On 9/4/2017 6:44 PM, santosh wrote: >>>> Hi Olivier, >>>> >>>> >>>> On Monday 04 September 2017 05:41 PM, Olivier MATZ wrote: >>>>> Hi Santosh, >>>>> >>>>> On Tue, Aug 15, 2017 at 01:37:17PM +0530, Santosh Shukla wrote: >>>>>> Now that dpdk supports more than one mempool drivers and >>>>>> each mempool driver works best for specific PMD, example: >>>>>> - sw ring based mempool for Intel PMD drivers >>>>>> - dpaa2 HW mempool manager for dpaa2 PMD driver. >>>>>> - fpa HW mempool manager for Octeontx PMD driver. >>>>>> >>>>>> Application like to know `preferred mempool vs PMD driver` >>>>>> information in advance before port setup. >>>>>> >>>>>> Introducing rte_eth_dev_get_preferred_pool_ops() API, >>>>>> which allows PMD driver to advertise their pool capability to application. >>>>>> >>>>>> Application side programing sequence would be: >>>>>> >>>>>> char pref_mempool[RTE_MEMPOOL_OPS_NAMESIZE]; >>>>>> rte_eth_dev_get_preferred_pool_ops(ethdev_port_id, pref_mempoolx /*out*/); >>>>>> rte_mempool_create_empty(); >>>>>> rte_mempool_set_ops_byname( , pref_memppol, ); >>>>>> rte_mempool_populate_default(); >>>>>> >>>>>> Signed-off-by: Santosh Shukla >>>>>> --- >>>>>> v2 --> v3: >>>>>> - Updated version.map entry to DPDK_v17.11. >>>>>> >>>>>> v1 --> v2: >>>>>> - Renamed _get_preferred_pool to _get_preferred_pool_ops(). >>>>>> Per v1 review feedback, Olivier suggested to rename api >>>>>> to rte_eth_dev_pool_ops_supported(), considering that 2nd param >>>>>> for that api will return pool handle 'priority' for that port. >>>>>> However, per v1 [1], we're opting for approach 1) where >>>>>> ethdev API returns _preferred_ pool handle to application and Its upto >>>>>> application to decide on policy - whether application wants to create >>>>>> pool with received preferred pool handle or not. For more discussion details >>>>>> on this topic refer [1]. >>>>> Well, I still think it would be more flexible to have an API like >>>>> rte_eth_dev_pool_ops_supported(uint8_t port_id, const char *pool) >>>>> >>>>> It supports the easy case (= one preferred mempool) without much pain, >>>>> and provides a more precise manner to describe what is supported or not >>>>> by the driver. Example: "pmd_foo" prefers "mempool_foo" (best perf), but >>>>> also supporst "mempool_stack" and "mempool_ring", but "mempool_bar" >>>>> won't work at all. >>>>> >>>>> Having only one preferred pool_ops also prevents from smoothly renaming >>>>> a pool (supporting both during some time) or to have 2 names for >>>>> different variants of the same pool_ops (ex: ring_mp_mc, ring_sp_sc). >>>>> >>>>> But if the users (I guess at least Cavium and NXP) are happy with >>>>> what you propose, I'm fine with it. >>>> preferred handle based upon real world use-case and same thing raised >>>> at [1]. >>>> >>>> Hi Hemant, Are you ok with proposed preferred API? >>>> >>>> [1] http://dpdk.org/dev/patchwork/patch/24944/ >>>> >>> The current patch is ok, but it is better if you can extend it to provide list of preferred pools (in preference order) instead of just one pool. This will become helpful. I will avoid providing list of not-supported pools etc. >>> >>> A driver can have more than one preferred pool, depend on the resource availability one or other can be used. I am also proposing this in my proposal[1]. >>> >>> [1] http://dpdk.org/dev/patchwork/patch/26377/ >>> >> Ok, then sticking to Olivier api but slight change in param, >> example: >> /** * Get list of supported pools for a port * * @param port_id [in] * Pointer to port identifier of the device. * @param pools [out] * Pointer to the list of supported pools for that port. * Returns with array of pool ops name handler of size * RTE_MEMPOOL_OPS_NAMESIZE. * @return * >=0: Success; PMD has updated supported pool list. * <0: Failure; */ int rte_eth_dev_pools_ops_supported(uint8_t port_id, char **pools) Hemant, Olivier: Does above api make sense? Pl. confirm. Thanks. > > Sorry for the font, resending proposed API: > > /** > * Get list of supported pools for a port > * @param port_id [in] > * Pointer to port identifier of the device. > * @param pools [out] > * Pointer to the list of supported pools for that port. > * Returns with array of pool ops name handler of size > * RTE_MEMPOOL_OPS_NAMESIZE. > * @return > * >=0: Success; PMD has updated supported pool list. > * <0: Failure; > */ > > int rte_eth_dev_pools_ops_supported(uint8_t port_id, char **pools) > > Hemant, Olivier: Does above api make sense? Pl. confirm. Thanks. > looks ok to me. >>> >>>>>> --- a/lib/librte_ether/rte_ethdev.c >>>>>> +++ b/lib/librte_ether/rte_ethdev.c >>>>>> @@ -3409,3 +3409,21 @@ rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, >>>>>> >>>>>> return 0; >>>>>> } >>>>>> + >>>>>> +int >>>>>> +rte_eth_dev_get_preferred_pool_ops(uint8_t port_id, char *pool) >>>>>> +{ >>>>>> + struct rte_eth_dev *dev; >>>>>> + const char *tmp; >>>>>> + >>>>>> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>>>> + >>>>>> + dev = &rte_eth_devices[port_id]; >>>>>> + >>>>>> + if (*dev->dev_ops->get_preferred_pool_ops == NULL) { >>>>>> + tmp = rte_eal_mbuf_default_mempool_ops(); >>>>>> + snprintf(pool, RTE_MBUF_POOL_OPS_NAMESIZE, "%s", tmp); >>>>>> + return 0; >>>>>> + } >>>>>> + return (*dev->dev_ops->get_preferred_pool_ops)(dev, pool); >>>>>> +} >>>>> I think adding the length of the pool buffer to the function arguments >>>>> would be better: only documenting that the length is >>>>> RTE_MBUF_POOL_OPS_NAMESIZE looks a bit weak to me, because if one day it >>>>> changes to another value, the users of the function may not notice it >>>>> (no ABI/API change). >>>>> >>>>> >>>>> One more comment: it would be helpful to have one user of this API in >>>>> the example apps or testpmd. >>>> Yes. I will add in v3. Thanks. >>>> >>>>> Olivier >>>> > >