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 EBB31A034F; Mon, 17 Jan 2022 03:42:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F8BB40DDA; Mon, 17 Jan 2022 03:42:45 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id DF1CC4067B for ; Mon, 17 Jan 2022 03:42:43 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Jcbj62M2rz5HpD; Mon, 17 Jan 2022 10:39:54 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) 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; Mon, 17 Jan 2022 10:42:41 +0800 From: "Min Hu (Connor)" To: CC: , Subject: [PATCH 2/3] net/hns3: fix mailbox wait time uninitialization Date: Mon, 17 Jan 2022 10:43:01 +0800 Message-ID: <20220117024302.16006-3-humin29@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220117024302.16006-1-humin29@huawei.com> References: <20220117024302.16006-1-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] 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 From: Huisong Li The mailbox wait time can be specified at runtime. But the variable that controls this time are not initialized when the variable isn't designated or is specified as an invalid value, which will fail to initialize device in the case where no device is bound to initialize the device. Fixes: 2fc3e696a7f1 ("net/hns3: add runtime config for mailbox limit time") Cc: stable@dpdk.org Signed-off-by: Huisong Li --- drivers/net/hns3/hns3_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c index 0bb552ea3e..78158401f2 100644 --- a/drivers/net/hns3/hns3_common.c +++ b/drivers/net/hns3/hns3_common.c @@ -216,7 +216,7 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args) /* * 500ms is empirical value in process of mailbox communication. If - * the delay value is set to one lower thanthe empirical value, mailbox + * the delay value is set to one lower than the empirical value, mailbox * communication may fail. */ if (val > HNS3_MBX_DEF_TIME_LIMIT_MS && val <= UINT16_MAX) @@ -236,6 +236,12 @@ hns3_parse_devargs(struct rte_eth_dev *dev) uint64_t dev_caps_mask = 0; struct rte_kvargs *kvlist; + /* Set default value of runtime config parameters. */ + hns->rx_func_hint = HNS3_IO_FUNC_HINT_NONE; + hns->tx_func_hint = HNS3_IO_FUNC_HINT_NONE; + hns->dev_caps_mask = 0; + hns->mbx_time_limit_ms = HNS3_MBX_DEF_TIME_LIMIT_MS; + if (dev->device->devargs == NULL) return; -- 2.33.0