[v3] net/mlx5: support new global device syntax

Message ID 20210923064526.158381-1-xuemingl@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series [v3] net/mlx5: support new global device syntax |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed

Commit Message

Xueming Li Sept. 23, 2021, 6:45 a.m. UTC
  This patch support new global device syntax like:
	bus=pci,addr=BB:DD.F/class=eth/driver=mlx5,devargs,..

In driver parameters check, ignores "driver" key which is part of new
global device syntax instead of reporting error.

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

Comments

Thomas Monjalon Sept. 29, 2021, 7:37 p.m. UTC | #1
23/09/2021 08:45, Xueming Li:
> This patch support new global device syntax like:
> 	bus=pci,addr=BB:DD.F/class=eth/driver=mlx5,devargs,..
> 
> In driver parameters check, ignores "driver" key which is part of new
> global device syntax instead of reporting error.
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Applied in next-net-mlx, thanks.
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index f84e061fe7..67808ec236 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -43,6 +43,9 @@ 
 
 #define MLX5_ETH_DRIVER_NAME mlx5_eth
 
+/* Driver type key for new device global syntax. */
+#define MLX5_DRIVER_KEY "driver"
+
 /* Device parameter to enable RX completion queue compression. */
 #define MLX5_RXQ_CQE_COMP_EN "rxq_cqe_comp_en"
 
@@ -1860,7 +1863,7 @@  mlx5_args_check(const char *key, const char *val, void *opaque)
 	signed long tmp;
 
 	/* No-op, port representors are processed in mlx5_dev_spawn(). */
-	if (!strcmp(MLX5_REPRESENTOR, key))
+	if (!strcmp(MLX5_DRIVER_KEY, key) || !strcmp(MLX5_REPRESENTOR, key))
 		return 0;
 	errno = 0;
 	tmp = strtol(val, NULL, 0);
@@ -2014,6 +2017,7 @@  int
 mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
 {
 	const char **params = (const char *[]){
+		MLX5_DRIVER_KEY,
 		MLX5_RXQ_CQE_COMP_EN,
 		MLX5_RXQ_PKT_PAD_EN,
 		MLX5_RX_MPRQ_EN,