DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] regex/mlx5: fix registration name
@ 2020-07-29 14:01 Ori Kam
  2020-07-29 14:10 ` Thomas Monjalon
  2020-08-05 14:51 ` [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name Thomas Monjalon
  0 siblings, 2 replies; 6+ messages in thread
From: Ori Kam @ 2020-07-29 14:01 UTC (permalink / raw)
  To: thomas; +Cc: orika, dev

The current registration name has the net prefix, which is incorrect.
This commit removes the net and changes the name to be regex_mlx5.

Signed-off-by: Ori Kam <orika@mellanox.com>
---
 drivers/regex/mlx5/mlx5_regex.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
index 1ca5bfe..cba3eb9 100644
--- a/drivers/regex/mlx5/mlx5_regex.c
+++ b/drivers/regex/mlx5/mlx5_regex.c
@@ -262,6 +262,6 @@
 }
 
 RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
-RTE_PMD_EXPORT_NAME(net_mlx5_regex, __COUNTER__);
-RTE_PMD_REGISTER_PCI_TABLE(net_mlx5_regex, mlx5_regex_pci_id_map);
-RTE_PMD_REGISTER_KMOD_DEP(net_mlx5_regex, "* ib_uverbs & mlx5_core & mlx5_ib");
+RTE_PMD_EXPORT_NAME(regex_mlx5, __COUNTER__);
+RTE_PMD_REGISTER_PCI_TABLE(regex_mlx5, mlx5_regex_pci_id_map);
+RTE_PMD_REGISTER_KMOD_DEP(regex_mlx5, "* ib_uverbs & mlx5_core & mlx5_ib");
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] regex/mlx5: fix registration name
  2020-07-29 14:01 [dpdk-dev] [PATCH] regex/mlx5: fix registration name Ori Kam
@ 2020-07-29 14:10 ` Thomas Monjalon
  2020-07-29 14:13   ` David Marchand
  2020-08-05 14:51 ` [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2020-07-29 14:10 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, david.marchand

29/07/2020 16:01, Ori Kam:
> The current registration name has the net prefix, which is incorrect.
> This commit removes the net and changes the name to be regex_mlx5.
> 
> Signed-off-by: Ori Kam <orika@mellanox.com>
> ---
>  drivers/regex/mlx5/mlx5_regex.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
> index 1ca5bfe..cba3eb9 100644
> --- a/drivers/regex/mlx5/mlx5_regex.c
> +++ b/drivers/regex/mlx5/mlx5_regex.c
> @@ -262,6 +262,6 @@
>  }
>  
>  RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
> -RTE_PMD_EXPORT_NAME(net_mlx5_regex, __COUNTER__);
> -RTE_PMD_REGISTER_PCI_TABLE(net_mlx5_regex, mlx5_regex_pci_id_map);
> -RTE_PMD_REGISTER_KMOD_DEP(net_mlx5_regex, "* ib_uverbs & mlx5_core & mlx5_ib");
> +RTE_PMD_EXPORT_NAME(regex_mlx5, __COUNTER__);
> +RTE_PMD_REGISTER_PCI_TABLE(regex_mlx5, mlx5_regex_pci_id_map);
> +RTE_PMD_REGISTER_KMOD_DEP(regex_mlx5, "* ib_uverbs & mlx5_core & mlx5_ib");

I think you should add a macro for the name of the driver,
and take this opportunity to use the macro in mlx5_regex_driver.pci_driver.driver.name,
which is currently mlx5_regex instead of regex_mlx5.



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

* Re: [dpdk-dev] [PATCH] regex/mlx5: fix registration name
  2020-07-29 14:10 ` Thomas Monjalon
@ 2020-07-29 14:13   ` David Marchand
  0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2020-07-29 14:13 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Ori Kam, dev

On Wed, Jul 29, 2020 at 4:10 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 29/07/2020 16:01, Ori Kam:
> > The current registration name has the net prefix, which is incorrect.
> > This commit removes the net and changes the name to be regex_mlx5.
> >

It was offlist, but
Reported-by: David Marchand <david.marchand@redhat.com>


> > Signed-off-by: Ori Kam <orika@mellanox.com>
> > ---
> >  drivers/regex/mlx5/mlx5_regex.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
> > index 1ca5bfe..cba3eb9 100644
> > --- a/drivers/regex/mlx5/mlx5_regex.c
> > +++ b/drivers/regex/mlx5/mlx5_regex.c
> > @@ -262,6 +262,6 @@
> >  }
> >
> >  RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
> > -RTE_PMD_EXPORT_NAME(net_mlx5_regex, __COUNTER__);
> > -RTE_PMD_REGISTER_PCI_TABLE(net_mlx5_regex, mlx5_regex_pci_id_map);
> > -RTE_PMD_REGISTER_KMOD_DEP(net_mlx5_regex, "* ib_uverbs & mlx5_core & mlx5_ib");
> > +RTE_PMD_EXPORT_NAME(regex_mlx5, __COUNTER__);
> > +RTE_PMD_REGISTER_PCI_TABLE(regex_mlx5, mlx5_regex_pci_id_map);
> > +RTE_PMD_REGISTER_KMOD_DEP(regex_mlx5, "* ib_uverbs & mlx5_core & mlx5_ib");
>
> I think you should add a macro for the name of the driver,
> and take this opportunity to use the macro in mlx5_regex_driver.pci_driver.driver.name,
> which is currently mlx5_regex instead of regex_mlx5.

Sounds good to me.
We might want to align other drivers too, as there are discrepancies
in vdpa drivers.


-- 
David Marchand


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

* [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name
  2020-07-29 14:01 [dpdk-dev] [PATCH] regex/mlx5: fix registration name Ori Kam
  2020-07-29 14:10 ` Thomas Monjalon
@ 2020-08-05 14:51 ` Thomas Monjalon
  2020-08-05 16:35   ` Ori Kam
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2020-08-05 14:51 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, orika, matan

The driver name was registered as "net_mlx5_regex".
It is renamed as "regex_mlx5".
The same name is used in mlx5_regex_driver.pci_driver.driver.name,
instead of "mlx5_regex", for consistency.

The string used for log registration (pmd.regex.mlx5) could be derived
from the driver name. A macro is created so name definitions are close.

Fixes: cfc672a90b74 ("regex/mlx5: support probing")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: add macros and fix PCI driver name
---
 drivers/regex/mlx5/mlx5_regex.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
index ae9f00189e..605ebcfe0e 100644
--- a/drivers/regex/mlx5/mlx5_regex.c
+++ b/drivers/regex/mlx5/mlx5_regex.c
@@ -19,6 +19,9 @@
 #include "mlx5_regex_utils.h"
 #include "mlx5_rxp_csrs.h"
 
+#define MLX5_REGEX_DRIVER_NAME regex_mlx5
+#define MLX5_REGEX_LOG_NAME    pmd.regex.mlx5
+
 int mlx5_regex_logtype;
 
 const struct rte_regexdev_ops mlx5_regexdev_ops = {
@@ -250,7 +253,7 @@ static struct mlx5_pci_driver mlx5_regex_driver = {
 	.driver_class = MLX5_CLASS_REGEX,
 	.pci_driver = {
 		.driver = {
-			.name = "mlx5_regex",
+			.name = RTE_STR(MLX5_REGEX_DRIVER_NAME),
 		},
 		.id_table = mlx5_regex_pci_id_map,
 		.probe = mlx5_regex_pci_probe,
@@ -266,7 +269,7 @@ RTE_INIT(rte_mlx5_regex_init)
 		mlx5_pci_driver_register(&mlx5_regex_driver);
 }
 
-RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
-RTE_PMD_EXPORT_NAME(net_mlx5_regex, __COUNTER__);
-RTE_PMD_REGISTER_PCI_TABLE(net_mlx5_regex, mlx5_regex_pci_id_map);
-RTE_PMD_REGISTER_KMOD_DEP(net_mlx5_regex, "* ib_uverbs & mlx5_core & mlx5_ib");
+RTE_LOG_REGISTER(mlx5_regex_logtype, MLX5_REGEX_LOG_NAME, NOTICE)
+RTE_PMD_EXPORT_NAME(MLX5_REGEX_DRIVER_NAME, __COUNTER__);
+RTE_PMD_REGISTER_PCI_TABLE(MLX5_REGEX_DRIVER_NAME, mlx5_regex_pci_id_map);
+RTE_PMD_REGISTER_KMOD_DEP(MLX5_REGEX_DRIVER_NAME, "* ib_uverbs & mlx5_core & mlx5_ib");
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name
  2020-08-05 14:51 ` [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name Thomas Monjalon
@ 2020-08-05 16:35   ` Ori Kam
  2020-08-05 16:37     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Ori Kam @ 2020-08-05 16:35 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: david.marchand, Matan Azrad



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> 
> The driver name was registered as "net_mlx5_regex".
> It is renamed as "regex_mlx5".
> The same name is used in mlx5_regex_driver.pci_driver.driver.name,
> instead of "mlx5_regex", for consistency.
> 
> The string used for log registration (pmd.regex.mlx5) could be derived
> from the driver name. A macro is created so name definitions are close.
> 
> Fixes: cfc672a90b74 ("regex/mlx5: support probing")
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v2: add macros and fix PCI driver name
> ---
>  drivers/regex/mlx5/mlx5_regex.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/regex/mlx5/mlx5_regex.c
> b/drivers/regex/mlx5/mlx5_regex.c
> index ae9f00189e..605ebcfe0e 100644
> --- a/drivers/regex/mlx5/mlx5_regex.c
> +++ b/drivers/regex/mlx5/mlx5_regex.c
> @@ -19,6 +19,9 @@
>  #include "mlx5_regex_utils.h"
>  #include "mlx5_rxp_csrs.h"
> 
> +#define MLX5_REGEX_DRIVER_NAME regex_mlx5
> +#define MLX5_REGEX_LOG_NAME    pmd.regex.mlx5
> +
>  int mlx5_regex_logtype;
> 
>  const struct rte_regexdev_ops mlx5_regexdev_ops = {
> @@ -250,7 +253,7 @@ static struct mlx5_pci_driver mlx5_regex_driver = {
>  	.driver_class = MLX5_CLASS_REGEX,
>  	.pci_driver = {
>  		.driver = {
> -			.name = "mlx5_regex",
> +			.name = RTE_STR(MLX5_REGEX_DRIVER_NAME),
>  		},
>  		.id_table = mlx5_regex_pci_id_map,
>  		.probe = mlx5_regex_pci_probe,
> @@ -266,7 +269,7 @@ RTE_INIT(rte_mlx5_regex_init)
>  		mlx5_pci_driver_register(&mlx5_regex_driver);
>  }
> 
> -RTE_LOG_REGISTER(mlx5_regex_logtype, pmd.regex.mlx5, NOTICE)
> -RTE_PMD_EXPORT_NAME(net_mlx5_regex, __COUNTER__);
> -RTE_PMD_REGISTER_PCI_TABLE(net_mlx5_regex, mlx5_regex_pci_id_map);
> -RTE_PMD_REGISTER_KMOD_DEP(net_mlx5_regex, "* ib_uverbs & mlx5_core
> & mlx5_ib");
> +RTE_LOG_REGISTER(mlx5_regex_logtype, MLX5_REGEX_LOG_NAME,
> NOTICE)
> +RTE_PMD_EXPORT_NAME(MLX5_REGEX_DRIVER_NAME, __COUNTER__);
> +RTE_PMD_REGISTER_PCI_TABLE(MLX5_REGEX_DRIVER_NAME,
> mlx5_regex_pci_id_map);
> +RTE_PMD_REGISTER_KMOD_DEP(MLX5_REGEX_DRIVER_NAME, "* ib_uverbs
> & mlx5_core & mlx5_ib");
> --
> 2.27.0

Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori

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

* Re: [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name
  2020-08-05 16:35   ` Ori Kam
@ 2020-08-05 16:37     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2020-08-05 16:37 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, david.marchand, Matan Azrad

> > The driver name was registered as "net_mlx5_regex".
> > It is renamed as "regex_mlx5".
> > The same name is used in mlx5_regex_driver.pci_driver.driver.name,
> > instead of "mlx5_regex", for consistency.
> > 
> > The string used for log registration (pmd.regex.mlx5) could be derived
> > from the driver name. A macro is created so name definitions are close.
> > 
> > Fixes: cfc672a90b74 ("regex/mlx5: support probing")
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > v2: add macros and fix PCI driver name
> 
> Acked-by: Ori Kam <orika@mellanox.com>

Applied



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

end of thread, other threads:[~2020-08-05 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 14:01 [dpdk-dev] [PATCH] regex/mlx5: fix registration name Ori Kam
2020-07-29 14:10 ` Thomas Monjalon
2020-07-29 14:13   ` David Marchand
2020-08-05 14:51 ` [dpdk-dev] [PATCH v2] regex/mlx5: fix registered driver name Thomas Monjalon
2020-08-05 16:35   ` Ori Kam
2020-08-05 16:37     ` 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).