[dpdk-dev] [PATCH] net/failsafe: limit device capabilities to really supported

Andrew Rybchenko arybchenko at solarflare.com
Wed Sep 26 08:36:05 CEST 2018


On 9/25/18 6:48 PM, Gaëtan Rivet wrote:
> Hi,
>
> Sorry I had forgotten this one.
> I would rename the title, something like:
>
> net/failsafe: report actual device capabilities
>
> And a few edits in the commit log:
>
> On Wed, Aug 29, 2018 at 08:45:36AM +0100, Andrew Rybchenko wrote:
>> From: Igor Romanov <Igor.Romanov at oktetlabs.ru>
>>
>> Failsafe driver does not support any device capabilities yet.

In fact above statement was valid at the moment of initial submission,
but it is invalid now since run-time queue setup support added.

>> Make fs_dev_infos_get() consider default ones to limit advertised
>                            ^^^^^^^^=report

We do not blindly report so-called default capabilities. We take
capabilities reported by sub-devices as well. I think that "default"
can confuse unaware reader here (since default is the failsafe device
capabilities and "default" is just a part of variable name). So, I suggest
to reword it.

I'll send v2 shortly.

>> device capabilities to really supported instead of unconditional
>                          | ^^^^^=actually? ^^^^^^^^^^^^^^^^^^^^^^^^
>                          ^ +those?
>> inheritance from sub-devices.
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> whole end of sentence can be removed.
>> Fixes: cac923cfea47 ("ethdev: support runtime queue setup")
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Igor Romanov <Igor.Romanov at oktetlabs.ru>
>> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
> Otherwise
>
> Acked-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
>
>> ---
>>   drivers/net/failsafe/failsafe_ops.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
>> index 24e91c931..2df8b55d9 100644
>> --- a/drivers/net/failsafe/failsafe_ops.c
>> +++ b/drivers/net/failsafe/failsafe_ops.c
>> @@ -716,6 +716,8 @@ fs_stats_reset(struct rte_eth_dev *dev)
>>    *      all sub_devices and the default capabilities.
>>    *      Uses a logical AND of TX capabilities among
>>    *      the active probed sub_device and the default capabilities.
>> + *      Uses a logical AND of device capabilities among
>> + *      all sub_devices and the default capabilities.
>>    *
>>    */
>>   static void
>> @@ -734,10 +736,12 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
>>   		uint64_t rx_offload_capa;
>>   		uint64_t rxq_offload_capa;
>>   		uint64_t rss_hf_offload_capa;
>> +		uint64_t dev_capa;
>>   
>>   		rx_offload_capa = default_infos.rx_offload_capa;
>>   		rxq_offload_capa = default_infos.rx_queue_offload_capa;
>>   		rss_hf_offload_capa = default_infos.flow_type_rss_offloads;
>> +		dev_capa = default_infos.dev_capa;
>>   		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
>>   			rte_eth_dev_info_get(PORT_ID(sdev),
>>   					&PRIV(dev)->infos);
>> @@ -746,12 +750,14 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
>>   					PRIV(dev)->infos.rx_queue_offload_capa;
>>   			rss_hf_offload_capa &=
>>   					PRIV(dev)->infos.flow_type_rss_offloads;
>> +			dev_capa &= PRIV(dev)->infos.dev_capa;
>>   		}
>>   		sdev = TX_SUBDEV(dev);
>>   		rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos);
>>   		PRIV(dev)->infos.rx_offload_capa = rx_offload_capa;
>>   		PRIV(dev)->infos.rx_queue_offload_capa = rxq_offload_capa;
>>   		PRIV(dev)->infos.flow_type_rss_offloads = rss_hf_offload_capa;
>> +		PRIV(dev)->infos.dev_capa = dev_capa;
>>   		PRIV(dev)->infos.tx_offload_capa &=
>>   					default_infos.tx_offload_capa;
>>   		PRIV(dev)->infos.tx_queue_offload_capa &=
>> -- 
>> 2.17.1
>>



More information about the dev mailing list