From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 839DAA034D; Wed, 16 Feb 2022 01:29:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F07C5410FB; Wed, 16 Feb 2022 01:29:09 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 3A328410F7 for ; Wed, 16 Feb 2022 01:29:08 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JyzLR31wDz9sZc; Wed, 16 Feb 2022 08:27:27 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Wed, 16 Feb 2022 08:29:04 +0800 Subject: Re: [PATCH v2 1/2] net/bonding: add error hint for invalid args To: Wan Junjie , CC: Chas Williams References: <20220214081344.13637-1-wanjunjie@bytedance.com> <20220215105612.59970-1-wanjunjie@bytedance.com> From: "Min Hu (Connor)" Message-ID: <3e9d5de9-e877-4195-add9-b80130e26b27@huawei.com> Date: Wed, 16 Feb 2022 08:29:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20220215105612.59970-1-wanjunjie@bytedance.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Acked-by: Min Hu (Connor) ÔÚ 2022/2/15 18:56, Wan Junjie дµÀ: > When invalid args exist, application exits with no error hint. > Adding a log message here will help users to know the reason. > > Signed-off-by: Wan Junjie > --- > v2: fix typo in commit msg > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index bfa931098e..aa6519f83c 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -3439,8 +3439,10 @@ bond_probe(struct rte_vdev_device *dev) > > kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), > pmd_bond_init_valid_arguments); > - if (kvlist == NULL) > + if (kvlist == NULL) { > + RTE_BOND_LOG(ERR, "Invalid args in %s", rte_vdev_device_args(dev)); > return -1; > + } > > /* Parse link bonding mode */ > if (rte_kvargs_count(kvlist, PMD_BOND_MODE_KVARG) == 1) { >