DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@xilinx.com, ajit.khaparde@broadcom.com
Subject: [dpdk-dev] [PATCH 8/8] net/bnxt: fix the check for autoneg enablement in the PHY FW
Date: Wed, 15 Jun 2022 20:27:03 +0530	[thread overview]
Message-ID: <20220615145703.6613-9-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20220615145703.6613-1-kalesh-anakkur.purayil@broadcom.com>

From: Somnath Kotur <somnath.kotur@broadcom.com>

The current combination of checks to determine whether autoneg is
enabled in the card is a bit convoluted and may become incorrect
as well in the future as one of the fields being used - auto_link_speed
might become deprecated.
Switch to using the 'auto_mode' field obtained from the response of
HWRM_PHY_QCFG cmd as that is always deterministically set by the PHY
FW.
Fixed a bug in the 40G check to only look for the bit setting and
not the actual value.
Also, check the forced speeds first before trying to enforce the
auto speeds

Allow the user to set autoneg speed in all cases except for PAM4 200G
as PAM4 200G will come up only in forced mode.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 206ac20..9c52573 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3235,9 +3235,11 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 	if (!link_up)
 		goto port_phy_cfg;
 
+	/* Get user requested autoneg setting */
 	autoneg = bnxt_check_eth_link_autoneg(dev_conf->link_speeds);
+
 	if (BNXT_CHIP_P5(bp) &&
-	    dev_conf->link_speeds == RTE_ETH_LINK_SPEED_40G) {
+	    dev_conf->link_speeds & RTE_ETH_LINK_SPEED_40G) {
 		/* 40G is not supported as part of media auto detect.
 		 * The speed should be forced and autoneg disabled
 		 * to configure 40G speed.
@@ -3246,11 +3248,13 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 		autoneg = 0;
 	}
 
-	/* No auto speeds and no auto_pam4_link. Disable autoneg */
-	if (bp->link_info->auto_link_speed == 0 &&
-	    bp->link_info->link_signal_mode &&
-	    bp->link_info->auto_pam4_link_speed_mask == 0)
+	/* Override based on current Autoneg setting in PHY for 200G */
+	if (autoneg == 1 && BNXT_CHIP_P5(bp) && bp->link_info->auto_mode == 0 &&
+	    bp->link_info->force_pam4_link_speed ==
+	    HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB) {
 		autoneg = 0;
+		PMD_DRV_LOG(DEBUG, "Disabling autoneg for 200G\n");
+	}
 
 	speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds,
 					  bp->link_info);
@@ -3283,14 +3287,14 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 		else if (bp->link_info->force_pam4_link_speed)
 			link_req.link_speed =
 				bp->link_info->force_pam4_link_speed;
+		else if (bp->link_info->force_link_speed)
+			link_req.link_speed = bp->link_info->force_link_speed;
 		else if (bp->link_info->auto_pam4_link_speed_mask)
 			link_req.link_speed =
 				bp->link_info->auto_pam4_link_speed_mask;
 		else if (bp->link_info->support_pam4_speeds)
 			link_req.link_speed =
 				bp->link_info->support_pam4_speeds;
-		else if (bp->link_info->force_link_speed)
-			link_req.link_speed = bp->link_info->force_link_speed;
 		else
 			link_req.link_speed = bp->link_info->auto_link_speed;
 		/* Auto PAM4 link speed is zero, but auto_link_speed is not
-- 
2.10.1


  parent reply	other threads:[~2022-06-15 14:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 14:56 [dpdk-dev] [PATCH 0/8] bnxt PMD fixes Kalesh A P
2022-06-15 14:56 ` [dpdk-dev] [PATCH 1/8] net/bnxt: remove assert for zero data len in Tx path Kalesh A P
2022-06-16 17:03   ` Ferruh Yigit
2022-06-19 23:09     ` Ajit Khaparde
2022-06-20 10:55       ` Ferruh Yigit
2022-06-20 17:03         ` Ajit Khaparde
2022-06-15 14:56 ` [dpdk-dev] [PATCH 2/8] net/bnxt: fix switch domain allocation Kalesh A P
2022-06-15 14:56 ` [dpdk-dev] [PATCH 3/8] net/bnxt: reduce the verbosity of a log Kalesh A P
2022-06-15 14:56 ` [dpdk-dev] [PATCH 4/8] net/bnxt: allow Tx only or Rx only configs in PMD Kalesh A P
2022-06-16 17:03   ` Ferruh Yigit
2022-06-21  4:46     ` Kalesh Anakkur Purayil
2022-06-21  4:54       ` Damodharam Ammepalli
2022-06-21  7:57         ` Ferruh Yigit
2022-06-15 14:57 ` [dpdk-dev] [PATCH 5/8] net/bnxt: fix setting forced speed Kalesh A P
2022-06-15 14:57 ` [dpdk-dev] [PATCH 6/8] net/bnxt: disallow MTU change when device is started Kalesh A P
2022-06-15 14:57 ` [dpdk-dev] [PATCH 7/8] net/bnxt: cleanups in MTU set callback Kalesh A P
2022-06-15 14:57 ` Kalesh A P [this message]
2022-06-16 17:04   ` [dpdk-dev] [PATCH 8/8] net/bnxt: fix the check for autoneg enablement in the PHY FW Ferruh Yigit
2022-06-19 23:11     ` Ajit Khaparde
2022-06-26 20:45 ` [dpdk-dev] [PATCH 0/8] bnxt PMD fixes Ajit Khaparde
2022-06-27  2:08   ` Thomas Monjalon
2022-06-27  3:28     ` Ajit Khaparde

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=20220615145703.6613-9-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.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).