net/bnxt: force PHY update on certain configurations
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Wed, 27 Apr 2022 14:58:17 +0000 (20:28 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 10 May 2022 05:13:48 +0000 (07:13 +0200)
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 <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c

index e4e8e8e..e86e51e 100644 (file)
@@ -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
index 181de42..1904db9 100644 (file)
@@ -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");