DPDK patches and discussions
 help / color / mirror / Atom feed
From: Huisong Li <lihuisong@huawei.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [RFC] lib/ethdev: add dev configured flag
Date: Tue, 6 Jul 2021 09:47:38 +0800	[thread overview]
Message-ID: <ff145deb-0f83-785b-67cb-0533e283cb68@huawei.com> (raw)
In-Reply-To: <DM6PR11MB44919F0C7506A1F23C4007A79A1C9@DM6PR11MB4491.namprd11.prod.outlook.com>


在 2021/7/5 19:22, Ananyev, Konstantin 写道:
>
>> 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().
> 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.

I get it.

The current patch can ensure that this flag is 1 when dev_configure() is 
called successfully,

and is 0 when dev_configure() isn't called or dev_data fails to be 
modified.

But there is a drawback, as you say. I will fix it in non-RFC version.

>>> 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.

  reply	other threads:[~2021-07-06  1:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  8:00 Huisong Li
2021-05-31  8:51 ` Huisong Li
2021-06-14 15:37 ` Andrew Rybchenko
2021-06-29  2:27   ` Huisong Li
2021-07-02 10:08     ` Andrew Rybchenko
2021-07-02 11:57       ` Ferruh Yigit
2021-07-02 13:23         ` Ananyev, Konstantin
2021-07-03  8:35           ` Huisong Li
2021-07-03 11:04             ` Ananyev, Konstantin
2021-07-05  3:03               ` Huisong Li
2021-07-05  9:50                 ` Andrew Rybchenko
2021-07-05 11:22                   ` Ananyev, Konstantin
2021-07-06  1:47                     ` Huisong Li [this message]
2021-07-04 20:05 ` Thomas Monjalon
2021-07-05  3:18   ` Huisong Li
2021-07-05  6:07     ` Thomas Monjalon
2021-07-05  9:50       ` Andrew Rybchenko
2021-07-06  1:48         ` Huisong Li
2021-07-06  3:24 ` [dpdk-dev] [PATCH V1] ethdev: " Huisong Li
2021-07-06  4:10 ` [dpdk-dev] [PATCH V2] " Huisong Li
2021-07-06  8:36   ` Andrew Rybchenko
2021-07-07  2:55     ` Huisong Li
2021-07-07  8:25       ` Andrew Rybchenko
2021-07-07  9:26         ` Huisong Li
2021-07-07  7:39     ` David Marchand
2021-07-07  8:23       ` Andrew Rybchenko
2021-07-07  9:36         ` David Marchand
2021-07-07  9:59           ` Thomas Monjalon
2021-07-07 10:40             ` David Marchand
2021-07-07 10:57               ` Thomas Monjalon
2021-07-06 17:49   ` Ananyev, Konstantin
2021-07-07  9:53 ` [dpdk-dev] [PATCH V3] " Huisong Li
2021-07-08  9:56   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff145deb-0f83-785b-67cb-0533e283cb68@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).