Skip to contentSkip to conversation

igc: Fix TX Hang issue when QBV Gate is close

PATCH Superseded Muhammad Husaini Zulkifli 2 participants 2 messages May 31, 2023 – Jun 1, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Fix TX Hang issue when QBV Gate is close

If a user schedules a Gate Control List (GCL) to close one of the QBV gates while also transmitting a packet to that closed gate, TX Hang will be happen. HW would not drop any packet when the gate is close and keep queueing up in HW TX FIFO until the gate is re-open. This patch implement the solution to drop the packet for the closed gate.

This patch will additionally include a reset adapter to perform SW initialization for each 1st Gate Control List (GCL) to avoid hang. This is due to the HW design, where changing to TSN transmit mode requires SW initialization. Intel Discrete I225/6 transmit mode cannot be changed when in dynamic mode according to Software User Manual Section 7.5.2.1. Subsequent Gate Control List (GCL) operations will proceed without a reset, as they already in TSN Mode.

Step to reproduce:

DUT:
1) Configure GCL List with certain gate close.
2) Transmit the packet to close gate.

Fixes ec50a9d437f0 ("igc: Add support for taprio offloading")
---
 drivers/net/ethernet/intel/igc/igc.h      |  6 +++
 drivers/net/ethernet/intel/igc/igc_main.c | 57 +++++++++++++++++++++--
 drivers/net/ethernet/intel/igc/igc_tsn.c  | 41 ++++++++++------
 3 files changed, 87 insertions(+), 17 deletions(-)
drivers/net/ethernet/intel/igc/igc.h +6 -0
index cb5751fab03c9..866b41a92cf8a 100644
@@ -14,6 +14,7 @@
 #include <linux/timecounter.h>
 #include <linux/net_tstamp.h>
 #include <linux/bitfield.h>
+#include <linux/hrtimer.h>
 
 #include "igc_hw.h"
 
@@ -101,6 +102,8 @@ struct igc_ring {
 	u32 start_time;
 	u32 end_time;
 	u32 max_sdu;
+	bool oper_gate_closed;
+	bool admin_gate_closed;
 
 	/* CBS parameters */
 	bool cbs_enable;                /* indicates if CBS is enabled */
@@ -160,6 +163,7 @@ struct igc_adapter {
 	struct timer_list watchdog_timer;
 	struct timer_list dma_err_timer;
 	struct timer_list phy_info_timer;
+	struct hrtimer hrtimer;
 
 	u32 wol;
 	u32 en_mng_pt;
@@ -189,6 +193,8 @@ struct igc_adapter {
 	ktime_t cycle_time;
 	bool qbv_enable;
 	u32 qbv_config_change_errors;
+	bool qbv_transition;
+	int qbv_count;
 
 	/* OS defined structs */
 	struct pci_dev *pdev;
drivers/net/ethernet/intel/igc/igc_main.c +54 -3

124 lines not on this page · raw message

drivers/net/ethernet/intel/igc/igc_tsn.c +27 -14

69 lines not on this page · raw message

Signature · 6 lines
2.17.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
maintainer
#1 lore raw
Quoted 15 lines · Muhammad Husaini Zulkifli

If a user schedules a Gate Control List (GCL) to close one of the QBV gates while also transmitting a packet to that closed gate, TX Hang will be happen. HW would not drop any packet when the gate is close and keep queueing up in HW TX FIFO until the gate is re-open. This patch implement the solution to drop the packet for the closed gate.

This patch will additionally include a reset adapter to perform SW initialization for each 1st Gate Control List (GCL) to avoid hang. This is due to the HW design, where changing to TSN transmit mode requires SW initialization. Intel Discrete I225/6 transmit mode cannot be changed when in dynamic mode according to Software User Manual Section 7.5.2.1. Subsequent Gate Control List (GCL) operations will proceed without a reset, as they already in TSN Mode.

Quoted 5 lines

Step to reproduce:

DUT:
1) Configure GCL List with certain gate close.
2) Transmit the packet to close gate.

This patch doesn't apply.

Quoted 5 lines
Fixes ec50a9d437f0 ("igc: Add support for taprio offloading")

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan