All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/mlx5: fix missing default devargs initialization
@ 2022-02-27  7:57 Michael Baum
  2022-03-01 11:09 ` [PATCH v2] " Michael Baum
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Baum @ 2022-02-27  7:57 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko

Device arguments list is provided along with its identifier as part of
EAL arguments.
The arguments specified in the list are taken from it, and the rest is
initialized to the default values.

When no list is provided at all, all arguments should have been
initialized to their default values. However, they are mistakenly
initialized to zero which may be a valid value for some.

This patch initializes the default values before checking whether
arguments have been specified.

Fixes: 04054be4331c ("common/mlx5: refactor devargs management")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index 94c303ce81..ef1604d223 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -326,8 +326,6 @@ mlx5_common_config_get(struct mlx5_kvargs_ctrl *mkvlist,
 	};
 	int ret = 0;
 
-	if (mkvlist == NULL)
-		return 0;
 	/* Set defaults. */
 	config->mr_ext_memseg_en = 1;
 	config->mr_mempool_reg_en = 1;
@@ -335,6 +333,8 @@ mlx5_common_config_get(struct mlx5_kvargs_ctrl *mkvlist,
 	config->dbnc = MLX5_ARG_UNSET;
 	config->device_fd = MLX5_ARG_UNSET;
 	config->pd_handle = MLX5_ARG_UNSET;
+	if (mkvlist == NULL)
+		return 0;
 	/* Process common parameters. */
 	ret = mlx5_kvargs_process(mkvlist, params,
 				  mlx5_common_args_check_handler, config);
-- 
2.25.1


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

* [PATCH v2] common/mlx5: fix missing default devargs initialization
  2022-02-27  7:57 [PATCH] common/mlx5: fix missing default devargs initialization Michael Baum
@ 2022-03-01 11:09 ` Michael Baum
  2022-03-02 16:33   ` Raslan Darawsheh
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Baum @ 2022-03-01 11:09 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko

Device arguments list is provided along with its identifier as part of
EAL arguments.
The arguments specified in the list are taken from it, and the rest is
initialized to the default values.

When no list is provided at all, all arguments should have been
initialized to their default values. However, they are mistakenly
initialized to zero which may be a valid value for some.

This patch initializes the default values before checking whether
arguments have been specified.

Fixes: a729d2f093e9 ("common/mlx5: refactor devargs management")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---

v2: updating Fixes reference hash.

 drivers/common/mlx5/mlx5_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index 94c303ce81..ef1604d223 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -326,8 +326,6 @@ mlx5_common_config_get(struct mlx5_kvargs_ctrl *mkvlist,
 	};
 	int ret = 0;
 
-	if (mkvlist == NULL)
-		return 0;
 	/* Set defaults. */
 	config->mr_ext_memseg_en = 1;
 	config->mr_mempool_reg_en = 1;
@@ -335,6 +333,8 @@ mlx5_common_config_get(struct mlx5_kvargs_ctrl *mkvlist,
 	config->dbnc = MLX5_ARG_UNSET;
 	config->device_fd = MLX5_ARG_UNSET;
 	config->pd_handle = MLX5_ARG_UNSET;
+	if (mkvlist == NULL)
+		return 0;
 	/* Process common parameters. */
 	ret = mlx5_kvargs_process(mkvlist, params,
 				  mlx5_common_args_check_handler, config);
-- 
2.25.1


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

* RE: [PATCH v2] common/mlx5: fix missing default devargs initialization
  2022-03-01 11:09 ` [PATCH v2] " Michael Baum
@ 2022-03-02 16:33   ` Raslan Darawsheh
  2022-03-03 16:14     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Raslan Darawsheh @ 2022-03-02 16:33 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: Matan Azrad, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Tuesday, March 1, 2022 1:10 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Subject: [PATCH v2] common/mlx5: fix missing default devargs initialization
> 
> Device arguments list is provided along with its identifier as part of EAL
> arguments.
> The arguments specified in the list are taken from it, and the rest is initialized
> to the default values.
> 
> When no list is provided at all, all arguments should have been initialized to
> their default values. However, they are mistakenly initialized to zero which
> may be a valid value for some.
> 
> This patch initializes the default values before checking whether arguments
> have been specified.
> 
> Fixes: a729d2f093e9 ("common/mlx5: refactor devargs management")
added:
Reported-at: https://bugs.dpdk.org/show_bug.cgi?id=945
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
> 
> v2: updating Fixes reference hash.
> 
>  drivers/common/mlx5/mlx5_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

* Re: [PATCH v2] common/mlx5: fix missing default devargs initialization
  2022-03-02 16:33   ` Raslan Darawsheh
@ 2022-03-03 16:14     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2022-03-03 16:14 UTC (permalink / raw)
  To: Raslan Darawsheh, Michael Baum, dev; +Cc: Matan Azrad, Slava Ovsiienko

On 3/2/2022 4:33 PM, Raslan Darawsheh wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Michael Baum <michaelba@nvidia.com>
>> Sent: Tuesday, March 1, 2022 1:10 PM
>> To: dev@dpdk.org
>> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
>> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
>> Subject: [PATCH v2] common/mlx5: fix missing default devargs initialization
>>
>> Device arguments list is provided along with its identifier as part of EAL
>> arguments.
>> The arguments specified in the list are taken from it, and the rest is initialized
>> to the default values.
>>
>> When no list is provided at all, all arguments should have been initialized to
>> their default values. However, they are mistakenly initialized to zero which
>> may be a valid value for some.
>>
>> This patch initializes the default values before checking whether arguments
>> have been specified.
>>
>> Fixes: a729d2f093e9 ("common/mlx5: refactor devargs management")
> added:
> Reported-at: https://bugs.dpdk.org/show_bug.cgi?id=945

We have a defined keyword for it, and it should go before Fixes tag, like:

      Bugzilla ID: 945
      Fixes: a729d2f093e9 ("common/mlx5: refactor devargs management")

updated accordingly in next-net

>>
>> Signed-off-by: Michael Baum <michaelba@nvidia.com>
>> Acked-by: Matan Azrad <matan@nvidia.com>
>> ---
>>
>> v2: updating Fixes reference hash.
>>
>>   drivers/common/mlx5/mlx5_common.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
> 
> Patch applied to next-net-mlx,
> 
> Kindest regards,
> Raslan Darawsheh


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

end of thread, other threads:[~2022-03-03 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-27  7:57 [PATCH] common/mlx5: fix missing default devargs initialization Michael Baum
2022-03-01 11:09 ` [PATCH v2] " Michael Baum
2022-03-02 16:33   ` Raslan Darawsheh
2022-03-03 16:14     ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.