* [dpdk-dev] [PATCH 0/2] vdev patches for -rc2 @ 2017-07-11 18:56 Jan Blunck 2017-07-11 18:56 ` [dpdk-dev] [PATCH 1/2] vdev: get name from embedded device Jan Blunck ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 18:56 UTC (permalink / raw) To: dev Two trivial vdev patches for -rc2. Please review and apply. Jan Blunck (2): vdev: get name from embedded device vdev: directly use rte_bus reference lib/librte_eal/common/eal_common_vdev.c | 9 +++++---- lib/librte_eal/common/include/rte_vdev.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) -- 2.13.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH 1/2] vdev: get name from embedded device 2017-07-11 18:56 [dpdk-dev] [PATCH 0/2] vdev patches for -rc2 Jan Blunck @ 2017-07-11 18:56 ` Jan Blunck 2017-07-11 18:56 ` [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference Jan Blunck 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Jan Blunck 2 siblings, 0 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 18:56 UTC (permalink / raw) To: dev Instead of getting the name from the devargs lets take it from the rte_device. Signed-off-by: Jan Blunck <jblunck@infradead.org> --- lib/librte_eal/common/include/rte_vdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 3c07b76a0..fc24298f2 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -49,8 +49,8 @@ struct rte_vdev_device { static inline const char * rte_vdev_device_name(const struct rte_vdev_device *dev) { - if (dev && dev->device.devargs) - return dev->device.devargs->name; + if (dev && dev->device.name) + return dev->device.name; return NULL; } -- 2.13.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference 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 ` Jan Blunck 2017-07-11 19:09 ` Gaëtan Rivet 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Jan Blunck 2 siblings, 1 reply; 11+ messages in thread From: Jan Blunck @ 2017-07-11 18:56 UTC (permalink / raw) To: dev 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); 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference 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 0 siblings, 1 reply; 11+ messages in thread From: Gaëtan Rivet @ 2017-07-11 19:09 UTC (permalink / raw) To: Jan Blunck; +Cc: dev 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] vdev: directly use rte_bus reference 2017-07-11 19:09 ` Gaëtan Rivet @ 2017-07-11 19:43 ` Jan Blunck 0 siblings, 0 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 19:43 UTC (permalink / raw) To: Gaëtan Rivet; +Cc: dev 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 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 23:15 ` Jan Blunck 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 1/3] vdev: get name from embedded device Jan Blunck ` (3 more replies) 2 siblings, 4 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 23:15 UTC (permalink / raw) To: dev Three trivial vdev patches for -rc2. Please review and apply. Changes since v0: - Fix review comments by Gaetan Jan Blunck (3): vdev: get name from embedded device vdev: directly use rte_bus reference vdev: allocate empty str args lib/librte_eal/common/eal_common_vdev.c | 11 +++++++---- lib/librte_eal/common/include/rte_vdev.h | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) -- 2.13.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH v2 1/3] vdev: get name from embedded device 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Jan Blunck @ 2017-07-11 23:15 ` Jan Blunck 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 2/3] vdev: directly use rte_bus reference Jan Blunck ` (2 subsequent siblings) 3 siblings, 0 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 23:15 UTC (permalink / raw) To: dev Instead of getting the name from the devargs lets take it from the rte_device. Signed-off-by: Jan Blunck <jblunck@infradead.org> --- lib/librte_eal/common/include/rte_vdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 3c07b76a0..fc24298f2 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -49,8 +49,8 @@ struct rte_vdev_device { static inline const char * rte_vdev_device_name(const struct rte_vdev_device *dev) { - if (dev && dev->device.devargs) - return dev->device.devargs->name; + if (dev && dev->device.name) + return dev->device.name; return NULL; } -- 2.13.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH v2 2/3] vdev: directly use rte_bus reference 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 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 3 siblings, 0 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 23:15 UTC (permalink / raw) To: dev 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [dpdk-dev] [PATCH v2 3/3] vdev: allocate empty str args 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 ` Jan Blunck 2017-07-12 8:05 ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Gaëtan Rivet 3 siblings, 0 replies; 11+ messages in thread From: Jan Blunck @ 2017-07-11 23:15 UTC (permalink / raw) To: dev Signed-off-by: Jan Blunck <jblunck@infradead.org> --- lib/librte_eal/common/eal_common_vdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 5abdba091..e00dda9aa 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -144,6 +144,8 @@ alloc_devargs(const char *name, const char *args) devargs->bus = &rte_vdev_bus; if (args) devargs->args = strdup(args); + else + devargs->args = strdup(""); ret = snprintf(devargs->name, sizeof(devargs->name), "%s", name); if (ret < 0 || ret >= (int)sizeof(devargs->name)) { -- 2.13.2 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 Jan Blunck ` (2 preceding siblings ...) 2017-07-11 23:15 ` [dpdk-dev] [PATCH v2 3/3] vdev: allocate empty str args Jan Blunck @ 2017-07-12 8:05 ` Gaëtan Rivet 2017-07-12 12:18 ` Thomas Monjalon 3 siblings, 1 reply; 11+ messages in thread From: Gaëtan Rivet @ 2017-07-12 8:05 UTC (permalink / raw) To: Jan Blunck; +Cc: dev On Tue, Jul 11, 2017 at 07:15:45PM -0400, Jan Blunck wrote: > Three trivial vdev patches for -rc2. Please review and apply. > For the series: Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> > Changes since v0: > - Fix review comments by Gaetan > > Jan Blunck (3): > vdev: get name from embedded device > vdev: directly use rte_bus reference > vdev: allocate empty str args > > lib/librte_eal/common/eal_common_vdev.c | 11 +++++++---- > lib/librte_eal/common/include/rte_vdev.h | 4 ++-- > 2 files changed, 9 insertions(+), 6 deletions(-) > > -- > 2.13.2 > -- Gaëtan Rivet 6WIND ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/3] vdev patches for -rc2 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 0 siblings, 0 replies; 11+ messages in thread From: Thomas Monjalon @ 2017-07-12 12:18 UTC (permalink / raw) To: Jan Blunck; +Cc: dev, Gaëtan Rivet 12/07/2017 10:05, Gaëtan Rivet: > On Tue, Jul 11, 2017 at 07:15:45PM -0400, Jan Blunck wrote: > > Three trivial vdev patches for -rc2. Please review and apply. > > > > For the series: > Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> Applied, thanks ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-07-12 12:18 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 ` [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
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).