From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 000CFA00C5; Fri, 8 May 2020 14:11:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 598111D981; Fri, 8 May 2020 14:11:29 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B44A41BEE4 for ; Fri, 8 May 2020 14:11:26 +0200 (CEST) IronPort-SDR: +QBWlQ/NOMObeRSTkl7apvoX9RSnr1SwO+GSl23Q69o9jlUDHFBF45vrrLUcSIzu32usC1Fwm1 8Ft92yGXlUYQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 05:11:25 -0700 IronPort-SDR: ZUHLk1JSMIiugnLCOdu8p1F0tXqlEJV0pPCChuVjlaIOYiyT1yreCOSvOnmOoqtOU6VpfmbdDh aH7RRfM56Xow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,367,1583222400"; d="scan'208";a="435693505" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.213.197.139]) ([10.213.197.139]) by orsmga005.jf.intel.com with ESMTP; 08 May 2020 05:11:23 -0700 To: Laurent Hardy , Thomas Monjalon , David Marchand Cc: dev , Olivier Matz , Andrew Rybchenko References: <20200107145637.8922-1-laurent.hardy@6wind.com> <4b86e1d8-9c25-ce7c-f5f4-124c63a7c8b0@6wind.com> <779e74a2-7816-216b-fdc2-282bab822af4@intel.com> <1825898.usQuhbGJ8B@xps> <9e05c21a-dfa9-4ac8-0937-38394b25dac0@6wind.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@intel.com; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyG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QOxCvwRG2QCgcJ/UTn5vlivul+cThi6ERPvjqjblLncQtRg8izj2qgmwQkvfj+h7Ex88bI 8iWtu5+I3K3LmNz/UxHBSWEmUnkg4fJlRr7oItHsZ0ia6wWQ8lQnABEBAAGJAjwEGAEKACYC GwwWIQTSNlOHQi7ChOOZgcf5M+tD3xNhHwUCXqFrngUJCKxSYAAKCRD5M+tD3xNhH3YWD/9b cUiWaHJasX+OpiuZ1Li5GG3m9aw4lR/k2lET0UPRer2Jy1JsL+uqzdkxGvPqzFTBXgx/6Byz EMa2mt6R9BCyR286s3lxVS5Bgr5JGB3EkpPcoJT3A7QOYMV95jBiiJTy78Qdzi5LrIu4tW6H o0MWUjpjdbR01cnj6EagKrDx9kAsqQTfvz4ff5JIFyKSKEHQMaz1YGHyCWhsTwqONhs0G7V2 0taQS1bGiaWND0dIBJ/u0pU998XZhmMzn765H+/MqXsyDXwoHv1rcaX/kcZIcN3sLUVcbdxA WHXOktGTQemQfEpCNuf2jeeJlp8sHmAQmV3dLS1R49h0q7hH4qOPEIvXjQebJGs5W7s2vxbA 5u5nLujmMkkfg1XHsds0u7Zdp2n200VC4GQf8vsUp6CSMgjedHeF9zKv1W4lYXpHp576ZV7T GgsEsvveAE1xvHnpV9d7ZehPuZfYlP4qgo2iutA1c0AXZLn5LPcDBgZ+KQZTzm05RU1gkx7n gL9CdTzVrYFy7Y5R+TrE9HFUnsaXaGsJwOB/emByGPQEKrupz8CZFi9pkqPuAPwjN6Wonokv ChAewHXPUadcJmCTj78Oeg9uXR6yjpxyFjx3vdijQIYgi5TEGpeTQBymLANOYxYWYOjXk+ae dYuOYKR9nbPv+2zK9pwwQ2NXbUBystaGyQ== Message-ID: <78444244-40d2-f29c-df14-bdb18163e70b@intel.com> Date: Fri, 8 May 2020 13:11:23 +0100 MIME-Version: 1.0 In-Reply-To: <9e05c21a-dfa9-4ac8-0937-38394b25dac0@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] librte_ethdev: extend dpdk api led control to query 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/8/2020 1:58 PM, Laurent Hardy wrote: > > On 1/8/20 2:06 PM, Thomas Monjalon wrote: >> 08/01/2020 13:59, Ferruh Yigit: >>> On 1/8/2020 10:31 AM, Laurent Hardy wrote: >>>> Hi all, >>>> >>>> On 1/8/20 10:55 AM, David Marchand wrote: >>>>> On Wed, Jan 8, 2020 at 10:09 AM Ferruh Yigit wrote: >>>>>> On 1/8/2020 8:56 AM, David Marchand wrote: >>>>>>> Hello Laurent, >>>>>>> >>>>>>> Bonne année. >>>>>>> >>>>>>> Cc: maintainers. >>>>>>> >>>>>>> On Tue, Jan 7, 2020 at 3:57 PM Laurent Hardy wrote: >>>>>>>> In current led control API we have no way to know if a device is able >>>>>>>> to handle on/off requests coming from the application. >>>>>>>> Knowing if the device is led control capable could be useful to avoid >>>>>>>> exchanges between application and kernel. >>>>>>>> Using the on/off requests to flag if the device is led control capable >>>>>>>> (based on the ENOSUP returned error) is not convenient as such request >>>>>>>> can change the led state on device. >>>>>>>> >>>>>>>> This patch adds a new function rte_eth_led_ctrl_capable() that will look >>>>>>>> for led_off/on dev ops availability on the related pmd, to know if the >>>>>>>> device is able to handle such led control requests (on/off). >>>>>>> This patch breaks the ABI, which is BAD :-). >>>>>> Why it is an ABI break, dev_ops should be between library and drivers, so it >>>>>> should be out of the ABI concern, isn't it. >>>>> You are right. >>>>> So in our context, this is not an ABI breakage. >>>>> But abidiff still reports it, so maybe some filtering is required to >>>>> avoid this false positive. >>>>> >>>>> Note that if we insert an ops before rx_queue_count, we would have a >>>>> real ABI breakage, as this ops is accessed via an inline wrapper by >>>>> applications. >>>>> >>>>> >>>>>>> This new api only needs to look at the existing ops, so you can remove >>>>>>> the (unused in your patch) dev_led_ctrl_capable ops. >>>>>>> >>>>>>> OTOH, would it make sense to expose this capability in dev_flags? >>>>>>> >>>>>> 'rte_eth_led_on()' & 'rte_eth_led_off()' APIs returns '-ENOTSUP' when the not >>>>>> supported, can that help application to understand? >>>>> You might want to know it is supported without changing the state. >>>>> Laurent? >>>> First, happy new year :) >>>> >>>> Yes exactly, the purpose of this patch is to query if the device is led >>>> control capable or not without changing the led state. >>>> >>>> About exposing the capability through a dev_flags, means to make some >>>> modification in each pmds. It looks more easy in term of pmds >>>> maintenance to relying on the rte_eth_led_off()/on() dev ops >>>> availability at rte_ethdev level, right ? >>>> >>> 'dev_flag' definition is not clear, right now it holds the combination of status >>> and capability. And we have 'rte_eth_dev_info' struct, which is again >>> combination of device capability and status. >> I agree capabilities in ethdev are a bit of a mess. >> I would appreciate someone makes a complete audit of it >> so we can discuss how to improve the situation. >> >> >>> Perhaps we should have explicit capabilities and status fields, even in the >>> rte_device level which inherited by net/crypto devices etc.. >> No, ethdev capabilities should stay in ethdev. >> >> >>> But for dev_ops, instead of having another capabilities indicator, which >>> requires PMDs to keep this synchronized, I think it is better if we can self >>> contain this information within dev_ops, like not implementing dev_ops would >>> mean it is not supported, this way it is easier to maintain and less error prone. >> It means the dev_ops is resetted at init if a device does not support the feature. >> It is against having const dev_ops. >> >> >>> Only we should have it without side effect, >>> >>> 1- adding an additional 'dry-run' parameter can work, but this means breaking >>> ABI and updating majority of the ethdev APIs :) >>> 2- Adding 'is_supported' versions of the APIs as we need can be an option, like >>> 'rte_eth_led_on_is_supported()' >>> 3- Olivier's suggestion to add a new API to get the led status, so that this >>> information can be used select led API which won't cause side affect and let us >>> learn if it is supported. >>> >>> Any other alternatives? >>> >>> I would prefer the 2) in above ones, which is very similar to the original patch. > > I can provide a V2 which will remove the useless dev_led_ctrl_capable ops. +1, dev_led_ctrl_capable is not used. > > About the 'is_supported()' versions of APIs, in the current patch I > factorize > the check on dev ops on and off availability in a same function named > "led_ctrl_capable" but I can rename it if required. > > Just in this specific case I don't dissociate on and off capability, as > being > able to set the led off without a way to set it on again sounds a bit > unusual :) What about following, Right now there is not way to get led status, only have on/off We can store status in ethdev layer add a 'rte_eth_led_status' which can return status. If the on/off dev_ops are not set, it can return 'unavailable' which covers your usecase.