diff mbox series

[v2,1/2] common/mlx5: support device global syntax

Message ID 1610983607-7969-2-git-send-email-xuemingl@nvidia.com (mailing list archive)
State Deferred
Delegated to: Raslan Darawsheh
Headers show
Series mlx5: support global device syntax | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Xueming(Steven) Li Jan. 18, 2021, 3:26 p.m. UTC
This patch supports new device global device syntax, resolve class type
from "class" section if the devarg is global device syntax:
bus=<bus>,k=v,,,/class=<cls>,k=v,,,/driver=<pmd>,k=v,,,,

To reuse class name of global device syntax, this patch also changes
internal class name introduced by commit [1] to algin with RTE class
name.

[1]
8a41f4deccc3: common/mlx5: introduce layer for multiple class drivers

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
 drivers/common/mlx5/mlx5_common_pci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Viacheslav Ovsiienko April 5, 2021, 10:54 a.m. UTC | #1
> -----Original Message-----
> From: Xueming Li <xuemingl@nvidia.com>
> Sent: Monday, January 18, 2021 17:27
> To: Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> Asaf Penso <asafp@nvidia.com>
> Subject: [PATCH v2 1/2] common/mlx5: support device global syntax
> 
> This patch supports new device global device syntax, resolve class type from
> "class" section if the devarg is global device syntax:
> bus=<bus>,k=v,,,/class=<cls>,k=v,,,/driver=<pmd>,k=v,,,,
> 
> To reuse class name of global device syntax, this patch also changes internal
> class name introduced by commit [1] to algin with RTE class name.
Typo: algin -> align

Beside this:
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


> 
> [1]
> 8a41f4deccc3: common/mlx5: introduce layer for multiple class drivers
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> ---
>  drivers/common/mlx5/mlx5_common_pci.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/common/mlx5/mlx5_common_pci.c
> b/drivers/common/mlx5/mlx5_common_pci.c
> index 5208972bb6..c03bdbf4eb 100644
> --- a/drivers/common/mlx5/mlx5_common_pci.c
> +++ b/drivers/common/mlx5/mlx5_common_pci.c
> @@ -4,6 +4,7 @@
> 
>  #include <stdlib.h>
>  #include <rte_malloc.h>
> +#include <rte_class.h>
>  #include "mlx5_common_utils.h"
>  #include "mlx5_common_pci.h"
> 
> @@ -26,7 +27,7 @@ static const struct {
>  	unsigned int driver_class;
>  } mlx5_classes[] = {
>  	{ .name = "vdpa", .driver_class = MLX5_CLASS_VDPA },
> -	{ .name = "net", .driver_class = MLX5_CLASS_NET },
> +	{ .name = "eth", .driver_class = MLX5_CLASS_NET },
>  	{ .name = "regex", .driver_class = MLX5_CLASS_REGEX },  };
> 
> @@ -115,6 +116,9 @@ parse_class_options(const struct rte_devargs
> *devargs)
> 
>  	if (devargs == NULL)
>  		return 0;
> +	if (devargs->cls != NULL)
> +		/* support new global syntax */
> +		return class_name_to_value(devargs->cls->name);
>  	kvlist = rte_kvargs_parse(devargs->args, NULL);
>  	if (kvlist == NULL)
>  		return 0;
> --
> 2.25.1
Raslan Darawsheh April 8, 2021, 12:24 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Slava Ovsiienko
> Sent: Monday, April 5, 2021 1:55 PM
> To: Xueming(Steven) Li <xuemingl@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> Asaf Penso <asafp@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: support device global
> syntax
> 
> > -----Original Message-----
> > From: Xueming Li <xuemingl@nvidia.com>
> > Sent: Monday, January 18, 2021 17:27
> > To: Slava Ovsiienko <viacheslavo@nvidia.com>
> > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> > Asaf Penso <asafp@nvidia.com>
> > Subject: [PATCH v2 1/2] common/mlx5: support device global syntax
> >
> > This patch supports new device global device syntax, resolve class type
> from
> > "class" section if the devarg is global device syntax:
> > bus=<bus>,k=v,,,/class=<cls>,k=v,,,/driver=<pmd>,k=v,,,,
> >
> > To reuse class name of global device syntax, this patch also changes internal
> > class name introduced by commit [1] to algin with RTE class name.
> Typo: algin -> align
Fixed during integration, 
> 
> Beside this:
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> 
Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh
Raslan Darawsheh April 8, 2021, 2:04 p.m. UTC | #3
Due to dependency in eal:
http://patches.dpdk.org/project/dpdk/list/?series=15979
we'll drop from next-net-mlx,  and will merge once the change in main tree is merged.

Kindest regards,
Raslan Darawsheh

> -----Original Message-----
> From: Raslan Darawsheh
> Sent: Thursday, April 8, 2021 3:24 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Xueming(Steven) Li
> <xuemingl@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> Asaf Penso <asafp@nvidia.com>
> Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> 
> Hi,
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Slava Ovsiienko
> > Sent: Monday, April 5, 2021 1:55 PM
> > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> > Asaf Penso <asafp@nvidia.com>
> > Subject: Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: support device
> global
> > syntax
> >
> > > -----Original Message-----
> > > From: Xueming Li <xuemingl@nvidia.com>
> > > Sent: Monday, January 18, 2021 17:27
> > > To: Slava Ovsiienko <viacheslavo@nvidia.com>
> > > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > > <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> > > Asaf Penso <asafp@nvidia.com>
> > > Subject: [PATCH v2 1/2] common/mlx5: support device global syntax
> > >
> > > This patch supports new device global device syntax, resolve class type
> > from
> > > "class" section if the devarg is global device syntax:
> > > bus=<bus>,k=v,,,/class=<cls>,k=v,,,/driver=<pmd>,k=v,,,,
> > >
> > > To reuse class name of global device syntax, this patch also changes
> internal
> > > class name introduced by commit [1] to algin with RTE class name.
> > Typo: algin -> align
> Fixed during integration,
> >
> > Beside this:
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> >
> >
> Patch applied to next-net-mlx,
> 
> Kindest regards
> Raslan Darawsheh
Xueming(Steven) Li April 8, 2021, 2:08 p.m. UTC | #4
Hi Raslan,

Didi you see anything broken? ASAIK, having it in repo shouldn't hurt.
On your decision :)

Thanks,
Xueming

> -----Original Message-----
> From: Raslan Darawsheh <rasland@nvidia.com>
> Sent: Thursday, April 8, 2021 10:04 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Xueming(Steven) Li <xuemingl@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>; Asaf Penso <asafp@nvidia.com>; ferruh.yigit@intel.com
> Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> 
> Due to dependency in eal:
> http://patches.dpdk.org/project/dpdk/list/?series=15979
> we'll drop from next-net-mlx,  and will merge once the change in main tree is merged.
> 
> Kindest regards,
> Raslan Darawsheh
> 
> > -----Original Message-----
> > From: Raslan Darawsheh
> > Sent: Thursday, April 8, 2021 3:24 PM
> > To: Slava Ovsiienko <viacheslavo@nvidia.com>; Xueming(Steven) Li
> > <xuemingl@nvidia.com>
> > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>; Asaf
> > Penso <asafp@nvidia.com>
> > Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of Slava Ovsiienko
> > > Sent: Monday, April 5, 2021 1:55 PM
> > > To: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > > <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> > > Asaf Penso <asafp@nvidia.com>
> > > Subject: Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: support device
> > global
> > > syntax
> > >
> > > > -----Original Message-----
> > > > From: Xueming Li <xuemingl@nvidia.com>
> > > > Sent: Monday, January 18, 2021 17:27
> > > > To: Slava Ovsiienko <viacheslavo@nvidia.com>
> > > > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > > > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > > > <thomas@monjalon.net>; Xueming(Steven) Li <xuemingl@nvidia.com>;
> > > > Asaf Penso <asafp@nvidia.com>
> > > > Subject: [PATCH v2 1/2] common/mlx5: support device global syntax
> > > >
> > > > This patch supports new device global device syntax, resolve class
> > > > type
> > > from
> > > > "class" section if the devarg is global device syntax:
> > > > bus=<bus>,k=v,,,/class=<cls>,k=v,,,/driver=<pmd>,k=v,,,,
> > > >
> > > > To reuse class name of global device syntax, this patch also
> > > > changes
> > internal
> > > > class name introduced by commit [1] to algin with RTE class name.
> > > Typo: algin -> align
> > Fixed during integration,
> > >
> > > Beside this:
> > > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > >
> > >
> > Patch applied to next-net-mlx,
> >
> > Kindest regards
> > Raslan Darawsheh
Raslan Darawsheh April 8, 2021, 2:13 p.m. UTC | #5
Hi,

> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Thursday, April 8, 2021 5:08 PM
> To: Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Asaf Penso <asafp@nvidia.com>;
> ferruh.yigit@intel.com
> Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> 
> Hi Raslan,
> 
> Didi you see anything broken? ASAIK, having it in repo shouldn't hurt.
> On your decision :)
No, It doesn't hurt/ break anything really.
But, the idea that it has some logical dependency in the main tree so I'll only wait till we'll have it merged then will take this one.

> 
> Thanks,
> Xueming
> 
Kindest regards
Raslan Darawsheh
Raslan Darawsheh April 19, 2021, 9:29 a.m. UTC | #6
Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Raslan Darawsheh
> Sent: Thursday, April 8, 2021 5:13 PM
> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Asaf Penso <asafp@nvidia.com>;
> ferruh.yigit@intel.com
> Subject: Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: support device global
> syntax
> 
> Hi,
> 
> > -----Original Message-----
> > From: Xueming(Steven) Li <xuemingl@nvidia.com>
> > Sent: Thursday, April 8, 2021 5:08 PM
> > To: Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>
> > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > <thomas@monjalon.net>; Asaf Penso <asafp@nvidia.com>;
> > ferruh.yigit@intel.com
> > Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> >
> > Hi Raslan,
> >
> > Didi you see anything broken? ASAIK, having it in repo shouldn't hurt.
> > On your decision :)
> No, It doesn't hurt/ break anything really.
> But, the idea that it has some logical dependency in the main tree so I'll only
> wait till we'll have it merged then will take this one.
> 
> >
> > Thanks,
> > Xueming
> >
> Kindest regards
> Raslan Darawsheh
Raslan Darawsheh April 19, 2021, 10:36 a.m. UTC | #7
Sorry for all this confusion, 
But since we are still missing part of the dependency. so dropping form next-net-mlx again.

Kindest regards,
Raslan Darawsheh

> -----Original Message-----
> From: Raslan Darawsheh
> Sent: Monday, April 19, 2021 12:30 PM
> To: Raslan Darawsheh <rasland@nvidia.com>; Xueming(Steven) Li
> <xuemingl@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Asaf Penso <asafp@nvidia.com>;
> ferruh.yigit@intel.com
> Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> 
> Series applied to next-net-mlx,
> 
> Kindest regards,
> Raslan Darawsheh
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Raslan Darawsheh
> > Sent: Thursday, April 8, 2021 5:13 PM
> > To: Xueming(Steven) Li <xuemingl@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>
> > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > <thomas@monjalon.net>; Asaf Penso <asafp@nvidia.com>;
> > ferruh.yigit@intel.com
> > Subject: Re: [dpdk-dev] [PATCH v2 1/2] common/mlx5: support device
> global
> > syntax
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: Xueming(Steven) Li <xuemingl@nvidia.com>
> > > Sent: Thursday, April 8, 2021 5:08 PM
> > > To: Raslan Darawsheh <rasland@nvidia.com>; Slava Ovsiienko
> > > <viacheslavo@nvidia.com>
> > > Cc: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> > > <shahafs@nvidia.com>; NBU-Contact-Thomas Monjalon
> > > <thomas@monjalon.net>; Asaf Penso <asafp@nvidia.com>;
> > > ferruh.yigit@intel.com
> > > Subject: RE: [PATCH v2 1/2] common/mlx5: support device global syntax
> > >
> > > Hi Raslan,
> > >
> > > Didi you see anything broken? ASAIK, having it in repo shouldn't hurt.
> > > On your decision :)
> > No, It doesn't hurt/ break anything really.
> > But, the idea that it has some logical dependency in the main tree so I'll
> only
> > wait till we'll have it merged then will take this one.
> >
> > >
> > > Thanks,
> > > Xueming
> > >
> > Kindest regards
> > Raslan Darawsheh
diff mbox series

Patch

diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c
index 5208972bb6..c03bdbf4eb 100644
--- a/drivers/common/mlx5/mlx5_common_pci.c
+++ b/drivers/common/mlx5/mlx5_common_pci.c
@@ -4,6 +4,7 @@ 
 
 #include <stdlib.h>
 #include <rte_malloc.h>
+#include <rte_class.h>
 #include "mlx5_common_utils.h"
 #include "mlx5_common_pci.h"
 
@@ -26,7 +27,7 @@  static const struct {
 	unsigned int driver_class;
 } mlx5_classes[] = {
 	{ .name = "vdpa", .driver_class = MLX5_CLASS_VDPA },
-	{ .name = "net", .driver_class = MLX5_CLASS_NET },
+	{ .name = "eth", .driver_class = MLX5_CLASS_NET },
 	{ .name = "regex", .driver_class = MLX5_CLASS_REGEX },
 };
 
@@ -115,6 +116,9 @@  parse_class_options(const struct rte_devargs *devargs)
 
 	if (devargs == NULL)
 		return 0;
+	if (devargs->cls != NULL)
+		/* support new global syntax */
+		return class_name_to_value(devargs->cls->name);
 	kvlist = rte_kvargs_parse(devargs->args, NULL);
 	if (kvlist == NULL)
 		return 0;