DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: dpdk-dev <dev@dpdk.org>
Subject: Re: [PATCH v2] ethdev: fix dev close in secondary process
Date: Wed, 1 Jun 2022 11:18:09 +0800	[thread overview]
Message-ID: <c816a78e-e900-4d26-05b1-f037ae3976da@huawei.com> (raw)
In-Reply-To: <CACZ4nhtsrme3Upf5rtB7YSVyuYYt4=+1Ks3riykQTQFPJVThsQ@mail.gmail.com>

Hi, Ajit
v3 has been sent, thanks

在 2022/6/1 10:01, Ajit Khaparde 写道:
> On Tue, May 31, 2022 at 6:32 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>>
>> From: Min Hu <humin29@huawei.com>
>>
>> Secondary process need to close dev to release process private resources.
>> But secondary process should not be obliged to wait for device stop before
>> closing ethdev.
>>
>> This patch fixed it.
>>
>> Fixes: febc855b358e ("ethdev: forbid closing started device")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Min Hu <humin29@huawei.com>
>> ---
>> v2:
>> * fixed comment.
>> ---
>>   lib/ethdev/rte_ethdev.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>> index 09abee6345..f34c6580a4 100644
>> --- a/lib/ethdev/rte_ethdev.c
>> +++ b/lib/ethdev/rte_ethdev.c
>> @@ -1574,7 +1574,8 @@ rte_eth_dev_close(uint16_t port_id)
>>          RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>          dev = &rte_eth_devices[port_id];
>>
>> -       if (dev->data->dev_started) {
> It will be good to add the comment as a part of the code as well.
> That way someone in future won't have to look at the commit log to
> understand the behavior.
> 
>> +       if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
>> +                       dev->data->dev_started) {
>>                  RTE_ETHDEV_LOG(ERR, "Cannot close started device (port %u)\n",
>>                                 port_id);
>>                  return -EINVAL;
>> --
>> 2.33.0
>>

  reply	other threads:[~2022-06-01  3:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  2:35 [PATCH] " Min Hu (Connor)
2022-05-31 17:08 ` Andrew Rybchenko
2022-05-31 17:40   ` Stephen Hemminger
2022-06-01  1:33     ` Min Hu (Connor)
2022-06-01  1:30 ` [PATCH v2] " Min Hu (Connor)
2022-06-01  2:01   ` Ajit Khaparde
2022-06-01  3:18     ` Min Hu (Connor) [this message]
2022-06-01 13:45       ` Ajit Khaparde
2022-06-01  3:15 ` [PATCH v3] " Min Hu (Connor)
2022-06-01 10:38   ` Andrew Rybchenko

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=c816a78e-e900-4d26-05b1-f037ae3976da@huawei.com \
    --to=humin29@huawei.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    /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).