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 7D877A0C4A; Sat, 17 Jul 2021 04:04:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 620C7413AA; Sat, 17 Jul 2021 04:03:57 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 939E340040 for ; Sat, 17 Jul 2021 04:03:46 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GRWXS6hvVzcdCR for ; Sat, 17 Jul 2021 10:00:24 +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.2176.2; Sat, 17 Jul 2021 10:03:44 +0800 From: "Min Hu (Connor)" To: CC: , Date: Sat, 17 Jul 2021 10:02:54 +0800 Message-ID: <1626487376-30038-7-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626487376-30038-1-git-send-email-humin29@huawei.com> References: <1626487376-30038-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH 6/8] net/hns3: fix a print position about auto-negotiation 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 Sender: "dev" From: Huisong Li PF driver prints a warning on device that does not support auto-negotiation when user does not configure "link_speeds" (default 0), which means auto-negotiation. Currently, this warning information is printed in dev_configure stage and a success is returned. Perhaps the user may call dev_configure multiple times before dev_start for some reason or purpose. In this case, this message may be printed multiple times. So this patch moves it to dev_start stage. Fixes: cfc9fe48c4d4 ("net/hns3: move link speeds check to configure") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index f994c28..4a302d2 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2437,14 +2437,11 @@ hns3_check_link_speed(struct hns3_hw *hw, uint32_t link_speeds) /* * Some hardware doesn't support auto-negotiation, but users may not * configure link_speeds (default 0), which means auto-negotiation. - * In this case, a warning message need to be printed, instead of - * an error. + * In this case, it should return success. */ if (link_speeds == ETH_LINK_SPEED_AUTONEG && - hw->mac.support_autoneg == 0) { - hns3_warn(hw, "auto-negotiation is not supported, use default fixed speed!"); + hw->mac.support_autoneg == 0) return 0; - } if (link_speeds != ETH_LINK_SPEED_AUTONEG) { ret = hns3_check_port_speed(hw, link_speeds); @@ -5515,10 +5512,13 @@ hns3_set_fiber_port_link_speed(struct hns3_hw *hw, /* * Some hardware doesn't support auto-negotiation, but users may not * configure link_speeds (default 0), which means auto-negotiation. - * In this case, it should return success. + * In this case, a warning message need to be printed, instead of + * an error. */ - if (cfg->autoneg) + if (cfg->autoneg) { + hns3_warn(hw, "auto-negotiation is not supported, use default fixed speed!"); return 0; + } return hns3_cfg_mac_speed_dup(hw, cfg->speed, cfg->duplex); } -- 2.7.4