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 41909A00C5; Tue, 4 Jan 2022 09:20:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5588E4115D; Tue, 4 Jan 2022 09:19:36 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id C6F894120A for ; Tue, 4 Jan 2022 09:19:34 +0100 (CET) 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 28645C0000F2; Tue, 4 Jan 2022 00:19:32 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 28645C0000F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1641284374; bh=QyzkscEPAAEPfd+12pkuMAwYYqoCkliZ4gW5OO64MaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fy3VtP/zlrq4ws2UqOj5ui5koILkgiaL9MzLlIEWEf4qF0NwHdb8Wu0iEZV1kQmiS uu+zuCp9j1dSSFYsNPNBja2bSflS2qeopfNG+F0Oi6eHIHZXE0bC/8YRCx7MskvvZ2 p+tWrTNJJl0tMvQO8tS1kKe899RgUcvoaB4mGY2E= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Subject: [dpdk-dev] [PATCH 15/18] net/bnxt: fix PAM4 mask setting Date: Tue, 4 Jan 2022 14:08:21 +0530 Message-Id: <20220104083824.23001-16-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220104083824.23001-1-kalesh-anakkur.purayil@broadcom.com> References: <20220104083824.23001-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: Ajit Khaparde Set the PAM4 mask setting only when PAM4 signaling is enabled. Setting it otherwise seems to result in link negotiation. Also auto_pam4_link_speeds has been renamed to auto_pam4_link_speed_mask to reflect its real usage. Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde Reviewed-by: Kalesh AP Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_hwrm.c | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 9c0dbc6..433f1c8 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -297,7 +297,7 @@ struct bnxt_link_info { uint8_t link_signal_mode; uint16_t force_pam4_link_speed; uint16_t support_pam4_speeds; - uint16_t auto_pam4_link_speeds; + uint16_t auto_pam4_link_speed_mask; uint16_t support_pam4_auto_speeds; uint8_t req_signal_mode; uint8_t module_status; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 86997f5..a59e436 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1436,16 +1436,17 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf) !(conf->phy_flags & HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE)) { req.auto_mode = HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK; - req.auto_link_speed_mask = - conf->auto_link_speed_mask; - if (conf->auto_pam4_link_speeds) { + if (conf->auto_pam4_link_speed_mask && + bp->link_info->link_signal_mode) { enables |= HWRM_PORT_PHY_CFG_IN_EN_AUTO_PAM4_LINK_SPD_MASK; req.auto_link_pam4_speed_mask = - conf->auto_pam4_link_speeds; + rte_cpu_to_le_16(conf->auto_pam4_link_speed_mask); } else { enables |= HWRM_PORT_PHY_CFG_IN_EN_AUTO_LINK_SPEED_MASK; + req.auto_link_speed_mask = + rte_cpu_to_le_16(conf->auto_link_speed_mask); } } if (conf->auto_link_speed && @@ -1518,7 +1519,7 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, rte_le_to_cpu_16(resp->force_pam4_link_speed); link_info->support_pam4_speeds = rte_le_to_cpu_16(resp->support_pam4_speeds); - link_info->auto_pam4_link_speeds = + link_info->auto_pam4_link_speed_mask = rte_le_to_cpu_16(resp->auto_pam4_link_speed_mask); link_info->module_status = resp->module_status; HWRM_UNLOCK(); @@ -1529,7 +1530,7 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, 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->auto_pam4_link_speed_mask, link_info->support_pam4_speeds, link_info->force_pam4_link_speed); return rc; @@ -3245,7 +3246,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up) /* 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) + bp->link_info->auto_pam4_link_speed_mask == 0) autoneg = 0; speed = bnxt_parse_eth_link_speed(dev_conf->link_speeds, @@ -3258,8 +3259,8 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up) link_req.auto_link_speed_mask = bnxt_parse_eth_link_speed_mask(bp, dev_conf->link_speeds); - link_req.auto_pam4_link_speeds = - bp->link_info->auto_pam4_link_speeds; + link_req.auto_pam4_link_speed_mask = + bp->link_info->auto_pam4_link_speed_mask; } else { if (bp->link_info->phy_type == HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET || @@ -3278,9 +3279,9 @@ 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->auto_pam4_link_speeds) + else if (bp->link_info->auto_pam4_link_speed_mask) link_req.link_speed = - bp->link_info->auto_pam4_link_speeds; + 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; @@ -3292,7 +3293,7 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up) * zero. Use the auto_link_speed. */ if (bp->link_info->auto_link_speed != 0 && - bp->link_info->auto_pam4_link_speeds == 0) + bp->link_info->auto_pam4_link_speed_mask == 0) link_req.link_speed = bp->link_info->auto_link_speed; } link_req.duplex = bnxt_parse_eth_link_duplex(dev_conf->link_speeds); -- 2.10.1