From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0072.outbound.protection.outlook.com [104.47.40.72]) by dpdk.org (Postfix) with ESMTP id 41664376C for ; Mon, 4 Sep 2017 15:14:49 +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=Zszr7a3//m5pZI9YVq2ZiTQ484X2dIUww5M3erRRrAI=; b=gvH3rlvjrDWXzEC9yQcwNbHLdFZhJ2EygG10yH1HWQdgaG0DM8RBD2B5mf0VhGuuLFe7mDa8JNGIeGzOo5ryO82ComOxnRPWUdprEJPfaflWjOoo07BGm3SebzRWiutgWb4Pb77Icgo4cngYuYBQXbcdRwQFfRgriiSRsqx+DVQ= Received: from [10.89.1.1] (14.140.2.178) by DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) 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 13:14:44 +0000 To: 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> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <5fc11fd6-3741-ae25-d5e1-3bc8a643661c@caviumnetworks.com> Date: Mon, 4 Sep 2017 18:44:28 +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: <20170904121113.jdilonuhw77c4vx7@neon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BMXPR01CA0020.INDPRD01.PROD.OUTLOOK.COM (10.174.214.158) To DM5PR07MB3097.namprd07.prod.outlook.com (10.172.85.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80c943c5-351a-4f1c-e926-08d4f396ea8f 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:DM5PR07MB3097; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 3:0bDnKE+PO5ofRbnTWBVm6e/bMZXJc7603B65MR35O2xNy9bmedDlxRRbneb4UUV78C0Y6hu/979NRsZPmM6BqADjm5pE7PcxQ5Bv/nhPsPIL7nl11F4FXu/R19CFt0yYvEWohlr3hMphBgW4fTccvABuK06gS6IjZl/RCSRSd4NkNvj+bpbJuwvx7RJhvRYZIg29NYxqtOjM5rsajga4lfhZqzXRxNi6zp9jYWgUmvgLR7bIVBmHHVtutW0AN8yG; 25:9fgfuuppEXhTrLrboN7pIMKDTdDw117p7g4qsPNN9GnA7ebOwT5mwmLsV4blNdpt7YrWLKF3jXsvRSYcbYEOC30PETfou5BFIqvvMCHWif5RwNGm2xmAzOEcG3LYw8S90oSvCjVGjYHcDZmij0d1X0azbJx5OL8rcqNyrLbf+4NM0QpFpZT+U+IGGKVMIvGSrHvO9U5KlhP5n60yurhkNcdpDMYFfXRm16DnQ7niPhMveYbJ0W/UpSkDgie8LqLn37orVrbNrfKOFHNlLmB9CIw+h3hzRxM/sxCzVuXJjy+6YdKe+Y5HoCXJcTENJaeCygKLq3bBEd5kVvPo9s9yfg==; 31:gQ0OTNYU/uFSFLfhL+RCTnM+pqNnQiNG2GgcHk/Te9IgDqkcGJ7Ix0xeWp5oQQoHjo030YKWsYbBOziDzJ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IHSXlDN/TSPX5u8hI0q0NWeXZRwWnO4S3uFF1G 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)(3002001)(10201501046)(93006095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3097; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3097; X-Forefront-PRVS: 0420213CCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(6009001)(189002)(24454002)(199003)(377454003)(6486002)(77096006)(86152003)(6916009)(6666003)(23746002)(105586002)(42186005)(8936002)(229853002)(4326008)(6246003)(110136004)(31696002)(42882006)(2950100002)(6306002)(90366009)(53936002)(36756003)(72206003)(97736004)(478600001)(2906002)(189998001)(53376002)(68736007)(66066001)(65956001)(65806001)(83506001)(50986999)(76176999)(25786009)(65826007)(5660300001)(101416001)(230700001)(5009440100003)(47776003)(966005)(4001350100001)(31686004)(64126003)(8656003)(106356001)(50466002)(3846002)(6116002)(81166006)(8676002)(93886005)(81156014)(33646002)(305945005)(54356999)(7736002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3097; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR07MB3097; 23:bmUBcSwAwAVwwx04flDBnFcf0e7hvvEpI6/ba?= =?Windows-1252?Q?tqXwjsPXeJCwZFEj9uysYWO9/VEZevHq14oun/iEdWTgkKs1MSZqCbD0?= =?Windows-1252?Q?u3Ngw216kFt/bcWQn+ml85zs7sR/r/OHQ0/oznWQTIx/MqkAzhrr4P13?= =?Windows-1252?Q?A5gNCipEFWFeBYQox8Qai6kNbjnoAihzF+25CRDR/LxCJ2hwA2plnIE7?= =?Windows-1252?Q?Xux5gmMo1sjT+GN2/pNNrht3Y9kFeHPQ/EbUsujCuy/BZdPiREDKZl1U?= =?Windows-1252?Q?qBtme9H737mOhJ4C/0V7pQSp8ccPwic9bGNzgWk4/kWyCxXNvperjnho?= =?Windows-1252?Q?DdOaByRpVvIxs1sGABKmZjFlEvIZJElgXzfQFbCiDKLGM9md8AAHkeoq?= =?Windows-1252?Q?ihnwfux4rQVMyfwYeDH2dmIUbabioAQpDonNQFw5yl2INYpJHVXKhjNu?= =?Windows-1252?Q?tKLjZS/IWpN47YrU/2LunN1yyyib3cmNuUx7TqnNWzyGIQ9DZcc1vfIZ?= =?Windows-1252?Q?kbUW66twGyieRXMFz4VxEw6E/FJ4RCKT44B8612nkgaTsBY5FFTIJMfm?= =?Windows-1252?Q?SJWncqcen9yuPmpRUpIioyZWWmXWLvQOrje/FsBBKN8X89a+Z/qdJY/8?= =?Windows-1252?Q?nT6zZ+zjHYPLP1f7G192HCEgkjRWAgk12r71dtlbwfYVEel2mAal2c+j?= =?Windows-1252?Q?yMelkt+J+B+2oiW7gyNzyAlEVc+DMGutFV7A0nNqBlbsJFt2ZgvvmgVD?= =?Windows-1252?Q?I0XBSkx0qZMe0qEuVc0fLN8GYaRT/Kx/OZL5++54JTjoi3UL0GrYiiiB?= =?Windows-1252?Q?LhanXAqjZ+x+Erc9fUTcne2B4j6hq/wn9A5xXlEZE0QkBRO2hUGuwRBd?= =?Windows-1252?Q?EW1QWTsbRBEgMWdnXYa0uxdGDOhINQoz0NnpJLooF/IBi6buKQUSZhNh?= =?Windows-1252?Q?/uS2vPnmwHNwydXRPYuTYpNlPmkDvMY/7Lk4Ng9dwTbb/BzPp+Qwpq6X?= =?Windows-1252?Q?GQ1x8OW1HG7Vzjae8elIUaAHIuuY6bnpNp46ViqDUBI8lDIF8ly9yjLt?= =?Windows-1252?Q?kXrjdrbhiXszqxcnsDJvT5XiM/4sjlPCfBADvGoY+ZYbN+zzFCf9kGvs?= =?Windows-1252?Q?RQbxCMmqtDUripesTDAQ1BE6hcycZzDfWHw/tZ6j1BQGxsd2nGzYZYEV?= =?Windows-1252?Q?6rxmRoX5MPzA3ohtBA+wINxTbNMH+CnNFy6kTzLlQ1KVG7sfCxusl+Gd?= =?Windows-1252?Q?E76cKX4lInGEFI7bEcTEg6j6lFEsPPAUipH0KeUTy9MNojXawluOr/x+?= =?Windows-1252?Q?vrxyh4JbCr1fffEJNs/zUGv3ZZ6s9Js6w3hvve7W43kDYGzmG7xWPgOf?= =?Windows-1252?Q?9nDXry79SpHfcs07KyEtDv8gQqaaEIckGDFYiyUmrUcTyWqTWJ93IRie?= =?Windows-1252?Q?A8OmwoFWbQgoov4EAkA32wKcMHvflInXNGJ11tRiQJGgEU8oJMhcN5CS?= =?Windows-1252?Q?C5YsNpYO7Eiq0EwaxjuetABHIObNinNqhIgVd4GxSWYzjClGBmrR3dC/?= =?Windows-1252?Q?aoRXrmzFgYUu7yumJqlp3anWiqrhHX/UjvF/XApMV+zrN7Pdb9l8rNQa?= =?Windows-1252?Q?uy5/WxuUhue6VsrTRvLQbA=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3097; 6:dlci6a3lIWekx+ZM5BnuBp+kb+ZuUdoa9mI32FslgJBOT/MDnOyOdMJ3qKk+8dyfkAFA/9pYQ6n7sc6vOfVOlcVEX3vpHbMiHLe7V2NGQnlq8Te/92VhPvWZUUMaFu08u3b4CDEgkj3xNsbkKNikguB8EYFMmLPwKT7Fneb+UrLNGBljNVAW1cP3xxmdF5BKDGbcU6jY8cFFxrIsSGsULQyO8WyLpkBlqbJBK4HfCbed3fj8y3YL/Y1HJYsD5pwrMMQji/Aqxk101p8NOH2n0Fw4W7l3zzLebUZgjV1d6QzddejdEAeOdBqm2I1+jB/gNHxfvPt7e8HwBkzBO6Q1Yg==; 5:3EqfOkdi+fDdIBC/il1969C5l/7ALVa4VQZpfxxUSU3MxFAxdtLWH+S6/QoJAcQkoMg+w11bbPKgsqCMaZKYf5ySyhSk7X0SXBNafIoWf8ZxqKQP524G8rSkwd9fi1q//F3Xb1p15CaXb30Xi5Do9g==; 24:quE6ANx4uEloKhZRHjTgCUyXWBAqosEWswEMlqMwCVIepdd9oQzdB1E7jdbs/hneG1HC6m1/PZzL3SQ0ltNV6grTe7BTUYyCCq0obXOB4rU=; 7:l8/rsuOErzq8y7p3D9mbfUOan+XAY63awTGmMcuv6HpAhYjxh9qeyl7wb6FHCt+mkw0llgMHX/Cxr9Y7yjcA4+BpDq8eh927boTBP9fhcUTUckLhw7LP4EN8ECThaTCctSPqm+NuYb6RtSof5gbGpnI2DNoPAlTESttdnmTLeiMH60LPsBC0J0vFTwfqx9Hv8qMmnIvUef3xRjQ3xbc3WWv65nWztk1+egb9d+Q7rOA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2017 13:14:44.8276 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3097 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: Mon, 04 Sep 2017 13:14:49 -0000 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/ >> --- 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