[dpdk-dev] [RFC] lib/ethdev: add dev configured flag

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Mon Jul 5 11:50:04 CEST 2021


On 7/5/21 6:03 AM, Huisong Li wrote:
> 
> 在 2021/7/3 19:04, Ananyev, Konstantin 写道:
>>> 在 2021/7/2 21:23, Ananyev, Konstantin 写道:
>>>>> On 7/2/2021 12:08 PM, Andrew Rybchenko wrote:
>>>>>> @Thomas, @Ferruh, I tend to accept it (with minor style fixes),
>>>>>> but I need your opinion on it before doing it.
>>>>>>
>>>>> I guess we were relying on the user/application to have correct
>>>>> order up until
>>>>> now, it can be good to add this into the API. OK to add it for me.
>>>> I don't know do we really need that flag in dev_data or not,
>>>> but if we do - probably better to reset it at dev_confgure()
>>>> straight before
>>>> we start to make any changes in dev_data.
>>> Sorry, I don't get you. Some fields in rte_eth_dev_data are initialized
>>> firstly in the probe phase.
>>>
>>> Do you mean to add clear this flag at the beginning of dev_configure()?
>> Yes, just before we start to modify things.
> 
> In this patch, this flag has been cleared for all scenarios where the
> rte_eth_dev_data modification fails in the dev_configure().
> 
> And it is set to 1 when dev_configure() is configured successfully.
> 
> Please check the rollback. Thanks😁

I guess Konstantin means the case when user re-configures
the device which has been configured before and the operation
fails. I'm not 100% what should be the state of the flag when
dev_configure callback is executed. I'd say that it should be
0 when the first configure happens and should be 1 in the
case of reconfigure. I'll try to review it carefully when
non-RFC version of the patch is available.


More information about the dev mailing list