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 2E9C3A0548; Wed, 15 Jun 2022 16:58:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CB2E42B95; Wed, 15 Jun 2022 16:57:52 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 753E342B8E for ; Wed, 15 Jun 2022 16:57:49 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id C09C9C0000E6; Wed, 15 Jun 2022 07:57:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com C09C9C0000E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1655305068; bh=U/Yr7RHdaYZtrxDWRn4VuywKNXBAjPqgXQ4+lVAcwI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGVt1VJ+3ov527H7KLU2YdcoXuC7wdxMvgCRsjBhbJvhYtVS6/+bOidwn139xeasQ 6kfkNeiqZNvIRyNrZ8ouyXXqXwO+YORdUZ0bj9SKGw4KSrVXL/ZIh+27b5ByAgAIvx sScjP8loAeyvnJxQU7XjmNOQ5GfVArX2hfysn970= From: Kalesh A P 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 Message-Id: <20220615145703.6613-6-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220615145703.6613-1-kalesh-anakkur.purayil@broadcom.com> References: <20220615145703.6613-1-kalesh-anakkur.purayil@broadcom.com> 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 From: Kalesh AP 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 Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- 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