DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jan Blunck <jblunck@infradead.org>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/3] vdev: directly use rte_bus reference
Date: Tue, 11 Jul 2017 19:15:47 -0400	[thread overview]
Message-ID: <20170711231548.54293-3-jblunck@infradead.org> (raw)
In-Reply-To: <20170711231548.54293-1-jblunck@infradead.org>

It isn't necessary to use rte_bus_find_by_name() to find a reference to
our own bus.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 lib/librte_eal/common/eal_common_vdev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c
index 2ca0cdb0f..5abdba091 100644
--- a/lib/librte_eal/common/eal_common_vdev.c
+++ b/lib/librte_eal/common/eal_common_vdev.c
@@ -47,6 +47,9 @@
 #include <rte_memory.h>
 #include <rte_errno.h>
 
+/* Forward declare to access virtual bus name */
+static struct rte_bus rte_vdev_bus;
+
 /** Double linked list of virtual device drivers. */
 TAILQ_HEAD(vdev_device_list, rte_vdev_device);
 
@@ -138,7 +141,7 @@ alloc_devargs(const char *name, const char *args)
 	if (!devargs)
 		return NULL;
 
-	devargs->bus = rte_bus_find_by_name("vdev");
+	devargs->bus = &rte_vdev_bus;
 	if (args)
 		devargs->args = strdup(args);
 
@@ -250,13 +253,11 @@ vdev_scan(void)
 {
 	struct rte_vdev_device *dev;
 	struct rte_devargs *devargs;
-	struct rte_bus *vbus;
 
 	/* for virtual devices we scan the devargs_list populated via cmdline */
-	vbus = rte_bus_find_by_name("vdev");
 	TAILQ_FOREACH(devargs, &devargs_list, next) {
 
-		if (devargs->bus != vbus)
+		if (devargs->bus != &rte_vdev_bus)
 			continue;
 
 		dev = find_vdev(devargs->name);
-- 
2.13.2

  parent reply	other threads:[~2017-07-11 23:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 18:56 [dpdk-dev] [PATCH 0/2] vdev patches for -rc2 Jan Blunck
2017-07-11 18:56 ` [dpdk-dev] [PATCH 1/2] vdev: get name from embedded device Jan Blunck
2017-07-11 18:56 ` [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference Jan Blunck
2017-07-11 19:09   ` Gaëtan Rivet
2017-07-11 19:43     ` Jan Blunck
2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Jan Blunck
2017-07-11 23:15   ` [dpdk-dev] [PATCH v2 1/3] vdev: get name from embedded device Jan Blunck
2017-07-11 23:15   ` Jan Blunck [this message]
2017-07-11 23:15   ` [dpdk-dev] [PATCH v2 3/3] vdev: allocate empty str args Jan Blunck
2017-07-12  8:05   ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Gaëtan Rivet
2017-07-12 12:18     ` Thomas Monjalon

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=20170711231548.54293-3-jblunck@infradead.org \
    --to=jblunck@infradead.org \
    --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).