> -----Original Message----- > From: Hay, Joshua A <joshua.a....@intel.com> > Sent: Tuesday, December 3, 2024 9:53 AM > To: Lobakin, Aleksander <aleksander.loba...@intel.com> > Cc: intel-wired-...@lists.osuosl.org; Kitszel, Przemyslaw > <przemyslaw.kits...@intel.com>; Kubiak, Michal <michal.kub...@intel.com>; > Chittim, Madhu <madhu.chit...@intel.com>; net...@vger.kernel.org > Subject: RE: [Intel-wired-lan][PATCH iwl-net 2/2] idpf: trigger SW interrupt > when exiting wb_on_itr mode > > > From: Lobakin, Aleksander <aleksander.loba...@intel.com> > > Cc: intel-wired-...@lists.osuosl.org; Kitszel, Przemyslaw > > <przemyslaw.kits...@intel.com>; Kubiak, Michal > <michal.kub...@intel.com>; > > Chittim, Madhu <madhu.chit...@intel.com>; net...@vger.kernel.org > > Subject: Re: [Intel-wired-lan][PATCH iwl-net 2/2] idpf: trigger SW interrupt > > when exiting wb_on_itr mode > > > > From: Joshua Hay <joshua.a....@intel.com> > > Date: Mon, 25 Nov 2024 15:58:55 -0800 > > > > > There is a race condition between exiting wb_on_itr and completion write > > > backs. For example, we are in wb_on_itr mode and a Tx completion is > > > generated by HW, ready to be written back, as we are re-enabling > > > interrupts: > > > > > > HW SW > > > | | > > > | | idpf_tx_splitq_clean_all > > > | | napi_complete_done > > > | | > > > | tx_completion_wb | idpf_vport_intr_update_itr_ena_irq > > > > > > That tx_completion_wb happens before the vector is fully re-enabled. > > > Continuing with this example, it is a UDP stream and the > > > tx_completion_wb is the last one in the flow (there are no rx packets). > > > Because the HW generated the completion before the interrupt is fully > > > enabled, the HW will not fire the interrupt once the timer expires and > > > the write back will not happen. NAPI poll won't be called. We have > > > indicated we're back in interrupt mode but nothing else will trigger the > > > interrupt. Therefore, the completion goes unprocessed, triggering a Tx > > > timeout. > > > > > > To mitigate this, fire a SW triggered interrupt upon exiting wb_on_itr. > > > This interrupt will catch the rogue completion and avoid the timeout. > > > Add logic to set the appropriate bits in the vector's dyn_ctl register. > > > > > > Fixes: 9c4a27da0ecc ("idpf: enable WB_ON_ITR") > > > Reviewed-by: Madhu Chittim <madhu.chit...@intel.com> > > > Signed-off-by: Joshua Hay <joshua.a....@intel.com> > > > --- > > > drivers/net/ethernet/intel/idpf/idpf_txrx.c | 30 ++++++++++++++------- > > > 1 file changed, 20 insertions(+), 10 deletions(-) > > > > > > diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c > > b/drivers/net/ethernet/intel/idpf/idpf_txrx.c > > > index a8989dd98272..9558b90469c8 100644 > > > --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c > > > +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c > > > @@ -3604,21 +3604,32 @@ static void idpf_vport_intr_dis_irq_all(struct
Tested-by: Krishneil Singh <krishneil.k.si...@intel.com>