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 D9FBEA034C; Wed, 27 Apr 2022 17:00:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BF9542834; Wed, 27 Apr 2022 16:58:49 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id BF1A742831 for ; Wed, 27 Apr 2022 16:58:46 +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 57130C0000E8; Wed, 27 Apr 2022 07:58:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 57130C0000E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1651071526; bh=cXVyRRJ4u3nOv6vWjdchCmJOVbhb0yjfO+A9sYBJ/hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLdPvbWlLqk+9fCF88qdVbjkchuI2Mj/iOQPyt5WXfePPQ4sSman353j9G9Hb7bIu 1caJ6lK1RJikVDMJesUfC/7Z6yeh/Syx169wQiKhZ/utiXyQMiMBLS11Rbn3XqZeAd oHYUOQ18MifbjeNNrp9UmfiEOH2kSQOYWGaKikSQ= From: Kalesh A P To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com Subject: [PATCH 12/17] net/bnxt: fix setting autoneg speed Date: Wed, 27 Apr 2022 20:28:16 +0530 Message-Id: <20220427145821.5987-13-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> References: <20220427145821.5987-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 autoneg speed. While setting autoneg speed, driver is currently checking only "auto_link_speed_mask". Fixed to check "auto_pam4_link_speed_mask" as well. Also, while setting auto mode and setting speed mask, driver will have to set both NRZ and PAM4 mask. 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_hwrm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index d87f0c3..9eb8b8d 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1424,17 +1424,17 @@ static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp, struct bnxt_link_info *conf) } } /* AutoNeg - Advertise speeds specified. */ - if (conf->auto_link_speed_mask && + if ((conf->auto_link_speed_mask || conf->auto_pam4_link_speed_mask) && !(conf->phy_flags & HWRM_PORT_PHY_CFG_INPUT_FLAGS_FORCE)) { req.auto_mode = HWRM_PORT_PHY_CFG_INPUT_AUTO_MODE_SPEED_MASK; - if (conf->auto_pam4_link_speed_mask && - bp->link_info->link_signal_mode) { + if (conf->auto_pam4_link_speed_mask) { enables |= HWRM_PORT_PHY_CFG_IN_EN_AUTO_PAM4_LINK_SPD_MASK; req.auto_link_pam4_speed_mask = rte_cpu_to_le_16(conf->auto_pam4_link_speed_mask); - } else { + } + if (conf->auto_link_speed_mask) { enables |= HWRM_PORT_PHY_CFG_IN_EN_AUTO_LINK_SPEED_MASK; req.auto_link_speed_mask = -- 2.10.1