[Intel-wired-lan] [PATCH iwl-net v2] igc: Fix TX Hang issue when QBV Gate is close

Zulkifli, Muhammad Husaini muhammad.husaini.zulkifli at intel.com
Sat Jun 3 09:46:37 UTC 2023


Dear Anthony,

> -----Original Message-----
> From: Nguyen, Anthony L <anthony.l.nguyen at intel.com>
> Sent: Saturday, 3 June, 2023 1:46 AM
> To: Zulkifli, Muhammad Husaini <muhammad.husaini.zulkifli at intel.com>; intel-
> wired-lan at osuosl.org
> Cc: Gomes, Vinicius <vinicius.gomes at intel.com>; Neftin, Sasha
> <sasha.neftin at intel.com>; tee.min.tan at linux.intel.com; Choong, Chwee Lin
> <chwee.lin.choong at intel.com>; naamax.meir at linux.intel.com
> Subject: Re: [PATCH iwl-net v2] igc: Fix TX Hang issue when QBV Gate is close
> 
> 
> 
> 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.

Ops. OK will remove it.

> 
> > ---
> 
> ...
> 
>  > V1 -> V2: Fix conflict and apply to net-queue tree.
>  > ---
>  > ---
> 
> no need for two '---'

Yup. Will remove this double line.

> 
> > @@ -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.

I will move "if (adapter->qbv_transition || tx_ring->oper_gate_closed)" to Line 1575 below 
to avoid this warning. 
My environment is unable to run CC=clang. But I believe this will resolve the issue.

Thanks,
Husaini

> 
> 
> >   	/* 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