[Intel-wired-lan] [PATCH iwl-net v2] igc: Fix TX Hang issue when QBV Gate is close
Tony Nguyen
anthony.l.nguyen at intel.com
Fri Jun 2 17:45:34 UTC 2023
On 6/1/2023 6:28 PM, Muhammad Husaini Zulkifli wrote:
> 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")
> Co-developed-by: Tan Tee Min <tee.min.tan at linux.intel.com>
> Signed-off-by: Tan Tee Min <tee.min.tan at linux.intel.com>
> Tested-by: Chwee Lin Choong <chwee.lin.choong at intel.com>
> Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli at intel.com>
>
No newline here please.
> ---
...
> V1 -> V2: Fix conflict and apply to net-queue tree.
> ---
> ---
no need for two '---'
> @@ -1521,6 +1521,9 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
> u8 hdr_len = 0;
> int tso = 0;
>
> + if (adapter->qbv_transition || tx_ring->oper_gate_closed)
> + goto out_drop;
> +
clang reports issues with this:
+../drivers/net/ethernet/intel/igc/igc_main.c:1524:6: warning: variable
'first' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
+ if (adapter->qbv_transition || tx_ring->oper_gate_closed)
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+../drivers/net/ethernet/intel/igc/igc_main.c:1632:20: note:
uninitialized use occurs here
+ dev_kfree_skb_any(first->skb);
+ ^~~~~
+../drivers/net/ethernet/intel/igc/igc_main.c:1524:2: note: remove the
'if' if its condition is always false
+ if (adapter->qbv_transition || tx_ring->oper_gate_closed)
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+../drivers/net/ethernet/intel/igc/igc_main.c:1524:6: warning: variable
'first' is used uninitialized whenever '||' condition is true
[-Wsometimes-uninitialized]
+ if (adapter->qbv_transition || tx_ring->oper_gate_closed)
+ ^~~~~~~~~~~~~~~~~~~~~~~
+../drivers/net/ethernet/intel/igc/igc_main.c:1632:20: note:
uninitialized use occurs here
+ dev_kfree_skb_any(first->skb);
+ ^~~~~
+../drivers/net/ethernet/intel/igc/igc_main.c:1524:6: note: remove the
'||' if its condition is always false
+ if (adapter->qbv_transition || tx_ring->oper_gate_closed)
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
+../drivers/net/ethernet/intel/igc/igc_main.c:1516:29: note: initialize
the variable 'first' to silence this warning
+ struct igc_tx_buffer *first;
+ ^
+ = NULL
+2 warnings generated.
> /* need: 1 descriptor per page * PAGE_SIZE/IGC_MAX_DATA_PER_TXD,
> * + 1 desc for skb_headlen/IGC_MAX_DATA_PER_TXD,
> * + 2 desc gap to keep tail from touching head,
More information about the Intel-wired-lan
mailing list