From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0048.outbound.protection.outlook.com [104.47.41.48]) by dpdk.org (Postfix) with ESMTP id 3C33F7D4E for ; Thu, 7 Sep 2017 12:12:04 +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=jWA8QcGIngnmhe7tvmKWjuO8KyzqtF40YAVmB9s1eSw=; b=Io1UWSK+vhiNMqH2reRd3B0GdhHoEy39pNHHUdGiLAvybGdseVLhik4DPD+znx8VJq7DhZYrxUG7NiaposcYADfILLjNc2hm6R0JYUwvGtAhuk711ZcMBZTxxeIZzdGd1XVl7S0cJ1YXNyc9hlMXAFBI+23pzgw3TPq/oOiJJxc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [192.168.1.102] (106.209.228.26) by CY4PR07MB3096.namprd07.prod.outlook.com (10.172.115.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 10:11:59 +0000 To: Hemant Agrawal , 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> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com From: santosh Message-ID: <4cfc26cb-18bf-76b3-af3c-5dacd86cd52e@caviumnetworks.com> Date: Thu, 7 Sep 2017 15:41:42 +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: <08aaa47a-b2e2-4b02-a9c3-6e3638503f1f@caviumnetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [106.209.228.26] X-ClientProxiedBy: PN1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (10.174.144.144) To CY4PR07MB3096.namprd07.prod.outlook.com (10.172.115.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6abc8f11-7e53-457a-71eb-08d4f5d8e1ce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR07MB3096; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3096; 3:t255mcqs6TIXjQP5yWKi15Vc8TFZ07cv5HXmyemQoIfdOhIYlMXGReNdxX5+AK/Z1zeYycfO6m8NQ7hSkl8PjfOuix4jMiAQt2eXlkwDDey6biy6QTSojM2RQ1qj3T6Af8bQCqVWhnoaRzPzaW1z8GsbPzvmG/DKQKp1OZaLW+yCB0UnkHygbx2n76r/soX8lRoIn22xfSlYFm74CJRJ0ZwTcj2XVrxeqpsof2NYUI38H2W4/r2jQwyKOvKbUnqm; 25:n31mN+JxBgAOM8lx11FmbzviZCSPm4pCnOsK3XolLazaNfR68zPlszuQmglM/JDZchyWSZJDbSwi8QZ6hYEtPVkCb5XbvxW/BgExg69/XR3+ws0hOQ/md+O7QV2rkQwEkzh6df3Cdm2g12s1CPAT9pJfQn8U309M/vfGti35iBYkMB+tg4u1jjMIIqjyfN7ujgn8Vjq91hizFOiOsq8yd8AoicZUFA+nqlAiJqDIkOBWTuml/GvPXf1433DSjGmt5cMXBpVJEgtFks1dyo0D4LzwOsJexmrztGkFUu21NeBaOVAjNpdPBygU6QqOt8ybTc5yMnCgomLnzPJH5xAa/w==; 31:YetTbNQGHatW+0OcMdrWcOUkyfA5PcKTGD0fbCyKT4NabpNKjBNN+vEGcrnu+qFW4Ct2VSuUHo1SvLY7iCLzba+uCyEvI9mWxgmbMdPjpd/SfwbPLXGy04INmrWt/N1US4RfYlZa3JpwspFIvwzRd6MHW4kJDaBeGvAf3swu518w03TGQawrGu32YcX/HS7vD4M8UJriz53GHzoA/SSDG7FT42FSFI+vDDhvv/ieKsk= X-MS-TrafficTypeDiagnostic: CY4PR07MB3096: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3096; 20:M/yQVfrdiJml5UfSAEHhgHjwFCJ0I+eeSoGE7vWwOGbtBA7U70p1tDREkYGfH4krmnUKnwPcy45od+yppGYNP/8fx1r+J78jjJuZwQMh2nOga70MIQwVNEwglLbvuWUTpOciR0ilrAsYlTS0BARwwH85gu1uf4vXeht3VUGxtJ4zpIkxvuffzCjHHi8YYv84DejmVmLpcw6pK0XXdEAiTXwhRoFcQuSFBnhPW+2X3yn/eI7coXi4L5nNxyVFnpysTrSBAK4o8M35/8PzbPuXF4PnywdvvnnN8ZiZP0OfewiuyAw7tAb2eIr30iAnxp5ZF3C2e1lO3+pHxgBDC2FTphWFKkMn0obWOnMR+OSNjQU8452De0PJkpbUyhU75HjgvqsRHi634J6VuFFrmqUkOu4Kb97+WdxERVsdaB7+q0BY+lwjFrXwCnbN0v9+DgKqKoKD13dNjF40vBGTQsZWOmYch+dk5E8davmDi1vj3TJZxzmzBgwyiPA2daQ9NFZqyXW/ONQtKZqAQR5psiC+JxDF3ywiMK1nvM+eqWRe6schnT4okGUZCUb8dyqYfkvFGqthpg50dQUhofYofz/h+0QNSMf9HKo6aBf+WizZu1U=; 4:ZqJqJvYygkKXu+0jTiR0ut3Sr7UyhJYczcOmTD/cHIHkqq/kONZTyWrPD/Fugnv6vYNTLfLhEKSLI5ZcCiMbpeSrbYJSwPDImI2MWdnwpqScivZQhVpEbNEzZwi0wm5kz2ker1PiYz44L7lsKH8KW01+evoPkaN0IiOh/wq6TrSkHJKQtEPHH58u6x4u1sTG9s1YB6RpBfszmFl/fcT61GegnwcNPwPtBJeoqevz6clJQ/042gmptY+VwRt/5GJu 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)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(10201501046)(3002001)(6041248)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3096; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3096; X-Forefront-PRVS: 04238CD941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(39860400002)(24454002)(199003)(377454003)(189002)(83506001)(53546010)(4001350100001)(97736004)(64126003)(68736007)(93886005)(105586002)(230700001)(8936002)(5009440100003)(106356001)(6116002)(3846002)(2906002)(36756003)(117156002)(72206003)(42186005)(4326008)(81166006)(81156014)(8656003)(8676002)(25786009)(31696002)(31686004)(478600001)(966005)(50986999)(54356999)(76176999)(2950100002)(86152003)(65826007)(42882006)(561944003)(101416001)(6306002)(50466002)(65806001)(33646002)(65956001)(90366009)(66066001)(47776003)(189998001)(305945005)(53936002)(5660300001)(6666003)(53376002)(107886003)(23746002)(6486002)(77096006)(7736002)(229853002)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3096; H:[192.168.1.102]; 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; CY4PR07MB3096; 23:gUht4w4pcyAFKNnlEv39p0SBXlEvHim1DeMDp?= =?Windows-1252?Q?2JBRUN/6qkV6DupqtW/RritHcONjAAJmCedTDZ5PBcN7E9Njab3/fuZE?= =?Windows-1252?Q?1PRwBgeJVPYI6ajIXw1SVdqu4Y1Cgiu8R4o4r+fcrCBD6MEHCzglWCUi?= =?Windows-1252?Q?p3TiliG2o41bxRyBKhWq/52+Xr5KG6mW6lkg5gkesOm/vsDTD55VsYv9?= =?Windows-1252?Q?LF7136yFLtUR6r4R3GEeaoniikMOV2cMQjBDMmO2tXbKNMKYCrLvr6Gq?= =?Windows-1252?Q?MksXIA6sesCBKPihmlYZW8bDkaz4HKj5PHwfL4QnmaZWNLkgTjeuqkZf?= =?Windows-1252?Q?IwCOlE+ZzWl6Fd24FYiioSUxpYLGP0cii5hzKuCkGCsI5VUux3W7wy2m?= =?Windows-1252?Q?Xi7Ob5GDtiixFKRTVkhYSKMFU+dgoos0kqfntsa5qGu5RruRX8jKFocP?= =?Windows-1252?Q?bOe7WOcYh6pOR0eEqq14+tuvUe21nTHvlFuE+rVf/eitiDCCxC2Ba59S?= =?Windows-1252?Q?fge59anuAWpXgZFh+R7Mu1cHTeUDVEcjrXJaiH+v8tS0heCxkHlT5HIx?= =?Windows-1252?Q?vW0EY/MV7dl+hCzhMNpqWaRmxcFVBcrJRSxRXwXHeHVQQxddU85APO/S?= =?Windows-1252?Q?IT91mjtgup1OQiRTC3htS7BWdzdXtZxoD1IRdz9QYg/Y/VFzBpi0ZQKa?= =?Windows-1252?Q?qhRjZgBuBdeZ8+ztQnCY6UCbUeXbQmvxDAX1lU1o2f5My3OGk57qYWKB?= =?Windows-1252?Q?viYdiuyjqaOo9Bp2/qAdcsFZC0q5K1GcXkzpDKa0Ir7WWiYRNvQ1PEUG?= =?Windows-1252?Q?zxqDyJvnEIYlXgQ4KnaovuoTpsRuWXWAURopvhsoKQU3Dyv4OqcKxWhn?= =?Windows-1252?Q?myAczo3bb6+nxfFdsAEe+gZVWYls2eWEoMLSXD0RuAxqKMMDnGVxASZN?= =?Windows-1252?Q?/T6eb9z9CfQJgvJtjoDekLFf4e4CkLwfaDVbqcGuEaKAr6WgSIRlecKg?= =?Windows-1252?Q?+nBhYZ1/S9lCQ+NmzrPLrBcA3p13ZGKaM7otUTTpGoq8x7rX6dqcoMg/?= =?Windows-1252?Q?Gjx7BDNlxGqrQHUtK74AE/SoCJlnfCMpc0NfkJ+83oMWYvOPuQbhwe7y?= =?Windows-1252?Q?OMbsJFy0CXc71EeWfzhx4n/XD55qd8actDzBXoRzT/pLqbmh8/Qh2+0h?= =?Windows-1252?Q?Ym7I3ZvGcLHSnuCDFVRIhAihzqYz6L+PM/J5yLtJ8MFUlxbFiFOiDlxj?= =?Windows-1252?Q?CSq+K77z5GeN+3iBufkTKopc20UBXf6veSe5Lfa0R7HokNratAgPgNrc?= =?Windows-1252?Q?TqEelnStxJKWaTMRhfp7XwqMovURegtDVH2CVoSXzAD3RZtTVB+08KW5?= =?Windows-1252?Q?pXdc3km8IPx11G6N/yrac/6yFnHmrQ6IO4ZYxjGyih1MnUilCyZ6juea?= =?Windows-1252?Q?EBrAUZXSuuYx9zWvKWWnINTg6ajxA0/s7f59Z5YCoDNLetE7ud5Oi+pO?= =?Windows-1252?Q?Cwu/42UbPcmMMgR3WDBhFv0mPpB2WlwJsyhjLNdnYNPLvZepne9UX8kX?= =?Windows-1252?Q?SUxtapnMbyY4E3onZHIwrG0keNpv96j3KOIhK2gaD2Lubzzp8s0WN8ib?= =?Windows-1252?Q?OaF7NGnXn1P0c36s8i2jMU7ykIfK9saJgnkfTWJFYYo+fWPvEd8Kje5h?= =?Windows-1252?Q?X0ZCxkUVQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3096; 6:HraWL+7P4j5VPSAQjkFWwTuAlmoAPkvAUwsesb28fl2yuegetWCYvqOPQpPjW1O2SVecgFL97yHaXzI/b9mRHReOM5W/a/83c6GpslOPFUvAo6eyrqbfOSs8DuUYAGWgyIR+oPgd2t5sSrPeJJXj+hLev4eJzmauhf9cq8erbqc4lAB3AP4AVIokw86sIfUuxZvVimSzjE7aBlJqG04GudEv+kkd0BpxGTnYjPr73OlZsW/TfLdYhM41IbN7SJJL9wG3Ftf7Hm28Ei1EoxSrX0vu/YKOs3Q/SB6i8oI1u6uhaTKabY1ztVInFO3WRMxnu/+D+Pa+qhn8jyvuOW8jTw==; 5:mhIHIXNBDU8f+rzQ1tTLjmNU/Pys587Ybxl7s7mP7V19Nzq8Ngb2EqVlDmZjd4YYi5/d7pGB5+w0Jp9mhciPyUgzDTJU2VZyhCIUlMNxq1XwB/c3mVJ5/divFVIrzUTsJzzE4lb+AnT6JrOHcRbiXA==; 24:unkHmEgf8f/yIXPcfwzpTIuKBSSAWLbyrSpD6O+4L3yMACcN9I6wLqa7GPeJ5wp5QAzdzyIhAF2+/YxfIxISshbn2fH338LpAXLTtkNwkaM=; 7:vUtrIZ/RqqpBRCzImw74r2QPBGwYVacsj0lbMdlL2fO4MkOtrSnsDFlpkZwg0Hu88cYR70JwuT4ejnfwkGUJJj0LjH3vRJBSdLAZUZK1YcVbNRHBBxDs/j4p3MmIoNdVeG3ehmvDIDs8G3zlFjSRm1nI4QGWdOeaGxb31TsoTBTXO0DNAPYKrvB1bdCIAxJH8YcOa8g41Fe0zD/1QzUB45KYM22FaQKW75G96tbrgac= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2017 10:11:59.4824 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3096 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 10:12:04 -0000 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. >> >>>>> --- 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 >>>