Zdenek Bouska <[email protected]> writes: > If an XDP application that requested TX timestamping is shutting down > while the link of the interface in use is still up the following kernel > splat is reported: > > [ 883.803618] [ T1554] BUG: unable to handle page fault for address: > ffffcfb6200fd008 > ... > [ 883.803650] [ T1554] Call Trace: > [ 883.803652] [ T1554] <TASK> > [ 883.803654] [ T1554] igc_ptp_tx_tstamp_event+0xdf/0x160 [igc] > [ 883.803660] [ T1554] igc_tsync_interrupt+0x2d5/0x300 [igc] > ... > > During shutdown of the TX ring the xsk_meta pointers are left behind, so > that the IRQ handler is trying to touch them. > > This issue is now being fixed by cleaning up the stale xsk meta data on > TX shutdown. TX timestamps on other queues remain unaffected. > > Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP > zero-copy packet") > Signed-off-by: Zdenek Bouska <[email protected]> > --- > drivers/net/ethernet/intel/igc/igc.h | 2 ++ > drivers/net/ethernet/intel/igc/igc_main.c | 7 +++++++ > drivers/net/ethernet/intel/igc/igc_ptp.c | 33 > +++++++++++++++++++++++++++++++ > 3 files changed, 42 insertions(+) > > diff --git a/drivers/net/ethernet/intel/igc/igc.h > b/drivers/net/ethernet/intel/igc/igc.h > index > a427f05814c1ae7330c6f7034cd0f2b40b74dab6..17236813965d334f14eba928affbd4f91b96ecd4 > 100644 > --- a/drivers/net/ethernet/intel/igc/igc.h > +++ b/drivers/net/ethernet/intel/igc/igc.h > @@ -781,6 +781,8 @@ int igc_ptp_hwtstamp_set(struct net_device *netdev, > struct kernel_hwtstamp_config *config, > struct netlink_ext_ack *extack); > void igc_ptp_tx_hang(struct igc_adapter *adapter); > +void igc_ptp_clear_xsk_tx_tstamp_queue(struct igc_adapter *adapter, > + u16 queue_id); > void igc_ptp_read(struct igc_adapter *adapter, struct timespec64 *ts); > void igc_ptp_tx_tstamp_event(struct igc_adapter *adapter); > > diff --git a/drivers/net/ethernet/intel/igc/igc_main.c > b/drivers/net/ethernet/intel/igc/igc_main.c > index > 89a321a344d263ace5c66f7ade782b40cc482566..570e90fab67d653bbbb242d242d0b64a49fba602 > 100644 > --- a/drivers/net/ethernet/intel/igc/igc_main.c > +++ b/drivers/net/ethernet/intel/igc/igc_main.c > @@ -193,6 +193,7 @@ static void igc_unmap_tx_buffer(struct device *dev, > struct igc_tx_buffer *buf) > */ > static void igc_clean_tx_ring(struct igc_ring *tx_ring) > { > + struct igc_adapter *adapter; > u16 i = tx_ring->next_to_clean; > struct igc_tx_buffer *tx_buffer = &tx_ring->tx_buffer_info[i]; > u32 xsk_frames = 0; > @@ -264,6 +265,12 @@ static void igc_clean_tx_ring(struct igc_ring *tx_ring) > /* reset next_to_use and next_to_clean */ > tx_ring->next_to_use = 0; > tx_ring->next_to_clean = 0; > + > + /* Clear any lingering XSK TX timestamp requests */ > + if (test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags)) {
minor: move the 'adapter' declaration here. But I will leave that to up to you, Acked-by: Vinicius Costa Gomes <[email protected]> Cheers, -- Vinicius
