From: Jan Blunck <jblunck@infradead.org>
To: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference
Date: Tue, 11 Jul 2017 15:43:46 -0400 [thread overview]
Message-ID: <CALe+Z00z=L2+aULzR-pdMzoOBzFP41VEXb8KTf+M60k4nz75NA@mail.gmail.com> (raw)
In-Reply-To: <20170711190907.GX11154@bidouze.vm.6wind.com>
On Tue, Jul 11, 2017 at 3:09 PM, Gaëtan Rivet <gaetan.rivet@6wind.com> wrote:
> 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?
>
Thanks, will fix.
>> 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
next prev parent reply other threads:[~2017-07-11 19:43 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 [this message]
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='CALe+Z00z=L2+aULzR-pdMzoOBzFP41VEXb8KTf+M60k4nz75NA@mail.gmail.com' \
--to=jblunck@infradead.org \
--cc=dev@dpdk.org \
--cc=gaetan.rivet@6wind.com \
/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).