DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: fix PAM4 link negotiation
@ 2020-11-02  2:43 Ajit Khaparde
  2020-11-03  0:24 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Ajit Khaparde @ 2020-11-02  2:43 UTC (permalink / raw)
  To: dev

In some instances link was not coming up if PAM4 signaling is enabled.
Added check to disable autoneg if FW indicates auto speeds are zero.
Use default auto speeds if PAM4 auto speeds is not set.
Added a fix for forced link setting.

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

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c |  4 ++++
 drivers/net/bnxt/bnxt_hwrm.c   | 22 ++++++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 21ea370bf5..70edf824bc 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -845,6 +845,10 @@ uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
 	uint32_t link_speed = bp->link_info->support_speeds;
 	uint32_t speed_capa = 0;
 
+	/* 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 (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB)
 		speed_capa |= ETH_LINK_SPEED_100M;
 	if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 84702125cc..24c33185b4 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1272,9 +1272,10 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf)
 				HWRM_PORT_PHY_CFG_IN_EN_FORCE_PAM4_LINK_SPEED;
 				req.force_pam4_link_speed =
 					rte_cpu_to_le_16(conf->link_speed);
-			}
-			req.force_link_speed =
+			} else {
+				req.force_link_speed =
 					rte_cpu_to_le_16(conf->link_speed);
+			}
 		}
 		/* AutoNeg - Advertise speeds specified. */
 		if (conf->auto_link_speed_mask &&
@@ -1370,6 +1371,11 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
 		    link_info->link_speed, link_info->auto_mode,
 		    link_info->auto_link_speed, link_info->auto_link_speed_mask,
 		    link_info->support_speeds, link_info->force_link_speed);
+	PMD_DRV_LOG(DEBUG, "Link Signal:%d,PAM::Auto:%x,Support:%x,Force:%x\n",
+		    link_info->link_signal_mode,
+		    link_info->auto_pam4_link_speeds,
+		    link_info->support_pam4_speeds,
+		    link_info->force_pam4_link_speed);
 	return rc;
 }
 
@@ -3071,6 +3077,12 @@ 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_speeds == 0)
+		autoneg = 0;
+
 	speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds,
 					  bp->link_info->link_signal_mode);
 	link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
@@ -3116,6 +3128,12 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up)
 			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
+		 * zero. Use the auto_link_speed.
+		 */
+		if (bp->link_info->auto_link_speed != 0 &&
+		    bp->link_info->auto_pam4_link_speeds == 0)
+			link_req.link_speed = bp->link_info->auto_link_speed;
 	}
 	link_req.duplex = bnxt_parse_eth_link_duplex(dev_conf->link_speeds);
 	link_req.auto_pause = bp->link_info->auto_pause;
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: fix PAM4 link negotiation
  2020-11-02  2:43 [dpdk-dev] [PATCH] net/bnxt: fix PAM4 link negotiation Ajit Khaparde
@ 2020-11-03  0:24 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-11-03  0:24 UTC (permalink / raw)
  To: dpdk-dev

On Sun, Nov 1, 2020 at 6:43 PM Ajit Khaparde <ajit.khaparde@broadcom.com>
wrote:

> In some instances link was not coming up if PAM4 signaling is enabled.
> Added check to disable autoneg if FW indicates auto speeds are zero.
> Use default auto speeds if PAM4 auto speeds is not set.
> Added a fix for forced link setting.
>
> Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
Applied to dpdk-next-net-brcm. Thanks


> ---
>  drivers/net/bnxt/bnxt_ethdev.c |  4 ++++
>  drivers/net/bnxt/bnxt_hwrm.c   | 22 ++++++++++++++++++++--
>  2 files changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index 21ea370bf5..70edf824bc 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -845,6 +845,10 @@ uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
>         uint32_t link_speed = bp->link_info->support_speeds;
>         uint32_t speed_capa = 0;
>
> +       /* 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 (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB)
>                 speed_capa |= ETH_LINK_SPEED_100M;
>         if (link_speed & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100MBHD)
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index 84702125cc..24c33185b4 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -1272,9 +1272,10 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp,
> struct bnxt_link_info *conf)
>
> HWRM_PORT_PHY_CFG_IN_EN_FORCE_PAM4_LINK_SPEED;
>                                 req.force_pam4_link_speed =
>                                         rte_cpu_to_le_16(conf->link_speed);
> -                       }
> -                       req.force_link_speed =
> +                       } else {
> +                               req.force_link_speed =
>                                         rte_cpu_to_le_16(conf->link_speed);
> +                       }
>                 }
>                 /* AutoNeg - Advertise speeds specified. */
>                 if (conf->auto_link_speed_mask &&
> @@ -1370,6 +1371,11 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
>                     link_info->link_speed, link_info->auto_mode,
>                     link_info->auto_link_speed,
> link_info->auto_link_speed_mask,
>                     link_info->support_speeds,
> link_info->force_link_speed);
> +       PMD_DRV_LOG(DEBUG, "Link
> Signal:%d,PAM::Auto:%x,Support:%x,Force:%x\n",
> +                   link_info->link_signal_mode,
> +                   link_info->auto_pam4_link_speeds,
> +                   link_info->support_pam4_speeds,
> +                   link_info->force_pam4_link_speed);
>         return rc;
>  }
>
> @@ -3071,6 +3077,12 @@ 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_speeds == 0)
> +               autoneg = 0;
> +
>         speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds,
>                                           bp->link_info->link_signal_mode);
>         link_req.phy_flags = HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESET_PHY;
> @@ -3116,6 +3128,12 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool
> link_up)
>                         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
> +                * zero. Use the auto_link_speed.
> +                */
> +               if (bp->link_info->auto_link_speed != 0 &&
> +                   bp->link_info->auto_pam4_link_speeds == 0)
> +                       link_req.link_speed =
> bp->link_info->auto_link_speed;
>         }
>         link_req.duplex =
> bnxt_parse_eth_link_duplex(dev_conf->link_speeds);
>         link_req.auto_pause = bp->link_info->auto_pause;
> --
> 2.21.1 (Apple Git-122.3)
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-03  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02  2:43 [dpdk-dev] [PATCH] net/bnxt: fix PAM4 link negotiation Ajit Khaparde
2020-11-03  0:24 ` Ajit Khaparde

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git