The link alarm retry calls mac.setup_link() with
autoneg_wait_to_complete = false. On the AN73/xpcs path, this skips
reconfiguration once the link is up and AN is complete. Passing true
from the retry path instead resets an established AN73 link, which
then drops and may not recover after DAC hot-plug.

The setup flag is also passed to txgbe_e56_set_phy_link_mode() as its
need_restart argument. Passing false unchanged would make a retry a
no-op while the link is down or AN is incomplete if the PHY is already
in 10G mode. Pass true there: the early return above already covers an
established link, so every path that reaches this point needs the
restart.

Fixes: 6104fd11086e ("net/txgbe: fix link stability for 25G NIC")
Cc: [email protected]

Signed-off-by: Zaiyu Wang <[email protected]>
---
 drivers/net/txgbe/base/txgbe_aml.c   | 3 ++-
 drivers/net/txgbe/base/txgbe_aml40.c | 3 ++-
 drivers/net/txgbe/txgbe_ethdev.c     | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_aml.c 
b/drivers/net/txgbe/base/txgbe_aml.c
index ac80d85f08..de4db31cf8 100644
--- a/drivers/net/txgbe/base/txgbe_aml.c
+++ b/drivers/net/txgbe/base/txgbe_aml.c
@@ -246,8 +246,9 @@ s32 txgbe_setup_phy_link_aml(struct txgbe_hw *hw,
                txgbe_e56_check_phy_link(hw, &link_speed, &link_up);
                if (link_up && hw->an_done && !autoneg_wait_to_complete)
                        return status;
+
                rte_spinlock_lock(&hw->phy_lock);
-               txgbe_e56_set_phy_link_mode(hw, speed, 
autoneg_wait_to_complete);
+               txgbe_e56_set_phy_link_mode(hw, speed, true);
                rte_spinlock_unlock(&hw->phy_lock);
                return 0;
        }
diff --git a/drivers/net/txgbe/base/txgbe_aml40.c 
b/drivers/net/txgbe/base/txgbe_aml40.c
index 5fa7c6a243..ab7012608f 100644
--- a/drivers/net/txgbe/base/txgbe_aml40.c
+++ b/drivers/net/txgbe/base/txgbe_aml40.c
@@ -171,8 +171,9 @@ s32 txgbe_setup_phy_link_aml40(struct txgbe_hw *hw,
                txgbe_e56_check_phy_link(hw, &link_speed, &link_up);
                if (link_up && hw->an_done && !autoneg_wait_to_complete)
                        return status;
+
                rte_spinlock_lock(&hw->phy_lock);
-               txgbe_e56_set_phy_link_mode(hw, speed, 
autoneg_wait_to_complete);
+               txgbe_e56_set_phy_link_mode(hw, speed, true);
                rte_spinlock_unlock(&hw->phy_lock);
                return status;
        }
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index f20e57125d..2f513e20b9 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -3228,7 +3228,7 @@ txgbe_dev_setup_link_alarm_handler_aml(void *param)
                return;
        }
 
-       hw->mac.setup_link(hw, speed, true);
+       hw->mac.setup_link(hw, speed, false);
 
        u32 link_speed = TXGBE_LINK_SPEED_UNKNOWN;
        bool link_up = false;
-- 
2.55.0.windows.2

Reply via email to