Thread (21 messages) 21 messages, 3 authors, 25d ago

RE: [PATCH net-next v4 4/5] net: wangxun: introduce soft quiesce callbacks for AER recovery

From: Loktionov, Aleksandr <hidden>
Date: 2026-06-01 10:09:29

quoted hunk ↗ jump to hunk
-----Original Message-----
From: Jiawen Wu <jiawenwu@trustnetic.com>
Sent: Monday, June 1, 2026 9:22 AM
To: netdev@vger.kernel.org
Cc: Mengyuan Lou <mengyuanlou@net-swift.com>; Andrew Lunn
[off-list ref]; David S. Miller [off-list ref]; Eric
Dumazet [off-list ref]; Jakub Kicinski [off-list ref]; Paolo
Abeni [off-list ref]; Richard Cochran [off-list ref];
Russell King [off-list ref]; Keller, Jacob E
[off-list ref]; Michal Swiatkowski
[off-list ref]; Simon Horman [off-list ref];
Kees Cook [off-list ref]; Zaremba, Larysa
[off-list ref]; Ingo Molnar [off-list ref]; Joe Damato
[off-list ref]; Breno Leitao [off-list ref]; Loktionov, Aleksandr
[off-list ref]; Uwe Kleine-König (The Capable Hub)
[off-list ref]; Johannes Berg
[off-list ref]; Fabio Baltieri
[off-list ref]; Jiawen Wu [off-list ref]
Subject: [PATCH net-next v4 4/5] net: wangxun: introduce soft quiesce
callbacks for AER recovery

Introduce device-specific soft quiesce callbacks for ngbe and txgbe to
provide a lightweight shutdown path during PCI error recovery. It
avoids MMIO-dependent operations in PCI error status, for the later
implementation of PCIe error callback function in libwx.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ethernet/wangxun/libwx/wx_type.h  |  1 +
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 23 +++++++++++++++++++
 .../net/ethernet/wangxun/txgbe/txgbe_main.c   | 22 ++++++++++++++++++
 3 files changed, 46 insertions(+)
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_type.h
b/drivers/net/ethernet/wangxun/libwx/wx_type.h
index a8b4e84787f4..1b25a52188f7 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_type.h
+++ b/drivers/net/ethernet/wangxun/libwx/wx_type.h
@@ -1409,6 +1409,7 @@ struct wx {
 	void (*configure_fdir)(struct wx *wx);
 	int (*setup_tc)(struct net_device *netdev, u8 tc);
 	void (*do_reset)(struct net_device *netdev, bool reinit);
+	void (*soft_quiesce)(struct wx *wx);
 	int (*ptp_setup_sdp)(struct wx *wx);
 	void (*set_num_queues)(struct wx *wx);
diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
index 3dc8342dd3a7..2484d3177034 100644
--- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
+++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
@@ -47,6 +47,28 @@ static const struct pci_device_id ngbe_pci_tbl[] =
{
 	{ }
 };

+static void ngbe_soft_quiesce(struct wx *wx) {
+	if (test_and_set_bit(WX_STATE_DOWN, wx->state))
+		return;
+
+	wx_ptp_stop(wx);
+	phylink_stop(wx->phylink);
+	pci_clear_master(wx->pdev);
+	wx_napi_disable_all(wx);
+
+	clear_bit(WX_FLAG_NEED_PF_RESET, wx->flags);
+	timer_delete_sync(&wx->service_timer);
Can you exlplain how do you handle service_task work item that was ALREADY QUEUED before
timer_delete_sync()? Because they are NOT cancelled here.
+
+	wx_clean_all_tx_rings(wx);
+	wx_clean_all_rx_rings(wx);
+
+	wx_free_irq(wx);
+	wx_free_isb_resources(wx);
+	wx_free_resources(wx);
+	phylink_disconnect_phy(wx->phylink);
+}
...
quoted hunk ↗ jump to hunk
 /**
  *  txgbe_init_type_code - Initialize the shared code
  *  @wx: pointer to hardware structure
@@ -412,6 +433,7 @@ static int txgbe_sw_init(struct wx *wx)

 	wx->setup_tc = txgbe_setup_tc;
 	wx->do_reset = txgbe_do_reset;
+	wx->soft_quiesce = txgbe_soft_quiesce;
 	set_bit(0, &wx->fwd_bitmask);

 	switch (wx->mac.type) {
--
2.51.0
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help