DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <andrew.rybchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 6/8] net/hns3: fix a print position about auto-negotiation
Date: Sat, 17 Jul 2021 10:02:54 +0800	[thread overview]
Message-ID: <1626487376-30038-7-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1626487376-30038-1-git-send-email-humin29@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

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 <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 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


  parent reply	other threads:[~2021-07-17  2:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17  2:02 [dpdk-dev] [PATCH 0/8] bugfix for hns3 PMD Min Hu (Connor)
2021-07-17  2:02 ` [dpdk-dev] [PATCH 1/8] net/hns3: fix residual MAC address entry Min Hu (Connor)
2021-07-17  2:02 ` [dpdk-dev] [PATCH 2/8] net/hns3: delete unnecessary zero assignments Min Hu (Connor)
2021-07-17  2:02 ` [dpdk-dev] [PATCH 3/8] net/hns3: fix incorrect comment Min Hu (Connor)
2021-07-17  2:02 ` [dpdk-dev] [PATCH 4/8] net/hns3: fix the timing issue of clearing interrupt source Min Hu (Connor)
2021-07-17  2:02 ` [dpdk-dev] [PATCH 5/8] net/hns3: delete duplicate compile-time check Min Hu (Connor)
2021-07-17  2:02 ` Min Hu (Connor) [this message]
2021-07-17  2:02 ` [dpdk-dev] [PATCH 7/8] net/hns3: fix flow list separate management Min Hu (Connor)
2021-07-17  2:02 ` [dpdk-dev] [PATCH 8/8] net/hns3: fix Tx pkt prepare address when dev stop Min Hu (Connor)
2021-07-23 12:49 ` [dpdk-dev] [PATCH 0/8] bugfix for hns3 PMD Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1626487376-30038-7-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).