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 14F0AA0C40; Wed, 9 Jun 2021 04:52:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21DC941101; Wed, 9 Jun 2021 04:52:19 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.11.229]) by mails.dpdk.org (Postfix) with ESMTP id C5160410F1 for ; Wed, 9 Jun 2021 04:52:16 +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 6C9863C16F; Tue, 8 Jun 2021 19:52:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 6C9863C16F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1623207136; bh=qtxGEGPps1vePX8ECWwntkQ4ZC0oR4SWNmD+RsVru3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XyMstPeOYGu5D0Oh71Ys5wwAu6TctYERskrXHDXejLGtRVB0195iyQfI/VndXKJ3X vNn+i6INwcg03JNTdMCPinjMWElxuYC+WhFr3R4Y1DqLaQafZVcChAJHf+X0t1+FWm UbQkJdCWyZycmTPBxZH9ZzhGpndZj6kG6v5P25Ks= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Wed, 9 Jun 2021 08:43:31 +0530 Message-Id: <20210609031332.16739-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20210609031332.16739-1-kalesh-anakkur.purayil@broadcom.com> References: <20210609031332.16739-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 3/4] net/bnxt: fix enabling autoneg on Whitney+ 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 Sender: "dev" From: Kalesh AP Driver should enable autoneg on a port if FW supports it. Because of a wrong check, driver is not enabling autoneg on a port after setting forced speed on Whitney+. Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 5d34081..451a65d 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1489,6 +1489,7 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, link_info->support_speeds = rte_le_to_cpu_16(resp->support_speeds); link_info->auto_link_speed = rte_le_to_cpu_16(resp->auto_link_speed); + link_info->auto_link_speed_mask = rte_le_to_cpu_16(resp->auto_link_speed_mask); link_info->preemphasis = rte_le_to_cpu_32(resp->preemphasis); link_info->force_link_speed = rte_le_to_cpu_16(resp->force_link_speed); link_info->phy_ver[0] = resp->phy_maj; @@ -1543,6 +1544,12 @@ int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp) HWRM_UNLOCK(); + /* Older firmware does not have supported_auto_speeds, so assume + * that all supported speeds can be autonegotiated. + */ + if (link_info->auto_link_speed_mask && !link_info->support_auto_speeds) + link_info->support_auto_speeds = link_info->support_speeds; + return 0; } @@ -3243,15 +3250,8 @@ int bnxt_set_hwrm_link_config(struct bnxt *bp, bool link_up) 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; - /* Autoneg can be done only when the FW allows. - * When user configures fixed speed of 40G and later changes to - * any other speed, auto_link_speed/force_link_speed is still set - * to 40G until link comes up at new speed. - */ - if (autoneg == 1 && - !(!BNXT_CHIP_P5(bp) && - (bp->link_info->auto_link_speed || - bp->link_info->force_link_speed))) { + /* Autoneg can be done only when the FW allows. */ + if (autoneg == 1 && bp->link_info->support_auto_speeds) { link_req.phy_flags |= HWRM_PORT_PHY_CFG_INPUT_FLAGS_RESTART_AUTONEG; link_req.auto_link_speed_mask = -- 2.10.1