From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 904D433B960; Tue, 24 Feb 2026 20:59:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771966750; cv=none; b=s36RUDZCyg/K4F6JShog5eVoTCJD2RS5/i/vk7H46zvv97k3zvIwEHw7Fhs5vsVm7hahOrcKSYLFEt9uZe+zZ3vUEWVsXBkVWA/PAv/plWy6nu3WXwi86hYW1AoBqLAh5TxDdwcsJqX57fHYcnR4PYGKVb4hqdSfXw4fO8YDX0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771966750; c=relaxed/simple; bh=nkrvCgJax+Hu9YAH/GgCRO+8YstLU1L1lCG4uaQ3Qb4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=rDv7CC6GxGa1brPyUjvgpTI+TCF+2S8AS6d5/Sig8ziZmjpC265G1IZlHP1JloXxRt76Ed3U5iETgI0M/B9VlNdeaqkpMynTadYo3LKOXC+U845B7Ob7FyqXtGkrBFOekKuo6O7uVcFxd+dS1Yi3aOTXbJrpsuxdo3Wfyqr5aps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IxTSgKyJ; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IxTSgKyJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771966749; x=1803502749; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=nkrvCgJax+Hu9YAH/GgCRO+8YstLU1L1lCG4uaQ3Qb4=; b=IxTSgKyJiI4YqwV4n1X8NkMXd3m7jUV6yJEgoBO2I5UQEPn+EUsRWHgB 3KAgF72DyEEBnvoaNkMcqLRpRoTgcw1xozmlupQRTlzb4nuR2xiA+Xg/7 col1gZXrZuz7TJkaUGICWx3eh9s7jIY15lW+X9QF4nBi96CoJaAc6S6xi TXKoKXt77XBYnP6AVC3PHHdgzwYUDFy3qnZVTRcqk/2eS0o83aNBt11YW BWMYhaib0WwwIAA/yh8wm4aOw79XQ4u+ZTt9QgPFPr/RyRRiB86bs7AEC a7i3ucm/7/8ROFAn3msdyANTJbi6DTuUe1GAB+RrqyXHREm9HCmerb2qh g==; X-CSE-ConnectionGUID: CX5zkbYrQmyH65VlzcHS/w== X-CSE-MsgGUID: e8lLbUleQiiKhg23HUDtwA== X-IronPort-AV: E=McAfee;i="6800,10657,11711"; a="95610537" X-IronPort-AV: E=Sophos;i="6.21,309,1763452800"; d="scan'208";a="95610537" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 12:59:09 -0800 X-CSE-ConnectionGUID: RxA1F9doQDK27BfiySCZiQ== X-CSE-MsgGUID: UFKoOcZFQv2IrUofsLfFzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,309,1763452800"; d="scan'208";a="215252303" Received: from vcostago-desk1.jf.intel.com (HELO vcostago-desk1) ([10.88.27.144]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 12:59:09 -0800 From: Vinicius Costa Gomes 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: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Florian Bezdeka , Zdenek Bouska Subject: Re: [PATCH] igc: fix page fault in XDP TX timestamps handling In-Reply-To: <20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com> References: <20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com> Date: Tue, 24 Feb 2026 12:59:08 -0800 Message-ID: <87342p97tv.fsf@intel.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Zdenek Bouska 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] > [ 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 > --- > 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 Cheers, -- Vinicius From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ECDA4F4BB8A for ; Tue, 24 Feb 2026 20:59:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A32EA61478; Tue, 24 Feb 2026 20:59:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wM8ia4TpCZNz; Tue, 24 Feb 2026 20:59:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2917861473 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1771966753; bh=mUaBHGMYbP2dKL+wwu0ufhScqPsqTlD0OdLkYVt0wns=; h=From:To:Cc:In-Reply-To:References:Date:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YpKW9D3dIlB6MM85PVGoKIkzewZmPRzlijdC5SQZ9cbvmbCT1K/CwJTTedXP4wwKy dNrQHhylPSWQCVXsuUn6ml7ZO0iuz4DsarbJwhNdBs50LwSv8mcK4bModro0S2lMvi hidn7wVhLKw68t3oL3qbgD6d+lpoFulXcH2Ug+DeKWmqOvF2K4UNxmzvjqL1z83RfQ 1KWdpsRUbdVj3oXawcDnyUClzAkbTwQ8qbmhZpwopbcBGZPEINjm/kCbNub/99xvTt l3BS3Tsgw3Qw2RdXudUZtbK6hHDBaXY3e7GWbwnFJyV/QZuwxaLT5Nh0n6WW2yZEd8 HECWstueap4Tw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 2917861473; Tue, 24 Feb 2026 20:59:13 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 1EEE2204 for ; Tue, 24 Feb 2026 20:59:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 040D241DEB for ; Tue, 24 Feb 2026 20:59:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VPyrveIineZd for ; Tue, 24 Feb 2026 20:59:11 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.9; helo=mgamail.intel.com; envelope-from=vinicius.gomes@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 47ABB41DEA DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 47ABB41DEA Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by smtp4.osuosl.org (Postfix) with ESMTPS id 47ABB41DEA for ; Tue, 24 Feb 2026 20:59:09 +0000 (UTC) X-CSE-ConnectionGUID: MkPQ/fRCRjuVe9UnHqNjKw== X-CSE-MsgGUID: 22d1C49uRF6rBJst6Eqwmg== X-IronPort-AV: E=McAfee;i="6800,10657,11711"; a="95610542" X-IronPort-AV: E=Sophos;i="6.21,309,1763452800"; d="scan'208";a="95610542" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 12:59:09 -0800 X-CSE-ConnectionGUID: RxA1F9doQDK27BfiySCZiQ== X-CSE-MsgGUID: UFKoOcZFQv2IrUofsLfFzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,309,1763452800"; d="scan'208";a="215252303" Received: from vcostago-desk1.jf.intel.com (HELO vcostago-desk1) ([10.88.27.144]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2026 12:59:09 -0800 From: Vinicius Costa Gomes 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: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Florian Bezdeka , Zdenek Bouska In-Reply-To: <20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com> References: <20260224-igc-fix-xdp-tx-tstamp-pagefault-v1-1-7c729ef61ee5@siemens.com> Date: Tue, 24 Feb 2026 12:59:08 -0800 Message-ID: <87342p97tv.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771966750; x=1803502750; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=nkrvCgJax+Hu9YAH/GgCRO+8YstLU1L1lCG4uaQ3Qb4=; b=QTqV56bzusxnw8c0yG/wGDLH55Z9eB/f+AZIqBKr0t3a9GOXNPUGKgqF +xr8ZGWxo0xBrBrV7Odzz9drn3cjXsVe0EXPVsDZbBpcsmIOdo6ZXMr+A +amEIPOOV2VGkQySb0p9nfJEgTNnspYKSENO0dFkvCInC6WP3BtKpOFx5 5rwOeDAx0Ux/48fTCtjIGWTLNassrvVK0/lTWJLhggPp13c/DqFLbEbMw qkES2QdbdYQYfiTAXQHXCoGl56ijS5OVLskTF8DSu3ZWoBjoeQQ2LxXre IWMkiZ2ZG12PVna0VGyDTQz0EtyP6V5yGjSzJsJFxiHjM2Ox2Nz4dMxDA Q==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QTqV56bz Subject: Re: [Intel-wired-lan] [PATCH] igc: fix page fault in XDP TX timestamps handling X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Zdenek Bouska 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] > [ 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 > --- > 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 Cheers, -- Vinicius