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 5/8] net/bnxt: fix setting forced speed
Date: Wed, 15 Jun 2022 20:27:00 +0530 [thread overview]
Message-ID: <20220615145703.6613-6-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20220615145703.6613-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
The "active_fec_signal_mode" in HWRM_PORT_PHY_QCFG response
does not return correct value till the link is up. Driver cannot
rely on active_fec_signal_mode while setting forced speed.
While setting forced speed of 50G/100G/200G, check if PAM4 speeds
are supported for the port first and then populate the HWRM request
accordingly.
Also, If PAM4 speed is supported, use PAM4 supported speed while
reporting speed capabilities.
Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 11 ++++++-----
drivers/net/bnxt/bnxt_hwrm.c | 27 +++++++++++++++++++--------
drivers/net/bnxt/bnxt_hwrm.h | 3 +++
3 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 8181e1f..4e4791c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -903,6 +903,7 @@ static int bnxt_shutdown_nic(struct bnxt *bp)
uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
{
+ uint32_t pam4_link_speed = 0;
uint32_t link_speed = 0;
uint32_t speed_capa = 0;
@@ -912,8 +913,8 @@ uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
link_speed = bp->link_info->support_speeds;
/* If PAM4 is configured, use PAM4 supported speed */
- if (link_speed == 0 && bp->link_info->support_pam4_speeds > 0)
- link_speed = bp->link_info->support_pam4_speeds;
+ if (bp->link_info->support_pam4_speeds > 0)
+ pam4_link_speed = bp->link_info->support_pam4_speeds;
if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB)
speed_capa |= RTE_ETH_LINK_SPEED_100M;
@@ -935,11 +936,11 @@ uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
speed_capa |= RTE_ETH_LINK_SPEED_50G;
if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB)
speed_capa |= RTE_ETH_LINK_SPEED_100G;
- if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G)
+ if (pam4_link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G)
speed_capa |= RTE_ETH_LINK_SPEED_50G;
- if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G)
+ if (pam4_link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G)
speed_capa |= RTE_ETH_LINK_SPEED_100G;
- if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G)
+ if (pam4_link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_200G)
speed_capa |= RTE_ETH_LINK_SPEED_200G;
if (bp->link_info->auto_mode ==
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 9eb8b8d..206ac20 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2970,7 +2970,7 @@ static uint16_t bnxt_check_eth_link_autoneg(uint32_t conf_link)
}
static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
- uint16_t pam4_link)
+ struct bnxt_link_info *link_info)
{
uint16_t eth_link_speed = 0;
@@ -3009,18 +3009,29 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB;
break;
case RTE_ETH_LINK_SPEED_50G:
- eth_link_speed = pam4_link ?
- HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB :
- HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB;
+ if (link_info->support_pam4_speeds &
+ HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G) {
+ eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB;
+ link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
+ } else {
+ eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB;
+ link_info->link_signal_mode = BNXT_SIG_MODE_NRZ;
+ }
break;
case RTE_ETH_LINK_SPEED_100G:
- eth_link_speed = pam4_link ?
- HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB :
- HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB;
+ if (link_info->support_pam4_speeds &
+ HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G) {
+ eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB;
+ link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
+ } else {
+ eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB;
+ link_info->link_signal_mode = BNXT_SIG_MODE_NRZ;
+ }
break;
case RTE_ETH_LINK_SPEED_200G:
eth_link_speed =
HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_200GB;
+ link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
break;
default:
PMD_DRV_LOG(ERR,
@@ -3242,7 +3253,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
autoneg = 0;
speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds,
- bp->link_info->link_signal_mode);
+ bp->link_info);
link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
/* Autoneg can be done only when the FW allows. */
if (autoneg == 1 &&
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 77f8521..a82d9fb 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -141,6 +141,9 @@ struct bnxt_pf_resource_info {
BNXT_TUNNELED_OFFLOADS_CAP_GRE_EN(bp) && \
BNXT_TUNNELED_OFFLOADS_CAP_IPINIP_EN(bp))
+#define BNXT_SIG_MODE_NRZ HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_NRZ
+#define BNXT_SIG_MODE_PAM4 HWRM_PORT_PHY_QCFG_OUTPUT_SIGNAL_MODE_PAM4
+
int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp,
struct bnxt_vnic_info *vnic);
int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic,
--
2.10.1
next prev 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 ` Kalesh A P [this message]
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 ` [dpdk-dev] [PATCH 8/8] net/bnxt: fix the check for autoneg enablement in the PHY FW Kalesh A P
2022-06-16 17:04 ` 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-6-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).