patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Reshma Pattan <reshma.pattan@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [ PATCH 17.11 1/2] ethdev: clear ethdev data upon	detach
Date: Mon, 4 Mar 2019 19:57:16 +0000	[thread overview]
Message-ID: <CC1C3081-23A6-4A5B-ABD6-5FB7FBDDD02A@mellanox.com> (raw)
In-Reply-To: <20190301115323.32420-1-reshma.pattan@intel.com>


> On Mar 1, 2019, at 3:53 AM, Reshma Pattan <reshma.pattan@intel.com> wrote:
> 
> When port is detached its relevant rte_eth_dev_data[port_id]
> has to be zeroed, otherwise the next port creations
> could get wrong port_id.
> 
> Fixes: 92d94d3744 ("ethdev: attach or detach port")
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> lib/librte_ether/rte_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 096b35faf..7ba9bc564 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -443,6 +443,7 @@ rte_eth_dev_detach(uint16_t port_id, char *name)
> 		goto err;
> 
> 	rte_eth_devices[port_id].state = RTE_ETH_DEV_UNUSED;
> +	memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data));

Hi,

I believe such code is good to have. Before I merge it, I have a question.
I wonder what the problem of the current code is.
If the state turns into RTE_ETH_DEV_UNUSED,
then will the eth_dev be re-initialized next time anyway?


Thanks,
Yongseok


> 	return 0;
> 
> err:
> -- 
> 2.17.1
> 

  parent reply	other threads:[~2019-03-04 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 11:53 Reshma Pattan
2019-03-01 11:53 ` [dpdk-stable] [ PATCH 17.11 2/2] app/pdump: remove created vdevs Reshma Pattan
2019-03-04 19:57 ` Yongseok Koh [this message]
2019-03-12  9:31   ` [dpdk-stable] [ PATCH 17.11 1/2] ethdev: clear ethdev data upon detach Pattan, Reshma
2019-03-12 21:53     ` Yongseok Koh

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=CC1C3081-23A6-4A5B-ABD6-5FB7FBDDD02A@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=reshma.pattan@intel.com \
    --cc=stable@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).