diff mbox series

ethdev: add missing buses in dev iterator

Message ID 20210429055548.12964-1-hemant.agrawal@nxp.com
State Accepted
Commit a956adb2817cac30c47c07855eb265f283bffde0
Headers show
Series ethdev: add missing buses in dev iterator | expand

Commit Message

Hemant Agrawal April 29, 2021, 5:55 a.m. UTC
This patch fixes issue with OVS 2.15 not working on
DPAA/FSLMC based platform due to missing support for
these busses in dev_iterate.
This patch adds dpaa_bus and fslmc to dev iterator
for bus arguments.

Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 lib/ethdev/rte_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.17.1

Comments

Thomas Monjalon April 29, 2021, 7:56 a.m. UTC | #1
29/04/2021 07:55, Hemant Agrawal:
> This patch fixes issue with OVS 2.15 not working on

> DPAA/FSLMC based platform due to missing support for

> these busses in dev_iterate.

> This patch adds dpaa_bus and fslmc to dev iterator

> for bus arguments.


I think we should add VMBus as well.
Hemant Agrawal April 29, 2021, 8:01 a.m. UTC | #2
On 4/29/2021 1:26 PM, Thomas Monjalon wrote:
> 29/04/2021 07:55, Hemant Agrawal:

>> This patch fixes issue with OVS 2.15 not working on

>> DPAA/FSLMC based platform due to missing support for

>> these busses in dev_iterate.

>> This patch adds dpaa_bus and fslmc to dev iterator

>> for bus arguments.

> I think we should add VMBus as well.

They are 2 buses remaining vmbus and ifpga. However I don't know, if 
they use args as vdev or as pci?
>
Morten Brørup April 29, 2021, 1:53 p.m. UTC | #3
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal

> Sent: Thursday, April 29, 2021 7:56 AM

> 

> This patch fixes issue with OVS 2.15 not working on

> DPAA/FSLMC based platform due to missing support for

> these busses in dev_iterate.

> This patch adds dpaa_bus and fslmc to dev iterator

> for bus arguments.

> 

> Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---

>  lib/ethdev/rte_ethdev.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

> 

> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c

> index a1879765e8..483013ec7a 100644

> --- a/lib/ethdev/rte_ethdev.c

> +++ b/lib/ethdev/rte_ethdev.c

> @@ -260,7 +260,9 @@ rte_eth_iterator_init(struct rte_dev_iterator

> *iter, const char *devargs_str)

>  	}

> 

>  	/* Convert bus args to new syntax for use with new API

> dev_iterate. */

> -	if (strcmp(iter->bus->name, "vdev") == 0) {

> +	if ((strcmp(iter->bus->name, "vdev") == 0) ||

> +		(strcmp(iter->bus->name, "fslmc") == 0) ||

> +		(strcmp(iter->bus->name, "dpaa_bus") == 0)) {


Shouldn't that be "dpaa" instead of "dpaa_bus"?

>  		bus_param_key = "name";

>  	} else if (strcmp(iter->bus->name, "pci") == 0) {

>  		bus_param_key = "addr";

> --

> 2.17.1

>
Hemant Agrawal April 29, 2021, 1:57 p.m. UTC | #4
On 4/29/2021 7:23 PM, Morten Brørup wrote:
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal

>> Sent: Thursday, April 29, 2021 7:56 AM

>>

>> This patch fixes issue with OVS 2.15 not working on

>> DPAA/FSLMC based platform due to missing support for

>> these busses in dev_iterate.

>> This patch adds dpaa_bus and fslmc to dev iterator

>> for bus arguments.

>>

>> Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input")

>> Cc: stable@dpdk.org

>>

>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

>> ---

>>   lib/ethdev/rte_ethdev.c | 4 +++-

>>   1 file changed, 3 insertions(+), 1 deletion(-)

>>

>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c

>> index a1879765e8..483013ec7a 100644

>> --- a/lib/ethdev/rte_ethdev.c

>> +++ b/lib/ethdev/rte_ethdev.c

>> @@ -260,7 +260,9 @@ rte_eth_iterator_init(struct rte_dev_iterator

>> *iter, const char *devargs_str)

>>   	}

>>

>>   	/* Convert bus args to new syntax for use with new API

>> dev_iterate. */

>> -	if (strcmp(iter->bus->name, "vdev") == 0) {

>> +	if ((strcmp(iter->bus->name, "vdev") == 0) ||

>> +		(strcmp(iter->bus->name, "fslmc") == 0) ||

>> +		(strcmp(iter->bus->name, "dpaa_bus") == 0)) {

> Shouldn't that be "dpaa" instead of "dpaa_bus"?

The registered bus name is "dpaa_bus" only.
>

>>   		bus_param_key = "name";

>>   	} else if (strcmp(iter->bus->name, "pci") == 0) {

>>   		bus_param_key = "addr";

>> --

>> 2.17.1

>>
Morten Brørup April 29, 2021, 2:01 p.m. UTC | #5
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal

> Sent: Thursday, April 29, 2021 3:57 PM

> 

> On 4/29/2021 7:23 PM, Morten Brørup wrote:

> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal

> >> Sent: Thursday, April 29, 2021 7:56 AM

> >>

> >> This patch fixes issue with OVS 2.15 not working on

> >> DPAA/FSLMC based platform due to missing support for

> >> these busses in dev_iterate.

> >> This patch adds dpaa_bus and fslmc to dev iterator

> >> for bus arguments.

> >>

> >> Fixes: 214ed1acd125 ("ethdev: add iterator to match devargs input")

> >> Cc: stable@dpdk.org

> >>

> >> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> >> ---

> >>   lib/ethdev/rte_ethdev.c | 4 +++-

> >>   1 file changed, 3 insertions(+), 1 deletion(-)

> >>

> >> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c

> >> index a1879765e8..483013ec7a 100644

> >> --- a/lib/ethdev/rte_ethdev.c

> >> +++ b/lib/ethdev/rte_ethdev.c

> >> @@ -260,7 +260,9 @@ rte_eth_iterator_init(struct rte_dev_iterator

> >> *iter, const char *devargs_str)

> >>   	}

> >>

> >>   	/* Convert bus args to new syntax for use with new API

> >> dev_iterate. */

> >> -	if (strcmp(iter->bus->name, "vdev") == 0) {

> >> +	if ((strcmp(iter->bus->name, "vdev") == 0) ||

> >> +		(strcmp(iter->bus->name, "fslmc") == 0) ||

> >> +		(strcmp(iter->bus->name, "dpaa_bus") == 0)) {

> > Shouldn't that be "dpaa" instead of "dpaa_bus"?

> The registered bus name is "dpaa_bus" only.


OK. Then it obviously has to match.
Ferruh Yigit May 4, 2021, 12:49 p.m. UTC | #6
On 4/29/2021 9:01 AM, Hemant Agrawal wrote:
> 

> On 4/29/2021 1:26 PM, Thomas Monjalon wrote:

>> 29/04/2021 07:55, Hemant Agrawal:

>>> This patch fixes issue with OVS 2.15 not working on

>>> DPAA/FSLMC based platform due to missing support for

>>> these busses in dev_iterate.

>>> This patch adds dpaa_bus and fslmc to dev iterator

>>> for bus arguments.

>> I think we should add VMBus as well.

> They are 2 buses remaining vmbus and ifpga. However I don't know, if they use

> args as vdev or as pci?


cc Rosen for the 'ifpga' bus, 'vmbus' maintainer seems already cc'ed.

This variable ('bus_param_key') is used to construct 'bus_str', and 'bus_str'
seems used only for the '.dev_iterate' bus operation.

Since 'ifpga' & 'vmbus' are not implementing the '.dev_iterate', so is it really
required to add them?
Thomas Monjalon May 4, 2021, 3:50 p.m. UTC | #7
04/05/2021 14:49, Ferruh Yigit:
> On 4/29/2021 9:01 AM, Hemant Agrawal wrote:

> > 

> > On 4/29/2021 1:26 PM, Thomas Monjalon wrote:

> >> 29/04/2021 07:55, Hemant Agrawal:

> >>> This patch fixes issue with OVS 2.15 not working on

> >>> DPAA/FSLMC based platform due to missing support for

> >>> these busses in dev_iterate.

> >>> This patch adds dpaa_bus and fslmc to dev iterator

> >>> for bus arguments.

> >> I think we should add VMBus as well.

> > They are 2 buses remaining vmbus and ifpga. However I don't know, if they use

> > args as vdev or as pci?

> 

> cc Rosen for the 'ifpga' bus, 'vmbus' maintainer seems already cc'ed.

> 

> This variable ('bus_param_key') is used to construct 'bus_str', and 'bus_str'

> seems used only for the '.dev_iterate' bus operation.

> 

> Since 'ifpga' & 'vmbus' are not implementing the '.dev_iterate', so is it really

> required to add them?


Good point Ferruh.

The only bus implementing dev_iterate are dpaa, fslmc, pci and vdev.
So this patch makes sense.

Acked-by: Thomas Monjalon <thomas@monjalon.net>
Ferruh Yigit May 4, 2021, 4:34 p.m. UTC | #8
On 5/4/2021 4:50 PM, Thomas Monjalon wrote:
> 04/05/2021 14:49, Ferruh Yigit:

>> On 4/29/2021 9:01 AM, Hemant Agrawal wrote:

>>>

>>> On 4/29/2021 1:26 PM, Thomas Monjalon wrote:

>>>> 29/04/2021 07:55, Hemant Agrawal:

>>>>> This patch fixes issue with OVS 2.15 not working on

>>>>> DPAA/FSLMC based platform due to missing support for

>>>>> these busses in dev_iterate.

>>>>> This patch adds dpaa_bus and fslmc to dev iterator

>>>>> for bus arguments.

>>>> I think we should add VMBus as well.

>>> They are 2 buses remaining vmbus and ifpga. However I don't know, if they use

>>> args as vdev or as pci?

>>

>> cc Rosen for the 'ifpga' bus, 'vmbus' maintainer seems already cc'ed.

>>

>> This variable ('bus_param_key') is used to construct 'bus_str', and 'bus_str'

>> seems used only for the '.dev_iterate' bus operation.

>>

>> Since 'ifpga' & 'vmbus' are not implementing the '.dev_iterate', so is it really

>> required to add them?

> 

> Good point Ferruh.

> 

> The only bus implementing dev_iterate are dpaa, fslmc, pci and vdev.

> So this patch makes sense.

> 

> Acked-by: Thomas Monjalon <thomas@monjalon.net>

> 


Applied to dpdk-next-net/main, thanks.
Xu, Rosen May 5, 2021, 2:39 p.m. UTC | #9
Hi Thomas and Ferruh,

I just back from my Labor Day Holiday. I have checked there is no usage in ifpga bus.

Thanks,
Rosen

> -----Original Message-----

> From: Thomas Monjalon <thomas@monjalon.net>

> Sent: Tuesday, May 04, 2021 23:50

> To: hemant.agrawal@nxp.com; Yigit, Ferruh <ferruh.yigit@intel.com>

> Cc: dev@dpdk.org; stable@dpdk.org; stephen@networkplumber.org;

> longli@microsoft.com; Xu, Rosen <rosen.xu@intel.com>

> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] ethdev: add missing buses in

> dev iterator

> 

> 04/05/2021 14:49, Ferruh Yigit:

> > On 4/29/2021 9:01 AM, Hemant Agrawal wrote:

> > >

> > > On 4/29/2021 1:26 PM, Thomas Monjalon wrote:

> > >> 29/04/2021 07:55, Hemant Agrawal:

> > >>> This patch fixes issue with OVS 2.15 not working on DPAA/FSLMC

> > >>> based platform due to missing support for these busses in

> > >>> dev_iterate.

> > >>> This patch adds dpaa_bus and fslmc to dev iterator for bus

> > >>> arguments.

> > >> I think we should add VMBus as well.

> > > They are 2 buses remaining vmbus and ifpga. However I don't know, if

> > > they use args as vdev or as pci?

> >

> > cc Rosen for the 'ifpga' bus, 'vmbus' maintainer seems already cc'ed.

> >

> > This variable ('bus_param_key') is used to construct 'bus_str', and 'bus_str'

> > seems used only for the '.dev_iterate' bus operation.

> >

> > Since 'ifpga' & 'vmbus' are not implementing the '.dev_iterate', so is

> > it really required to add them?

> 

> Good point Ferruh.

> 

> The only bus implementing dev_iterate are dpaa, fslmc, pci and vdev.

> So this patch makes sense.

> 

> Acked-by: Thomas Monjalon <thomas@monjalon.net>

>
diff mbox series

Patch

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index a1879765e8..483013ec7a 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -260,7 +260,9 @@  rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)
 	}
 
 	/* Convert bus args to new syntax for use with new API dev_iterate. */
-	if (strcmp(iter->bus->name, "vdev") == 0) {
+	if ((strcmp(iter->bus->name, "vdev") == 0) ||
+		(strcmp(iter->bus->name, "fslmc") == 0) ||
+		(strcmp(iter->bus->name, "dpaa_bus") == 0)) {
 		bus_param_key = "name";
 	} else if (strcmp(iter->bus->name, "pci") == 0) {
 		bus_param_key = "addr";