Re: [dpdk-dev] [RFC] lib/ethdev: add dev configured flag
From: Ananyev, Konstantin <hidden>
Date: 2021-07-05 11:22:37
On 7/5/21 6:03 AM, Huisong Li wrote:quoted
在 2021/7/3 19:04, Ananyev, Konstantin 写道:quoted
quoted
在 2021/7/2 21:23, Ananyev, Konstantin 写道:quoted
quoted
On 7/2/2021 12:08 PM, Andrew Rybchenko wrote:quoted
@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().
I understand that. What I am saying: at first call to dev_confgiure() you execute it with dev_data->confgiured == 0. On second and subsequent calls - it could be either 0 or 1, depending how previous dev_confgiure() had finished. I think it would be good to keep it always the same, to avoid any non-anticipated behaviour.
quoted
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.