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 D27CFA034C; Wed, 27 Apr 2022 17:00:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FA5A42839; Wed, 27 Apr 2022 16:58:50 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvsmtp11.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 28C7142833 for ; Wed, 27 Apr 2022 16:58:48 +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 B55D7C0000F2; Wed, 27 Apr 2022 07:58:46 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com B55D7C0000F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1651071527; bh=4OefILKLcfG/bLfcl3dvjGMtTtrN+gILkMBt8KQvYYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=poYhDrAgcTQxXx9WmV7LWXt1FUW95UatEzrN05BW2qOBlzBcP73rKzJ7msL6A2lkB u/wJl7iNac5tzG4TC/DBs5JjsYJOihwKlND/9PwPQelPS6IOwbxhowu7RHG8IvWXSs fNrD37HhP+FNPrRbJUOJM6y/kPjIsss9jna568Pw= From: Kalesh A P To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com Subject: [PATCH 13/17] net/bnxt: force PHY update on certain configurations Date: Wed, 27 Apr 2022 20:28:17 +0530 Message-Id: <20220427145821.5987-14-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 Device is not obliged link down in certain scenarios, even when forced. When FW does not allow any user other than the BMC to shutdown the port, bnxt_get_hwrm_link_config() call always returns link up. Force phy update always in that case, else user configuration for speed/autoneg would not get applied correctly. Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 3 +-- drivers/net/bnxt/bnxt_ethdev.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index e4e8e8e..e86e51e 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -72,8 +72,7 @@ #define BROADCOM_DEV_ID_58818_VF 0xd82e #define BROADCOM_DEV_957508_N2100 0x5208 -#define IS_BNXT_DEV_957508_N2100(bp) \ - ((bp)->pdev->id.subsystem_device_id == BROADCOM_DEV_957508_N2100) +#define BROADCOM_DEV_957414_N225 0x4145 #define BNXT_MAX_MTU 9574 #define BNXT_NUM_VLANS 2 diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 181de42..1904db9 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -659,6 +659,19 @@ static int bnxt_init_ctx_mem(struct bnxt *bp) return rc; } +static inline bool bnxt_force_link_config(struct bnxt *bp) +{ + uint16_t subsystem_device_id = bp->pdev->id.subsystem_device_id; + + switch (subsystem_device_id) { + case BROADCOM_DEV_957508_N2100: + case BROADCOM_DEV_957414_N225: + return true; + default: + return false; + } +} + static int bnxt_update_phy_setting(struct bnxt *bp) { struct rte_eth_link new; @@ -671,11 +684,12 @@ static int bnxt_update_phy_setting(struct bnxt *bp) } /* - * On BCM957508-N2100 adapters, FW will not allow any user other - * than BMC to shutdown the port. bnxt_get_hwrm_link_config() call - * always returns link up. Force phy update always in that case. + * Device is not obliged link down in certain scenarios, even + * when forced. When FW does not allow any user other than BMC + * to shutdown the port, bnxt_get_hwrm_link_config() call always + * returns link up. Force phy update always in that case. */ - if (!new.link_status || IS_BNXT_DEV_957508_N2100(bp)) { + if (!new.link_status || bnxt_force_link_config(bp)) { rc = bnxt_set_hwrm_link_config(bp, true); if (rc) { PMD_DRV_LOG(ERR, "Failed to update PHY settings\n"); -- 2.10.1