From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0068.outbound.protection.outlook.com [104.47.34.68]) by dpdk.org (Postfix) with ESMTP id 2BFDF9FE for ; Fri, 29 Sep 2017 13:21:35 +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=TfB9lvtALW/tOXaWkAaYmuMBNZpj0rUQ6tk0+xIXUYI=; b=ho3j7xBQI40c/XtNeSq7Ls/NBwiuKqPGWrwxDcpzCJVN7uletEnaS2sSNnNkQD9uB1QB3Rc7riIf63j1vlbirIC6q754DmqYbhhJvchFkCJv4ZPhYFZFxmVNf0SOofzKLcJq8W1swfdApqImE5KQrjrhzmsOZcvMUTUG7N3lzrI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [10.200.53.183] (82.141.252.178) by DM5PR07MB3099.namprd07.prod.outlook.com (10.172.85.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 29 Sep 2017 11:21:32 +0000 To: Olivier MATZ References: <20170815080717.9413-1-santosh.shukla@caviumnetworks.com> <20170911151837.25092-1-santosh.shukla@caviumnetworks.com> <20170911151837.25092-3-santosh.shukla@caviumnetworks.com> <20170925073728.auchwn7mxx63b32j@platinum> <8b832367-e8fa-077a-1732-50627e977f9c@caviumnetworks.com> <20170929083242.a4arzpf2drfqyxpj@platinum> Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <12be7257-4512-339f-63b1-c7926fff59e7@caviumnetworks.com> Date: Fri, 29 Sep 2017 12:21:28 +0100 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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [82.141.252.178] X-ClientProxiedBy: DM5PR21CA0007.namprd21.prod.outlook.com (10.173.176.145) To DM5PR07MB3099.namprd07.prod.outlook.com (10.172.85.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdc036e8-384b-4614-b363-08d5072c3d4f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3099; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3099; 3:TgaW4aAPM+m+3+22B8qm035KXx8jTn/lGslO80JmnJ1Wn1RI2xbgcDvvzyjBpD7ehdLnz6I1JW1YjcBNa4JNQ7NsESUbSGwGhCaccjHncjMmt47oh43f4yJKhmiH0hvTimrgjAHbcaGScWfuhnXgrFecq0KTONXptb68Fiqo1yOxZ49NfYRsTAiLnakQ/qiIU+kx5K8r0SVc/MR12fJhdfhSIKp/+3vZzaU/itg3pdOBQuvWGCN9vJcs5UudEA6a; 25:zXisTbi9vNO9UJDFe1lsBVPRv10wVmk0lFS6k0Bb15bSn/5mbado49ibkA6qhP+LkV2RsUxf/QP8O9HNvkHPba/mHwyRyUkTwYYWfjbLAFv6nn4kkzITJwM9CqM9tMouUGmsMpe3kVVhRBMpWh94L4Y/ol8T09xeRiOdSRoPH0MbPS3kadl1Dew+pEGx+eQmt46A3Kiaj4VMVJjJPCCGSKyYtlMi2b4KNFGZH+/NdeHz/Uo4y9CuYKnxbx4MrCxCwxMzMj5rbZO8aSsOb0KWv0BpcbSOdOGlFYR7c2CUV+F3GNj4shC+YEFTzzuXL0lXQbE91OvcucDVMiDwXKaaUg==; 31:o/TWjzW4gZKn2D/spi9mhjhlYMPr6M3cdzv/vctEkaUhQ0ECOG1SHzGnzY5SAXJiJpCXxlPN9uOeO+vn0ph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nwwFdCWnqkaTN6q/GrL0 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)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3099; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3099; X-Forefront-PRVS: 0445A82F82 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(376002)(346002)(189002)(51444003)(24454002)(377454003)(199003)(5660300001)(105586002)(50986999)(8676002)(33646002)(478600001)(16576012)(54356999)(106356001)(316002)(189998001)(93886005)(8936002)(3846002)(81156014)(66066001)(4326008)(65806001)(65956001)(230700001)(81166006)(47776003)(6116002)(76176999)(83506001)(6246003)(53936002)(36756003)(229853002)(7736002)(101416001)(97736004)(68736007)(6486002)(25786009)(2950100002)(86152003)(64126003)(90366009)(42882006)(6666003)(23746002)(6916009)(77096006)(2906002)(305945005)(50466002)(8656003)(65826007)(58126008)(31696002)(31686004)(72206003)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3099; H:[10.200.53.183]; 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; DM5PR07MB3099; 23:KoqLfdswCP9uw3VCxDXTXc8s6HeGhMquX9VYE?= =?Windows-1252?Q?iaKXhX+HzSG0ZirXyURQ77q0SxHoLKViJgjAvNqO0s0sBz9TUvWdFIhj?= =?Windows-1252?Q?aDRd9BQUW+PMsVTBnDuNvIMqG4thO3F+Y4GgG28/vz3WtCFwY8wLLm6N?= =?Windows-1252?Q?MwbT2vEPlkI8fox3A9BFy4vb9tUuuqTMhe86xapLdQlHvByQoDhTKI9o?= =?Windows-1252?Q?ZBjQGQ9HrHVqLlo24B1c/x1XCmVlFjs+tbac1w8tq4A/h4Z9/RG9SLM4?= =?Windows-1252?Q?5bne8hKxweU+uxdAIeFl78bGU3WORhgK9BIyK0pFhrm67uFCbdRDhzSY?= =?Windows-1252?Q?vOqqHD6AOH0b3m6Wy07XzJ4uUJcqQLopqlIn6Bya3KMSRKD5BgcPk15d?= =?Windows-1252?Q?LXMQ9mfWelXePAGscKA9lAUUSGIJM4cMK4FLlFjY/AvEeiZnvFJUqQpf?= =?Windows-1252?Q?YDjEeZSwl0kDcwLk/G3OJzebJn+pyULL8nce3MQd8bKvOKj68eOrIlOF?= =?Windows-1252?Q?6KhE9B7/O3SDmWDonHr1s5JHpI3sfaRWYombvo89JUTt+jPcbUu7XA5G?= =?Windows-1252?Q?P4iAyy5UGclS5lOoO2g4vnnap8jp7FnIdJaU7TH/JG9BGi0q1ikj4jFR?= =?Windows-1252?Q?P93f/FgQue6/6m+/trCjY5vlPE/woFbTw3fz3O+wnLTSBISg0C/WLd54?= =?Windows-1252?Q?OVne0V0lJQvm3l6KnuLVXxsxZost/YtwXTfP+VbXipfxmJIieBru5TjL?= =?Windows-1252?Q?P+rEBQ7iELdWIDH71CNKKDNUzXUXcrQqCeRvnKyMl/r+5chUhPF9Y4vT?= =?Windows-1252?Q?mc311j8ekgxFrcKPRmhU4yVWM0I7C/iIh6XdBCe5CG0AE7nPzG4hC4AI?= =?Windows-1252?Q?RT1XLx1SfQIX7erPj17mvNOuI9jjRCKgAtsyOCtVZk7PSjX1fFzc9O0n?= =?Windows-1252?Q?tnUsJ6HO1AJjY1WS31gW5a3q0oMtiUPXL+1Dd4nJg6jXjc59cMwqpK9V?= =?Windows-1252?Q?bOwKEO+QChce4Y+qT0HI+c/aoAn4YrzEiQLcsJBQgM4AqMAYFk4P3H8F?= =?Windows-1252?Q?pLQyHY1ri7mKGNa2WavsnR6F7+ni8tOaPwp2quaeSs89o1STF7Oy7F9J?= =?Windows-1252?Q?B2cmQMtbbbvsn6UlDiR7lNVuodcKg7q5j89Sy1UWfjEqEJQpsUGMSIp7?= =?Windows-1252?Q?+Slf8EGQuQ1vNfzVv7lnrZwNfwH3zmD33yFenFLzl0ty6SUk+wZiaOM1?= =?Windows-1252?Q?MxhL+cWHA6VJ5TOPf2ynerbRcIH8atn3EGPR0V98Y8LRJo86qqZNoB1n?= =?Windows-1252?Q?rRS7WkmulJgN6dtZigw0AFG0X3Y+plN/d5hmawMhbpZ3AmXGDTCAJjMc?= =?Windows-1252?Q?UcHCG1SN0Upb47dHl/3r5p9hR56S59SOYYJmdXX6YEhWRHAVniM38A6F?= =?Windows-1252?Q?J1MaQBDRfLuWEbEtMo3jktphDRiFiQ1kbltqDjjsydbiqCD7Vs5nArMd?= =?Windows-1252?Q?s7rr6goXFOG/ea8TNIhl61lYheZ+ZpQqgfFt1gMLRaMbj2MBIG4HB2RD?= =?Windows-1252?Q?5M+I+tQ4l1vEeY=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3099; 6:1gWqlA8MX6av4Vo7MT89kpPnA6xyratnckDeux+L1AadCfdowP36uj43fAeEVMFzaZUOrY3G4Gl9vSZoDEWifGPHMpJHQbKJZtvKCN+8pn/HViQfr+QIxF/fK5qXJ6Uh8JBV8jejMHUiRTkq1GwqQ7aa3PKMCihtXE54N5H4kbmBp9wxkDPlfuUC59qQPvbV0x96GWeLgS7gP7BfZgnNJBuJne832Gaa/pcWydYj6247BeRSCqnzNjIpl7WteT2gtMw/RbGn69YMC0Z+GLB/QsYLCjkf6x26T5pFZ71h4B27YLJYVTaWdf0GlMoW3d4vUUAW+/T/WN4cSRYeD1pD+w==; 5:/t0T7BqrEzUxjqW9+3wIwr5dsVPuPA5SqmJQ6BDY1lFgQVpXjOzxUyOpD9zWtSqfzlw67AAUUDUvGq+ZK2ZgQTLxuTfIlf/fqnvFnFyoFVm/6Z4/4+bWLUoYyrpd7QjsmXEiFMVSb79FV9ThHnyTrAf2fy7n9FejM9DlQi0fxN0=; 24:ZviU+opWxBNs2OXwB3a2CNjH8jGswNfecBn9o67zcZfaGPpVFO1X/sFDHsiNwvDMq4KjsBNMyHEHMAMMoGnm8m/iRngJPJVv1oGWyiRJZOI=; 7:YhWFDxPYawILxtc6AIHG/ydaYg1YEYcrkg/Ua8gHa4IVgeDh96Sff1vB76hTDN96qHhVhVmrgR70U1Yiv7hhlVIE5grOnivH7/L9kgeZzCh9f5ItoB/NAPTsf64elZBSXwlX4mh9bzHts9pRcVMXWzPIf4oy5VBdZ+asu1IcMbeZxXaS05Q5Lr7a7gWIeeBQlQ7PtuBUdtaWQ+tugJT5qc+3/eUJpoucQkFethfd3Sg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2017 11:21:32.2944 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3099 Subject: Re: [dpdk-dev] [PATCH v4 2/2] ethdev: get the supported pools for a port 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: Fri, 29 Sep 2017 11:21:35 -0000 On Friday 29 September 2017 11:16 AM, santosh wrote: > Hi Olivier, > > > On Friday 29 September 2017 09:32 AM, Olivier MATZ wrote: >> On Mon, Sep 25, 2017 at 10:52:31PM +0100, santosh wrote: >>> Hi Olivier, >>> >>> >>> On Monday 25 September 2017 08:37 AM, Olivier MATZ wrote: >>> >>>>> +{ >>>>> + struct rte_eth_dev *dev; >>>>> + const char *tmp; >>>>> + >>>>> + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); >>>>> + >>>>> + if (pool == NULL) >>>>> + return -EINVAL; >>>>> + >>>>> + dev = &rte_eth_devices[port_id]; >>>>> + >>>>> + if (*dev->dev_ops->pools_ops_supported == NULL) { >>>>> + tmp = rte_eal_mbuf_default_mempool_ops(); >>>>> + if (!strcmp(tmp, pool)) >>>>> + return 0; >>>>> + else >>>>> + return -ENOTSUP; >>>> I don't understand why we are comparing with >>>> rte_eal_mbuf_default_mempool_ops(). >>>> >>>> It means that the result of the function would be influenced >>>> by the parameter given by the user. >>> But that will be only for ops not supported case and in that case, >>> function _must_ make sure that if inputted param is _default_ops_name >>> then function should return ops supported correct info (whether >>> returning '0' : Best ops or '1': ops does support >>> , this part is arguable.. meaning One can say that default_ops ='handle-name' is best possible handle Or >>> one of handle which platform supports). >>> >>>> I think that a PMD that does not implement ->pools_ops_supported >>>> should always return 1 (mempool is supported). >> I don't agree. >> The result of this API (mempool ops supported or not by a PMD) >> should not depend on what user asks for. >> >>> Return 1 says: PMD support this ops.. >>> >>> So if ops is not supported and func returns with 1, then which ops application will use? >>> If that ops is default_ops.. then How application will distinguish when to use default ops or >>> param ops?.. as because in both cases func will return with value 1. >>> >>> The approach in the patch takes care of that condition and func will return -ENOTSUP >>> if (ops not support || inputted param not matching with default ops) otherwise will return >>> 0 or 1. >>> >>> At application side; >>> For error case: In case of -ENOTSUP, its upto application to use _default_ops or exit. >>> For good case: 0 or 1 case, func gaurantee that handle is either best handle for pool or pool supports >>> that handle.. However in your suggestion if ops not supported case returns 1 then application is not >>> sure which ops to use.. default_ops Or input ops given to func. >>> >>> make sense? >> My proposition is: >> >> - what a PMD returns does not depend on used parameter: >> - 0: best support >> - 1: support >> - -ENOTSUP: not supported >> >> - if a PMD does not implement the _ops_supported() API, assume all pools >> are supported (returns 1) > If API returns 1 for PMD does not implement _ops_supported() case, > then do we really need -ENOTSUP? > > If so then in which case API will return -ENOTSUP error, wondering. To summarize return value of API (specially for error case): - 0: best support - 1: pool support ops or _that_ PMD did not implement _ops_supported(). - -ENODEV: Invalid port id. - -EINVAL: pool is null. So to me, We don't need -ENOTSUP error code as return value 1 per your input, address both case ie.. (Pool does support this ops Or _that_ PMD does not implement _ops_supported()). is above API return value and their case explanation make sense to you? If not then could you pl. be more explicit on your error code case detailing and suggest more about return value '1' case? As per me: Return value 1 is wearing two hats, addressing two cases. Correct me if I misunderstood your proposition? Thanks.