From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/4] ethdev: refactor port release
Date: Sun, 19 Jul 2015 12:52:16 +0200 [thread overview]
Message-ID: <1437303137-29430-4-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1437303137-29430-1-git-send-email-thomas.monjalon@6wind.com>
Use DEV_DETACHED constant and deduplicate code in init.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
lib/librte_ether/rte_ethdev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 9596047..d00d104 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -287,7 +287,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
if (eth_dev == NULL)
return -EINVAL;
- eth_dev->attached = 0;
+ eth_dev->attached = DEV_DETACHED;
nb_ports--;
return 0;
}
@@ -342,8 +342,7 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
(unsigned) pci_dev->id.device_id);
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
rte_free(eth_dev->data->dev_private);
- eth_dev->attached = DEV_DETACHED;
- nb_ports--;
+ rte_eth_dev_release_port(eth_dev);
return diag;
}
--
2.4.2
next prev parent reply other threads:[~2015-07-19 10:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-19 10:52 [dpdk-dev] [PATCH 0/4] ethdev/eal API fixes Thomas Monjalon
2015-07-19 10:52 ` [dpdk-dev] [PATCH 1/4] doc: rename ABI chapter to deprecation Thomas Monjalon
2015-07-21 13:20 ` Dumitrescu, Cristian
2015-07-21 14:03 ` Thomas Monjalon
2015-07-19 10:52 ` [dpdk-dev] [PATCH 2/4] pci: fix detach and uninit naming Thomas Monjalon
2015-07-19 10:52 ` Thomas Monjalon [this message]
2015-07-19 10:52 ` [dpdk-dev] [PATCH 4/4] ethdev: fix doxygen internal comments Thomas Monjalon
2015-07-19 21:32 ` [dpdk-dev] [PATCH 0/4] ethdev/eal API fixes Thomas Monjalon
2015-07-20 10:45 ` Neil Horman
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=1437303137-29430-4-git-send-email-thomas.monjalon@6wind.com \
--to=thomas.monjalon@6wind.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).