DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
@ 2016-07-04 14:50 Pablo de Lara
  2016-07-05 10:44 ` Declan Doherty
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pablo de Lara @ 2016-07-04 14:50 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, Pablo de Lara

In order to create a virtual device, user needs to call
rte_eal_vdev_init generally, but this function returns 0
on success or negative number if error. Instead, something
more useful would be to return the port or device id of the
device created, so the user can call rte_eal_vdev_init
function and use the device straight away, using the id returned
by the function.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index f502f86..60cc7c7 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -41,3 +41,8 @@ Deprecation Notices
 * The mempool functions for single/multi producer/consumer are deprecated and
   will be removed in 16.11.
   It is replaced by rte_mempool_generic_get/put functions.
+
+* The rte_eal_vdev_init function will be changed in 16.11 to return
+  the port/device id of the device created, instead of 0, when it has been
+  initialized successfully, so user can use the returned value straight away
+  to call all the device functions that require that parameter.
-- 
2.5.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-04 14:50 [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization Pablo de Lara
@ 2016-07-05 10:44 ` Declan Doherty
  2016-07-05 13:04 ` Ferruh Yigit
  2016-07-28 12:18 ` David Marchand
  2 siblings, 0 replies; 10+ messages in thread
From: Declan Doherty @ 2016-07-05 10:44 UTC (permalink / raw)
  To: Pablo de Lara, dev; +Cc: john.mcnamara

On 04/07/16 15:50, Pablo de Lara wrote:
> In order to create a virtual device, user needs to call
> rte_eal_vdev_init generally, but this function returns 0
> on success or negative number if error. Instead, something
> more useful would be to return the port or device id of the
> device created, so the user can call rte_eal_vdev_init
> function and use the device straight away, using the id returned
> by the function.
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index f502f86..60cc7c7 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -41,3 +41,8 @@ Deprecation Notices
>  * The mempool functions for single/multi producer/consumer are deprecated and
>    will be removed in 16.11.
>    It is replaced by rte_mempool_generic_get/put functions.
> +
> +* The rte_eal_vdev_init function will be changed in 16.11 to return
> +  the port/device id of the device created, instead of 0, when it has been
> +  initialized successfully, so user can use the returned value straight away
> +  to call all the device functions that require that parameter.
>

Acked-by: Declan Doherty <declan.doherty@intel.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-04 14:50 [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization Pablo de Lara
  2016-07-05 10:44 ` Declan Doherty
@ 2016-07-05 13:04 ` Ferruh Yigit
  2016-07-05 13:38   ` Thomas Monjalon
  2016-07-28 12:18 ` David Marchand
  2 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2016-07-05 13:04 UTC (permalink / raw)
  To: Pablo de Lara, dev; +Cc: john.mcnamara

On 7/4/2016 3:50 PM, Pablo de Lara wrote:
> In order to create a virtual device, user needs to call
> rte_eal_vdev_init generally, but this function returns 0
> on success or negative number if error. Instead, something
> more useful would be to return the port or device id of the
> device created, so the user can call rte_eal_vdev_init
> function and use the device straight away, using the id returned
> by the function.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index f502f86..60cc7c7 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -41,3 +41,8 @@ Deprecation Notices
>  * The mempool functions for single/multi producer/consumer are deprecated and
>    will be removed in 16.11.
>    It is replaced by rte_mempool_generic_get/put functions.
> +
> +* The rte_eal_vdev_init function will be changed in 16.11 to return
> +  the port/device id of the device created, instead of 0, when it has been
> +  initialized successfully, so user can use the returned value straight away
> +  to call all the device functions that require that parameter.
> 

Hi Pablo,

There is another API rte_eth_dev_attach(), which returns port_id, and is
a common wrapper both for pdev and vdev.
So with proper devargs this API calls rte_eal_vdev_init() and returns
port_id (set in argument) without any extra side effect.

I just would like remind it in case that works for you, since what
rte_eth_dev_attach() does sounds like what is targeted with this API change.

Thanks,
ferruh

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-05 13:04 ` Ferruh Yigit
@ 2016-07-05 13:38   ` Thomas Monjalon
  2016-07-05 14:55     ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2016-07-05 13:38 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Pablo de Lara, john.mcnamara

2016-07-05 14:04, Ferruh Yigit:
> On 7/4/2016 3:50 PM, Pablo de Lara wrote:
> > +* The rte_eal_vdev_init function will be changed in 16.11 to return
> > +  the port/device id of the device created, instead of 0, when it has been
> > +  initialized successfully, so user can use the returned value straight away
> > +  to call all the device functions that require that parameter.
> 
> There is another API rte_eth_dev_attach(), which returns port_id, and is
> a common wrapper both for pdev and vdev.
> So with proper devargs this API calls rte_eal_vdev_init() and returns
> port_id (set in argument) without any extra side effect.

I think rte_eth_dev_attach() should be removed from ethdev.
Hotplugging a device belongs to device management, i.e. EAL.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-05 13:38   ` Thomas Monjalon
@ 2016-07-05 14:55     ` De Lara Guarch, Pablo
  2016-07-06 10:59       ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 10+ messages in thread
From: De Lara Guarch, Pablo @ 2016-07-05 14:55 UTC (permalink / raw)
  To: Thomas Monjalon, Yigit, Ferruh; +Cc: dev, Mcnamara, John



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, July 05, 2016 2:39 PM
> To: Yigit, Ferruh
> Cc: dev@dpdk.org; De Lara Guarch, Pablo; Mcnamara, John
> Subject: Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device
> initialization
> 
> 2016-07-05 14:04, Ferruh Yigit:
> > On 7/4/2016 3:50 PM, Pablo de Lara wrote:
> > > +* The rte_eal_vdev_init function will be changed in 16.11 to return
> > > +  the port/device id of the device created, instead of 0, when it has been
> > > +  initialized successfully, so user can use the returned value straight away
> > > +  to call all the device functions that require that parameter.
> >
> > There is another API rte_eth_dev_attach(), which returns port_id, and is
> > a common wrapper both for pdev and vdev.
> > So with proper devargs this API calls rte_eal_vdev_init() and returns
> > port_id (set in argument) without any extra side effect.
> 
> I think rte_eth_dev_attach() should be removed from ethdev.
> Hotplugging a device belongs to device management, i.e. EAL.

Even though rte_eth_dev_attach returns the port id, I think that rte_eal_vdev_init
can return the port id anyway (and then, we can remove the call to rte_eth_dev_get_port_by_name
 in rte_eth_dev_attach). 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-05 14:55     ` De Lara Guarch, Pablo
@ 2016-07-06 10:59       ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 10+ messages in thread
From: De Lara Guarch, Pablo @ 2016-07-06 10:59 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Thomas Monjalon, Yigit, Ferruh; +Cc: dev, Mcnamara, John



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Tuesday, July 05, 2016 3:55 PM
> To: Thomas Monjalon; Yigit, Ferruh
> Cc: dev@dpdk.org; Mcnamara, John
> Subject: Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device
> initialization
> 
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > Sent: Tuesday, July 05, 2016 2:39 PM
> > To: Yigit, Ferruh
> > Cc: dev@dpdk.org; De Lara Guarch, Pablo; Mcnamara, John
> > Subject: Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device
> > initialization
> >
> > 2016-07-05 14:04, Ferruh Yigit:
> > > On 7/4/2016 3:50 PM, Pablo de Lara wrote:
> > > > +* The rte_eal_vdev_init function will be changed in 16.11 to return
> > > > +  the port/device id of the device created, instead of 0, when it has
> been
> > > > +  initialized successfully, so user can use the returned value straight
> away
> > > > +  to call all the device functions that require that parameter.
> > >
> > > There is another API rte_eth_dev_attach(), which returns port_id, and is
> > > a common wrapper both for pdev and vdev.
> > > So with proper devargs this API calls rte_eal_vdev_init() and returns
> > > port_id (set in argument) without any extra side effect.
> >
> > I think rte_eth_dev_attach() should be removed from ethdev.
> > Hotplugging a device belongs to device management, i.e. EAL.
> 
> Even though rte_eth_dev_attach returns the port id, I think that
> rte_eal_vdev_init
> can return the port id anyway (and then, we can remove the call to
> rte_eth_dev_get_port_by_name
>  in rte_eth_dev_attach).

Also, that function is only applicable to Ethernet devices,
so other devices like Crypto devices cannot be used.
If we want to use that function for all devices, we should move it to eal,
modify it slightly and rename it, and therefore, we will need
a deprecation notice as well.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-04 14:50 [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization Pablo de Lara
  2016-07-05 10:44 ` Declan Doherty
  2016-07-05 13:04 ` Ferruh Yigit
@ 2016-07-28 12:18 ` David Marchand
  2016-07-28 15:47   ` De Lara Guarch, Pablo
  2 siblings, 1 reply; 10+ messages in thread
From: David Marchand @ 2016-07-28 12:18 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, Mcnamara, John

Hello Pablo,

On Mon, Jul 4, 2016 at 4:50 PM, Pablo de Lara
<pablo.de.lara.guarch@intel.com> wrote:
> In order to create a virtual device, user needs to call
> rte_eal_vdev_init generally, but this function returns 0
> on success or negative number if error. Instead, something
> more useful would be to return the port or device id of the
> device created, so the user can call rte_eal_vdev_init
> function and use the device straight away, using the id returned
> by the function.
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index f502f86..60cc7c7 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -41,3 +41,8 @@ Deprecation Notices
>  * The mempool functions for single/multi producer/consumer are deprecated and
>    will be removed in 16.11.
>    It is replaced by rte_mempool_generic_get/put functions.
> +
> +* The rte_eal_vdev_init function will be changed in 16.11 to return
> +  the port/device id of the device created, instead of 0, when it has been
> +  initialized successfully, so user can use the returned value straight away
> +  to call all the device functions that require that parameter.
> --
> 2.5.0
>

This is a layer violation.
EAL does not know a thing about "ports".

This information should come from the crypto framework and so an api
in crypto framework is the right place, not EAL.

This is a NACK for me.


-- 
David Marchand

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-28 12:18 ` David Marchand
@ 2016-07-28 15:47   ` De Lara Guarch, Pablo
  2016-07-28 15:56     ` David Marchand
  2016-07-29 17:35     ` Andriy Berestovskyy
  0 siblings, 2 replies; 10+ messages in thread
From: De Lara Guarch, Pablo @ 2016-07-28 15:47 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Mcnamara, John



> -----Original Message-----
> From: David Marchand [mailto:david.marchand@6wind.com]
> Sent: Thursday, July 28, 2016 5:18 AM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Mcnamara, John
> Subject: Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device
> initialization
> 
> Hello Pablo,
> 
> On Mon, Jul 4, 2016 at 4:50 PM, Pablo de Lara
> <pablo.de.lara.guarch@intel.com> wrote:
> > In order to create a virtual device, user needs to call
> > rte_eal_vdev_init generally, but this function returns 0
> > on success or negative number if error. Instead, something
> > more useful would be to return the port or device id of the
> > device created, so the user can call rte_eal_vdev_init
> > function and use the device straight away, using the id returned
> > by the function.
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > ---
> >  doc/guides/rel_notes/deprecation.rst | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/deprecation.rst
> b/doc/guides/rel_notes/deprecation.rst
> > index f502f86..60cc7c7 100644
> > --- a/doc/guides/rel_notes/deprecation.rst
> > +++ b/doc/guides/rel_notes/deprecation.rst
> > @@ -41,3 +41,8 @@ Deprecation Notices
> >  * The mempool functions for single/multi producer/consumer are
> deprecated and
> >    will be removed in 16.11.
> >    It is replaced by rte_mempool_generic_get/put functions.
> > +
> > +* The rte_eal_vdev_init function will be changed in 16.11 to return
> > +  the port/device id of the device created, instead of 0, when it has been
> > +  initialized successfully, so user can use the returned value straight away
> > +  to call all the device functions that require that parameter.
> > --
> > 2.5.0
> >
> 
> This is a layer violation.
> EAL does not know a thing about "ports".
> 
> This information should come from the crypto framework and so an api
> in crypto framework is the right place, not EAL.
> 
> This is a NACK for me.

Fair enough. So you mean to use rte_eth_dev_attach in ethdev library and
a similar function in cryptodev library?

Thanks,
Pablo
> 
> 
> --
> David Marchand

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-28 15:47   ` De Lara Guarch, Pablo
@ 2016-07-28 15:56     ` David Marchand
  2016-07-29 17:35     ` Andriy Berestovskyy
  1 sibling, 0 replies; 10+ messages in thread
From: David Marchand @ 2016-07-28 15:56 UTC (permalink / raw)
  To: De Lara Guarch, Pablo; +Cc: dev, Mcnamara, John

On Thu, Jul 28, 2016 at 5:47 PM, De Lara Guarch, Pablo
<pablo.de.lara.guarch@intel.com> wrote:
>> This is a layer violation.
>> EAL does not know a thing about "ports".
>>
>> This information should come from the crypto framework and so an api
>> in crypto framework is the right place, not EAL.
>>
>> This is a NACK for me.
>
> Fair enough. So you mean to use rte_eth_dev_attach in ethdev library and
> a similar function in cryptodev library?

Yes, and/or wait that the rework in ethdev/eal hotplug has taken place
and mirror this in crypto.


-- 
David Marchand

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization
  2016-07-28 15:47   ` De Lara Guarch, Pablo
  2016-07-28 15:56     ` David Marchand
@ 2016-07-29 17:35     ` Andriy Berestovskyy
  1 sibling, 0 replies; 10+ messages in thread
From: Andriy Berestovskyy @ 2016-07-29 17:35 UTC (permalink / raw)
  To: De Lara Guarch, Pablo; +Cc: David Marchand, dev, Mcnamara, John

Hey folks,

> On 28 Jul 2016, at 17:47, De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com> wrote:
> Fair enough. So you mean to use rte_eth_dev_attach in ethdev library and
> a similar function in cryptodev library?

There is a rte_eth_dev_get_port_by_name() which gets the port id right after the rte_eal_vdev_init() call. You might consider the same for the crypto...

Regards,
Andriy

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-07-29 17:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04 14:50 [dpdk-dev] [PATCH] doc: announce API change for virtual device initialization Pablo de Lara
2016-07-05 10:44 ` Declan Doherty
2016-07-05 13:04 ` Ferruh Yigit
2016-07-05 13:38   ` Thomas Monjalon
2016-07-05 14:55     ` De Lara Guarch, Pablo
2016-07-06 10:59       ` De Lara Guarch, Pablo
2016-07-28 12:18 ` David Marchand
2016-07-28 15:47   ` De Lara Guarch, Pablo
2016-07-28 15:56     ` David Marchand
2016-07-29 17:35     ` Andriy Berestovskyy

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