DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
To: Jan Blunck <jblunck@infradead.org>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference
Date: Tue, 11 Jul 2017 21:09:07 +0200	[thread overview]
Message-ID: <20170711190907.GX11154@bidouze.vm.6wind.com> (raw)
In-Reply-To: <20170711185649.43620-3-jblunck@infradead.org>

Hi Jan,

On Tue, Jul 11, 2017 at 02:56:49PM -0400, Jan Blunck wrote:
> 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..db69d18c6 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_bus_find_by_name(rte_vdev_bus.name);

Why not directly &rte_vdev_bus here?

>  	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
> 

-- 
Gaëtan Rivet
6WIND

  reply	other threads:[~2017-07-11 19:09 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 [this message]
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   ` [dpdk-dev] [PATCH v2 2/3] vdev: directly use rte_bus reference Jan Blunck
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=20170711190907.GX11154@bidouze.vm.6wind.com \
    --to=gaetan.rivet@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jblunck@infradead.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).