From patchwork Thu May 30 10:20:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Azrad X-Patchwork-Id: 53896 X-Patchwork-Delegate: shahafs@mellanox.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35F291B964; Thu, 30 May 2019 12:20:49 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id D6FAF1B945; Thu, 30 May 2019 12:20:44 +0200 (CEST) From: Matan Azrad To: Shahaf Shuler , Yongseok Koh Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 30 May 2019 10:20:33 +0000 Message-Id: <1559211639-17442-4-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1559211639-17442-1-git-send-email-matan@mellanox.com> References: <1559211639-17442-1-git-send-email-matan@mellanox.com> Subject: [dpdk-dev] [PATCH v1 3/9] net/mlx5: fix device arguments error detection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 intension 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") Cc: stable@dpdk.org Signed-off-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index ebb49c8..23e397e 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -986,8 +986,10 @@ struct mlx5_dev_spawn_data { 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])) {