From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: Huisong Li <lihuisong@huawei.com>, dev@dpdk.org
Cc: thomas@monjalon.net, ferruh.yigit@intel.com,
konstantin.ananyev@intel.com,
"david.marchand@redhat.com" <david.marchand@redhat.com>,
Ray Kinsella <mdr@ashroe.eu>
Subject: Re: [dpdk-dev] [PATCH V2] ethdev: add dev configured flag
Date: Wed, 7 Jul 2021 11:25:20 +0300 [thread overview]
Message-ID: <d32a09f0-8031-ef4c-cc1c-26f2da9fc4bd@oktetlabs.ru> (raw)
In-Reply-To: <759fb9f8-3068-a5a2-e7cb-2445581aa960@huawei.com>
On 7/7/21 5:55 AM, Huisong Li wrote:
>
> 在 2021/7/6 16:36, Andrew Rybchenko 写道:
>> @David, could you take a look at the ABI breakage warnings for
>> the patch. May we ignore it since ABI looks backward
>> compatible? Or should be marked as a minor change ABI
>> which is backward compatible with DPDK_21?
>>
>> On 7/6/21 7:10 AM, Huisong Li wrote:
>>> Currently, if dev_configure is not called or fails to be called, users
>>> can still call dev_start successfully. So it is necessary to have a flag
>>> which indicates whether the device is configured, to control whether
>>> dev_start can be called and eliminate dependency on user invocation
>>> order.
>>>
>>> The flag stored in "struct rte_eth_dev_data" is more reasonable than
>>> "enum rte_eth_dev_state". "enum rte_eth_dev_state" is private to the
>>> primary and secondary processes, and can be independently controlled.
>>> However, the secondary process does not make resource allocations and
>>> does not call dev_configure(). These are done by the primary process
>>> and can be obtained or used by the secondary process. So this patch
>>> adds a "dev_configured" flag in "rte_eth_dev_data", like "dev_started".
>>>
>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>>
>>> ---
>>> v1 -> v2:
>>> - adjusting the description of patch.
>>>
>>> ---
>>> lib/ethdev/rte_ethdev.c | 16 ++++++++++++++++
>>> lib/ethdev/rte_ethdev_core.h | 6 +++++-
>>> 2 files changed, 21 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>>> index c607eab..6540432 100644
>>> --- a/lib/ethdev/rte_ethdev.c
>>> +++ b/lib/ethdev/rte_ethdev.c
>>> @@ -1356,6 +1356,13 @@ rte_eth_dev_configure(uint16_t port_id,
>>> uint16_t nb_rx_q, uint16_t nb_tx_q,
>>> return -EBUSY;
>>> }
>>> + /*
>>> + * Ensure that "dev_configured" is always 0 each time prepare to do
>>> + * dev_configure() to avoid any non-anticipated behaviour.
>>> + * And set to 1 when dev_configure() is executed successfully.
>>> + */
>>> + dev->data->dev_configured = 0;
>>> +
>>> /* Store original config, as rollback required on failure */
>>> memcpy(&orig_conf, &dev->data->dev_conf,
>>> sizeof(dev->data->dev_conf));
>>> @@ -1606,6 +1613,8 @@ rte_eth_dev_configure(uint16_t port_id,
>>> uint16_t nb_rx_q, uint16_t nb_tx_q,
>>> }
>>> rte_ethdev_trace_configure(port_id, nb_rx_q, nb_tx_q,
>>> dev_conf, 0);
>>> + dev->data->dev_configured = 1;
>>> +
>> I think it should be inserted before the trace, since tracing
>> is intentionally put close to return without any empty lines
>> in between.
> All right. Do I need to send a patch V3?
Since the patch is waiting for resolution for ABI warning,
please, send v3 with my Reviewed-by and ack from Konstantin.
It will be a bit easier to apply when it is OK to do it.
next prev parent reply other threads:[~2021-07-07 8:25 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 8:00 [dpdk-dev] [RFC] lib/ethdev: " 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
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 [this message]
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=d32a09f0-8031-ef4c-cc1c-26f2da9fc4bd@oktetlabs.ru \
--to=andrew.rybchenko@oktetlabs.ru \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=lihuisong@huawei.com \
--cc=mdr@ashroe.eu \
--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).