summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2019-05-30 10:20:33 +0000
committerKevin Traynor <ktraynor@redhat.com>2019-09-13 10:37:20 +0100
commit008eadcc50240924da7e4fc2640ef19182370bbb (patch)
tree8bedd3265bb65ddc18de70151385c6b8cc54ec68
parent81d0621264449ecca3dfe929e66c933e499c7798 (diff)
downloaddpdk-stable-008eadcc50240924da7e4fc2640ef19182370bbb.zip
dpdk-stable-008eadcc50240924da7e4fc2640ef19182370bbb.tar.gz
dpdk-stable-008eadcc50240924da7e4fc2640ef19182370bbb.tar.xz
net/mlx5: fix device arguments error detection
[ upstream commit 15b0ea00535d4e164891168ef628b112ae049e06 ] When bad device arguments are added to the DPDK command line, the PMD ignores all the command line arguments specified by the user and uses the default values instead. This behavior doesn't make sense because the user intention is to force some device parameters and expects to get an error in case of problematic issues with the arguments. Stop probing and report an error in case of problematic command line arguments. Fixes: e72dd09b614e ("net/mlx5: add support for configuration through kvargs") Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
-rw-r--r--drivers/net/mlx5/mlx5.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index d91d55b..27db156 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -574,8 +574,10 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
return 0;
/* Following UGLY cast is done to pass checkpatch. */
kvlist = rte_kvargs_parse(devargs->args, params);
- if (kvlist == NULL)
- return 0;
+ if (kvlist == NULL) {
+ rte_errno = EINVAL;
+ return -rte_errno;
+ }
/* Process parameters. */
for (i = 0; (params[i] != NULL); ++i) {
if (rte_kvargs_count(kvlist, params[i])) {