patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Reshma Pattan <reshma.pattan@intel.com>
To: stable@dpdk.org
Cc: Reshma Pattan <reshma.pattan@intel.com>
Subject: [dpdk-stable] [ PATCH 17.11 1/2] ethdev: clear ethdev data upon detach
Date: Fri,  1 Mar 2019 11:53:22 +0000	[thread overview]
Message-ID: <20190301115323.32420-1-reshma.pattan@intel.com> (raw)

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));
 	return 0;
 
 err:
-- 
2.17.1

             reply	other threads:[~2019-03-01 11:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 11:53 Reshma Pattan [this message]
2019-03-01 11:53 ` [dpdk-stable] [ PATCH 17.11 2/2] app/pdump: remove created vdevs Reshma Pattan
2019-03-04 19:57 ` [dpdk-stable] [ PATCH 17.11 1/2] ethdev: clear ethdev data upon detach Yongseok Koh
2019-03-12  9:31   ` 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=20190301115323.32420-1-reshma.pattan@intel.com \
    --to=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).