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 237DDA04F3; Wed, 8 Jan 2020 14:58:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9EA351DA0C; Wed, 8 Jan 2020 14:58:54 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id ECA561D9FB for ; Wed, 8 Jan 2020 14:58:52 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id b6so3541486wrq.0 for ; Wed, 08 Jan 2020 05:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=KfnoKIqARVGuGj9ofO3xGNx9gXsD6p3GEXrFeABt3BY=; b=focoiUhB3ChStn7aEZw40IQBIf9N2po+CDkhW4OWBhjqeQ1GLWz3CrhGkTfikwhGe+ mA8v9mCPtxGNxb1/hH+S6oLlafIAMOASEm4s5jruiBPdWp/8HgR/A2B8evq/VL+QxnO8 3AfEsy/GMLBowpxjPxHgPGApOagnxIqRrC+Iw8YVzMmWNvMJmJUfslKLzKSnAgLAG2u/ Bs32VtVbgUqy6LaSbSFcpr258imXBub0d2UjRBK1JIoeQ0TAZXfyr6RtMbtGkp8KUtRU dc1pmWcmYM5j3TQF20Dk4GyswdtaganYmu5b7wA0Kzgy66s81dJehLGQSn9I9a8BJmuL dxgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=KfnoKIqARVGuGj9ofO3xGNx9gXsD6p3GEXrFeABt3BY=; b=Or+XcvBmJD/jdUSKPAmJyV+aW1NR7/U/AGYqV10Gfu6nQpWwIWu1S+5iGrw7L2M6l5 a8eNHFMigG2184Mlh7KKOukq8xuFChCFXJAcsda9i2j6jaJIDIvfhG8o8hHpUHK8PYkz cIwODlltDdcz1V+mWMY1V7dhXDVeEPvZrGuxFlO6YQDqoX/a7qsbuj8kP9e7YY8aTQyh SzJ3LsEwIAFpKiW0c4xURiEihlGpN3DwHMLkdJFspW/kHz6DJAOG+g103pkwKB/rU5ch lsuM9yMqhJfHa9C5FaP6H3BssJKIbls/hIVj1OjHmD6fJog7by3Ceo6lP3TYShaGnLcf Gq6A== X-Gm-Message-State: APjAAAV4h3x8WiOjjjDTxsb9qfbK67vvMDznWcPP6OIS+bd9x3lQtDC3 nr0gVMaR75rcyzXvGb+Px6Ax4g== X-Google-Smtp-Source: APXvYqztu0MNdIzrd6e45d4aBrRoS6jYQhvnmd8VbMAisUTCsYo2a2PKDsKsiYeXu0AUWsBYCR2jPw== X-Received: by 2002:a5d:640d:: with SMTP id z13mr4759089wru.181.1578491932544; Wed, 08 Jan 2020 05:58:52 -0800 (PST) Received: from [10.16.0.207] (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.googlemail.com with ESMTPSA id c4sm3922897wml.7.2020.01.08.05.58.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2020 05:58:52 -0800 (PST) To: Thomas Monjalon , David Marchand , Ferruh Yigit 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: Laurent Hardy Message-ID: <9e05c21a-dfa9-4ac8-0937-38394b25dac0@6wind.com> Date: Wed, 8 Jan 2020 14:58:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1825898.usQuhbGJ8B@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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/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. 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 :) > The other alternatives are in rte_eth_dev_info and dev_flags. > > >