patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>, stable@dpdk.org
Subject: [PATCH 1/9] net/txgbe: fix Tx failure with fiber hotplug
Date: Wed, 14 Jun 2023 10:34:21 +0800	[thread overview]
Message-ID: <20230614023429.1002071-2-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20230614023429.1002071-1-jiawenwu@trustnetic.com>

Under heavy traffic, unpluging and pluging fiber optic cables may cause Tx
failure. The reason is that there is still traffic passing through at PCS
VR reset, during txgbe_set_link_to_*. So totally disable Rx and Tx before
PCS VR reset to fix it.

Fixes: 01c3cf5c85a7 ("net/txgbe: add autoneg control read and write")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_phy.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c
index f4cadcc510..1eb45b068a 100644
--- a/drivers/net/txgbe/base/txgbe_phy.c
+++ b/drivers/net/txgbe/base/txgbe_phy.c
@@ -1541,8 +1541,9 @@ txgbe_set_link_to_kx4(struct txgbe_hw *hw, bool autoneg)
 		goto out;
 	}
 
-	wr32m(hw, TXGBE_MACTXCFG, TXGBE_MACTXCFG_TXE,
-			~TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACTXCFG, TXGBE_MACTXCFG_TXE, ~TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACRXCFG, TXGBE_MACRXCFG_ENA, ~TXGBE_MACRXCFG_ENA);
+	hw->mac.disable_sec_tx_path(hw);
 
 	/* 2. Disable xpcs AN-73 */
 	if (!autoneg)
@@ -1756,8 +1757,9 @@ txgbe_set_link_to_kx(struct txgbe_hw *hw,
 		goto out;
 	}
 
-	wr32m(hw, TXGBE_MACTXCFG, TXGBE_MACTXCFG_TXE,
-				~TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACTXCFG, TXGBE_MACTXCFG_TXE, ~TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACRXCFG, TXGBE_MACRXCFG_ENA, ~TXGBE_MACRXCFG_ENA);
+	hw->mac.disable_sec_tx_path(hw);
 
 	/* 2. Disable xpcs AN-73 */
 	if (!autoneg)
@@ -1963,8 +1965,9 @@ txgbe_set_link_to_sfi(struct txgbe_hw *hw,
 		goto out;
 	}
 
-	wr32m(hw, TXGBE_MACTXCFG, TXGBE_MACTXCFG_TXE,
-			~TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACTXCFG, TXGBE_MACTXCFG_TXE, ~TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACRXCFG, TXGBE_MACRXCFG_ENA, ~TXGBE_MACRXCFG_ENA);
+	hw->mac.disable_sec_tx_path(hw);
 
 	/* 2. Disable xpcs AN-73 */
 	wr32_epcs(hw, SR_AN_CTRL, 0x0);
@@ -2315,6 +2318,8 @@ void txgbe_autoc_write(struct txgbe_hw *hw, u64 autoc)
 			txgbe_set_sgmii_an37_ability(hw);
 	}
 
+	hw->mac.enable_sec_tx_path(hw);
+
 	if (speed == TXGBE_LINK_SPEED_10GB_FULL)
 		mactxcfg = TXGBE_MACTXCFG_SPEED_10G;
 	else if (speed == TXGBE_LINK_SPEED_1GB_FULL)
@@ -2324,6 +2329,7 @@ void txgbe_autoc_write(struct txgbe_hw *hw, u64 autoc)
 	wr32m(hw, TXGBE_MACTXCFG,
 		TXGBE_MACTXCFG_SPEED_MASK | TXGBE_MACTXCFG_TXE,
 		mactxcfg | TXGBE_MACTXCFG_TXE);
+	wr32m(hw, TXGBE_MACRXCFG, TXGBE_MACRXCFG_ENA, TXGBE_MACRXCFG_ENA);
 }
 
 void txgbe_bp_down_event(struct txgbe_hw *hw)
-- 
2.27.0


       reply	other threads:[~2023-06-14  2:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230614023429.1002071-1-jiawenwu@trustnetic.com>
2023-06-14  2:34 ` Jiawen Wu [this message]
2023-06-14  2:34 ` [PATCH 2/9] net/txgbe: fix interrupt enable mask Jiawen Wu
2023-06-14  2:34 ` [PATCH 3/9] net/txgbe: fix issues caused by MNG veto bit setting Jiawen Wu
2023-06-14  2:34 ` [PATCH 4/9] net/txgbe: fix to set autoneg for 1G speed Jiawen Wu
2023-06-14  2:34 ` [PATCH 5/9] net/txgbe: fix device extended stats Jiawen Wu
2023-06-14  2:34 ` [PATCH 6/9] net/ngbe: " Jiawen Wu
2023-06-14  2:34 ` [PATCH 7/9] net/ngbe: fix issues caused by MNG veto bit setting Jiawen Wu
2023-06-14  2:34 ` [PATCH 8/9] net/ngbe: fix link status in no LSC mode Jiawen Wu
2023-06-14  2:34 ` [PATCH 9/9] net/ngbe: remove redundant codes Jiawen Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230614023429.1002071-2-jiawenwu@trustnetic.com \
    --to=jiawenwu@trustnetic.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).