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 ABA75A04F3; Wed, 8 Jan 2020 14:20:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A92C1D9A6; Wed, 8 Jan 2020 14:20:52 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id AB75D1D997 for ; Wed, 8 Jan 2020 14:20:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2020 05:20:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,410,1571727600"; d="scan'208";a="215948433" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.35]) ([10.237.221.35]) by orsmga008.jf.intel.com with ESMTP; 08 Jan 2020 05:20:48 -0800 To: Thomas Monjalon , Laurent Hardy , 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> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6hxdzTmLRtGtwWzI9MwrUPj6n/ldiD58VAGQ +iR1I/z9UBUN/ZMksElA2D7Jgg7vZ78iKwNnd+vLBD6I61kVrZ45Vjo3r+pPOByUBXOUlxp9 GWEKKIrJ4eogqkVNSixN16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ca1PUQ61SZJZOMl6VwNxpdvEaolVdrpnSxUF31kPEvR0Igy8HysQ11pj8AcgH0a9FrvU /8k2Roccd2ZIdpNLkirGFZR7LtRw41Kt1Jg+lafI0efkiHKMT/6D/P1EUp1RxOBNtWGV2hrd 0Yg9ds+VMphHHU69fDH02SwgpvXwG8Qm14Zi5WQ66R4CtTkHuYtA63sS17vMl8fDuTCtvfPF HzvdJLIhDYN3Mm1oMjKLlq4PUdYh68Fiwm+boJoBUFGuregJFlO3hM7uHBDhSEnXQr5mqpPM 6R/7Q5BjAxrwVBisH0yQGjsWlnysRWNfExAE2sRePSl0or9q19ddkRYltl6X4FDUXy2DTXa9 a+Fw4e1EvmcF3PjmTYs9IE3Vc64CRQXkhujcN4ZZh5lvOpU8WgyDxFq7bavFnSS6kx7Tk29/ wNJBp+cf9qsQxLbqhW5kfORuZGecus0TLcmpZEFKKjTJBK9gELRBB/zoN3j41hlEl7uTUXTI JQFLhpsFlEdKLujyvT/aCwP3XWT+B2uZDKrMAElF6ltpTxI53JYi22WO7NH7MR16Fhi4R6vh FHNBOkiAhUpoXRZXaCR6+X4qwA8CwHGqHRBfYFSU/Ulq1ZLR+S3hNj2mbnSx0lBs1eEqe2vh cA== Message-ID: <9ae94152-5be3-5356-94e6-a432fc3c02cb@intel.com> Date: Wed, 8 Jan 2020 13:20:45 +0000 MIME-Version: 1.0 In-Reply-To: <1825898.usQuhbGJ8B@xps> 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: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. No strong opinion, I though a standardized way may help other device abstraction layers too. > > >> 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. I didn't get your comment. For example getting FW version, I am saying instead of keeping another piece of information to say if it is supported by device/driver, better to grasp this from if the driver implemented 'fw_version_get' dev_ops or not. > > >> 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. > > The other alternatives are in rte_eth_dev_info and dev_flags. > >