* [PATCH v2] igc: fix page fault in XDP TX timestamps handling
@ 2026-02-25 9:58 Zdenek Bouska
2026-02-25 10:50 ` [Intel-wired-lan] " Paul Menzel
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Zdenek Bouska @ 2026-02-25 9:58 UTC (permalink / raw)
To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexei Starovoitov,
Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
Stanislav Fomichev, Richard Cochran, Song Yoong Siang,
Lai Peter Jun Ann
Cc: Vinicius Costa Gomes, intel-wired-lan, netdev, linux-kernel, bpf,
Florian Bezdeka, Zdenek Bouska
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 <zdenek.bouska@siemens.com>
---
Changes in v2:
- Moved 'adapter' variable declaration into the if block (Vinicius)
- Link to v1: https://lore.kernel.org/r/20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com
---
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..1931fcb659354d5009e0ea02316bf3a47b66b04d 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -264,6 +264,13 @@ 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)) {
+ struct igc_adapter *adapter = netdev_priv(tx_ring->netdev);
+
+ igc_ptp_clear_xsk_tx_tstamp_queue(adapter, tx_ring->queue_index);
+ }
}
/**
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 7aae83c108fd7611b00bf075592f93a902b83422..98491346d21b80925ce42ba276d851d4318e66b7 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -576,6 +576,39 @@ static void igc_ptp_clear_tx_tstamp(struct igc_adapter *adapter)
spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
}
+/**
+ * igc_ptp_clear_xsk_tx_tstamp_queue - Clear pending XSK TX timestamps for a queue
+ * @adapter: Board private structure
+ * @queue_id: TX queue index to clear timestamps for
+ *
+ * Iterates over all TX timestamp registers and releases any pending
+ * timestamp requests associated with the given TX queue. This is
+ * called when an XDP pool is being disabled to ensure no stale
+ * timestamp references remain.
+ */
+void igc_ptp_clear_xsk_tx_tstamp_queue(struct igc_adapter *adapter, u16 queue_id)
+{
+ unsigned long flags;
+ int i;
+
+ spin_lock_irqsave(&adapter->ptp_tx_lock, flags);
+
+ for (i = 0; i < IGC_MAX_TX_TSTAMP_REGS; i++) {
+ struct igc_tx_timestamp_request *tstamp = &adapter->tx_tstamp[i];
+
+ if (tstamp->buffer_type != IGC_TX_BUFFER_TYPE_XSK)
+ continue;
+ if (tstamp->xsk_queue_index != queue_id)
+ continue;
+ if (!tstamp->xsk_tx_buffer)
+ continue;
+
+ igc_ptp_free_tx_buffer(adapter, tstamp);
+ }
+
+ spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
+}
+
static void igc_ptp_disable_tx_timestamp(struct igc_adapter *adapter)
{
struct igc_hw *hw = &adapter->hw;
---
base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
change-id: 20260212-igc-fix-xdp-tx-tstamp-pagefault-c4abde453862
Best regards,
--
Zdenek Bouska
Siemens, s.r.o.
Foundational Technologies
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH v2] igc: fix page fault in XDP TX timestamps handling
2026-02-25 9:58 [PATCH v2] igc: fix page fault in XDP TX timestamps handling Zdenek Bouska
@ 2026-02-25 10:50 ` Paul Menzel
2026-03-11 14:51 ` Bouska, Zdenek
2026-02-25 11:10 ` Florian Bezdeka
2026-03-11 10:11 ` [Intel-wired-lan] " Dahan, AvigailX
2 siblings, 1 reply; 5+ messages in thread
From: Paul Menzel @ 2026-02-25 10:50 UTC (permalink / raw)
To: Zdenek Bouska
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexei Starovoitov,
Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
Stanislav Fomichev, Richard Cochran, Song Yoong Siang,
Lai Peter Jun Ann, Vinicius Costa Gomes, intel-wired-lan, netdev,
linux-kernel, bpf, Florian Bezdeka
Dear Zdenek,
Thank you for your patch.
Am 25.02.26 um 10:58 schrieb Zdenek Bouska via Intel-wired-lan:
> 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.
If you have the commands to reproduce this, that’d be great to have.
> Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet")
> Signed-off-by: Zdenek Bouska <zdenek.bouska@siemens.com>
> ---
> Changes in v2:
> - Moved 'adapter' variable declaration into the if block (Vinicius)
> - Link to v1: https://lore.kernel.org/r/20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com
> ---
> 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..1931fcb659354d5009e0ea02316bf3a47b66b04d 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -264,6 +264,13 @@ 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)) {
> + struct igc_adapter *adapter = netdev_priv(tx_ring->netdev);
> +
> + igc_ptp_clear_xsk_tx_tstamp_queue(adapter, tx_ring->queue_index);
> + }
> }
>
> /**
> diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
> index 7aae83c108fd7611b00bf075592f93a902b83422..98491346d21b80925ce42ba276d851d4318e66b7 100644
> --- a/drivers/net/ethernet/intel/igc/igc_ptp.c
> +++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
> @@ -576,6 +576,39 @@ static void igc_ptp_clear_tx_tstamp(struct igc_adapter *adapter)
> spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
> }
>
> +/**
> + * igc_ptp_clear_xsk_tx_tstamp_queue - Clear pending XSK TX timestamps for a queue
> + * @adapter: Board private structure
> + * @queue_id: TX queue index to clear timestamps for
> + *
> + * Iterates over all TX timestamp registers and releases any pending
> + * timestamp requests associated with the given TX queue. This is
> + * called when an XDP pool is being disabled to ensure no stale
> + * timestamp references remain.
> + */
> +void igc_ptp_clear_xsk_tx_tstamp_queue(struct igc_adapter *adapter, u16 queue_id)
> +{
> + unsigned long flags;
> + int i;
> +
> + spin_lock_irqsave(&adapter->ptp_tx_lock, flags);
> +
> + for (i = 0; i < IGC_MAX_TX_TSTAMP_REGS; i++) {
> + struct igc_tx_timestamp_request *tstamp = &adapter->tx_tstamp[i];
> +
> + if (tstamp->buffer_type != IGC_TX_BUFFER_TYPE_XSK)
> + continue;
> + if (tstamp->xsk_queue_index != queue_id)
> + continue;
> + if (!tstamp->xsk_tx_buffer)
> + continue;
> +
> + igc_ptp_free_tx_buffer(adapter, tstamp);
> + }
> +
> + spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags);
> +}
> +
> static void igc_ptp_disable_tx_timestamp(struct igc_adapter *adapter)
> {
> struct igc_hw *hw = &adapter->hw;
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] igc: fix page fault in XDP TX timestamps handling
2026-02-25 9:58 [PATCH v2] igc: fix page fault in XDP TX timestamps handling Zdenek Bouska
2026-02-25 10:50 ` [Intel-wired-lan] " Paul Menzel
@ 2026-02-25 11:10 ` Florian Bezdeka
2026-03-11 10:11 ` [Intel-wired-lan] " Dahan, AvigailX
2 siblings, 0 replies; 5+ messages in thread
From: Florian Bezdeka @ 2026-02-25 11:10 UTC (permalink / raw)
To: Zdenek Bouska, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
John Fastabend, Stanislav Fomichev, Richard Cochran,
Song Yoong Siang, Lai Peter Jun Ann
Cc: Vinicius Costa Gomes, intel-wired-lan, netdev, linux-kernel, bpf
On Wed, 2026-02-25 at 10:58 +0100, Zdenek Bouska wrote:
> 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 <zdenek.bouska@siemens.com>
> ---
> Changes in v2:
> - Moved 'adapter' variable declaration into the if block (Vinicius)
> - Link to v1: https://lore.kernel.org/r/20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com
> ---
Reviewed-by: Florian Bezdeka <florian.bezdeka@siemens.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-wired-lan] [PATCH v2] igc: fix page fault in XDP TX timestamps handling
2026-02-25 9:58 [PATCH v2] igc: fix page fault in XDP TX timestamps handling Zdenek Bouska
2026-02-25 10:50 ` [Intel-wired-lan] " Paul Menzel
2026-02-25 11:10 ` Florian Bezdeka
@ 2026-03-11 10:11 ` Dahan, AvigailX
2 siblings, 0 replies; 5+ messages in thread
From: Dahan, AvigailX @ 2026-03-11 10:11 UTC (permalink / raw)
To: Zdenek Bouska, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
John Fastabend, Stanislav Fomichev, Richard Cochran,
Song Yoong Siang, Lai Peter Jun Ann
Cc: Vinicius Costa Gomes, intel-wired-lan, netdev, linux-kernel, bpf,
Florian Bezdeka
On 25/02/2026 11:58, Zdenek Bouska via Intel-wired-lan wrote:
> 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 <zdenek.bouska@siemens.com>
> ---
> Changes in v2:
> - Moved 'adapter' variable declaration into the if block (Vinicius)
> - Link to v1: https://lore.kernel.org/r/20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com
> ---
> 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(+)
>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [Intel-wired-lan] [PATCH v2] igc: fix page fault in XDP TX timestamps handling
2026-02-25 10:50 ` [Intel-wired-lan] " Paul Menzel
@ 2026-03-11 14:51 ` Bouska, Zdenek
0 siblings, 0 replies; 5+ messages in thread
From: Bouska, Zdenek @ 2026-03-11 14:51 UTC (permalink / raw)
To: Paul Menzel
Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexei Starovoitov,
Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
Stanislav Fomichev, Richard Cochran, Song Yoong Siang,
Lai Peter Jun Ann, Vinicius Costa Gomes, intel-wired-lan, netdev,
linux-kernel, bpf, Bezdeka, Florian
Dear Paul,
On 25/05/2026 11:51 Paul Menzel wrote:
> Am 25.02.26 um 10:58 schrieb Zdenek Bouska via Intel-wired-lan:
> > 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.
>
> If you have the commands to reproduce this, that'd be great to have.
The software which I used is not public yet. I will let you know when that changes.
Thank you for the review!
Best regards,
Zdenek Bouska
--
Siemens, s.r.o
Foundational Technologies
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-11 14:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 9:58 [PATCH v2] igc: fix page fault in XDP TX timestamps handling Zdenek Bouska
2026-02-25 10:50 ` [Intel-wired-lan] " Paul Menzel
2026-03-11 14:51 ` Bouska, Zdenek
2026-02-25 11:10 ` Florian Bezdeka
2026-03-11 10:11 ` [Intel-wired-lan] " Dahan, AvigailX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®