From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51BF633F389 for ; Wed, 11 Feb 2026 16:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770827387; cv=none; b=EqLHhaZkLKZuDUP4eIHo5yLhLWYvoNO3IknBCAcK1xR5xgIbN13C7hqjyG1kJyvTw2y3mg0RbklGFsFwtBIWeh4hjhmwRHuMSOWt9eBTn6lhyUa0FofV02LAotTgemZ0tdG1t4um6xkRT4pdToS6GgKZgwop9qHgl3JzW+5FfQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770827387; c=relaxed/simple; bh=cJVICiDTHaNQrF+kdKm16GtTojzuaRaZXTJkbLCQE1w=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=HBgaSOO1C1yVkc4KZ1EiTbgC1KNTORdidrkS2qv7RQTHZJ7pyrzyUtIXtymefrRqrCAKoPtv1PGfpOmunyxU/u/6Nn7y6bkNTLHU8UPc0HIQnokGGRlrzRqW/ocy6oceJC38C0SG+6WGjeuTQUKHUr5FJR3SG8qRe6Aw0JLlRDw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gbMlfzyS; arc=none smtp.client-ip=209.85.128.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gbMlfzyS" Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-79273a294edso19977597b3.3 for ; Wed, 11 Feb 2026 08:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770827385; x=1771432185; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=tQv05ILMKxllfl45z92SDOph56g77ozE9I5ricXOpDE=; b=gbMlfzySJ4rR5kRYi+LMBdjOIa/g3fBNl16RvNabN/CeIHLxceoDszcRH8stVIGpXg E0U4KyXXpyzLQtGTb57kIY7O+XnHw9+sJonhDDFzM83j1dvXOTNU/CJvwmXUZoLQDt9Z ZfOm73yz1Soo4FHjNR4yYI5h2FI1/sbaUU16h5lcNpITTjSIvI+0n+RBKK2EpZJ4ufRH T2WLZ9VU3vuDNhGyh74r1n5FxLzClXHQ/mxEJRUK+F/KKZQmUiDb0/tt3hIXagUwzCaD ry/zGbggTQYQeYwz121k6fr3gG5hhdG8pUKxuiOX3VGkePPd5dsAVcHNz1o7xDSv6AHc nnvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770827385; x=1771432185; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tQv05ILMKxllfl45z92SDOph56g77ozE9I5ricXOpDE=; b=DM6CdJQeC8D8hZ+b4iW/bmQuGVKEO542jkfsC+9BsuqNGuDMOCwmokml2DWycy32TH Amhq1f0F1BS3RHVQoGKj1WkFCYTcPckXGwFZECfftjRl53fOQEhkEN1LFIWTLMrZgc7J iY/nNhzqShjDmtId6QcRxpukHBObUHZqAWL8Rp23eOdE/64RKcEh1MumY37RDEcTJbh3 XEzUOhFUXhx0o8w0RTKqwnXG/pgOps5U4Bgxe9+iAFta6Rs9CROjblkOO34Kqvc+WhkJ 4dX4GzM//1ndxJtf4S8Fj4gRIQvMwvTeuSHT7+Zqb8O4Z3h1RmYvrTf/hIbAYbVZQqap piLA== X-Forwarded-Encrypted: i=1; AJvYcCXEAHSFFokxABszw5y7FS7aCI/vJMuh9GDrmMNKn6c+aY28/LuQq0BCsOmZLkBBRBME2OVt2t2R1EftXu4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3fVUJ3ZQ+QUeMBAyP7Yz9VU4EB+rx7ISZPPk5j+rKCdBJjAkD jKCdLfuQi9dkDYmJTfGVZtRcjg101HOq5dm1hPD+gzBtXQ1viuBGb87x X-Gm-Gg: AZuq6aJRSPU/J5oZMaZLsrdCNwxxFQXuCEgOkxWw6Zp8ii21dDhOZrQ2mfhXuD61FEn IooEkSnWsnPrLzMEo+0UIeyCtGMuoAWGJFBM14SfUYDsstCy3UJM51cvCRYyO6CLy0WUZIMWp9F yeO2igSz0wPV+lD+S8haBCCI0k3m49ZCYIQGTfptjduf5FncJ+MtCOu1rEDj3SQVrBR8MROUMQ7 E7bj1FH4owaHGzgJG+HxfUb7d1lDpMkzgdmPDlw2raOtguUcYVDNLXJfWh0mnYfH6uYsDtQ2pnt dcr6/W2cMl3SgH+9Bel3/iFf+qe9TAsJhOgyJzhDsEjREuw1A8g40JVMYtTm0NwS9BgYtTniH85 MN8fJouOGxYQXKBQRe2wqHZlckejIzbYP1qiFX7WguGF4o5pV86xjtHkkDAPi9WPNV5Z13pXk2E pRguMLQ1Ud3OnPckqKsQzMMC67sal3uLXSgwgJ0XrEWDpcmj2cvEZT6bAGIVEP7bG9uRK7j5Y= X-Received: by 2002:a05:690c:6602:b0:794:d887:726e with SMTP id 00721157ae682-7952ab3c507mr154210237b3.57.1770827385211; Wed, 11 Feb 2026 08:29:45 -0800 (PST) Received: from gmail.com (21.33.48.34.bc.googleusercontent.com. [34.48.33.21]) by smtp.gmail.com with UTF8SMTPSA id 00721157ae682-7966c16e7c6sm21293957b3.1.2026.02.11.08.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 08:29:44 -0800 (PST) Date: Wed, 11 Feb 2026 11:29:43 -0500 From: Willem de Bruijn To: Kurt Kanzenbach , Willem de Bruijn , Sebastian Andrzej Siewior , Willem de Bruijn Cc: Vadim Fedorenko , Willem de Bruijn , Jakub Kicinski , Paolo Abeni , Eric Dumazet , "David S. Miller" , "Loktionov, Aleksandr" , "Nguyen, Anthony L" , "Kitszel, Przemyslaw" , Paul Menzel , "Gomes, Vinicius" , "netdev@vger.kernel.org" , Richard Cochran , "linux-kernel@vger.kernel.org" , Andrew Lunn , "intel-wired-lan@lists.osuosl.org" , "Keller, Jacob E" Message-ID: In-Reply-To: <87qzqr5vos.fsf@jax.kurt.home> References: <20260205164341.pJvni8kA@linutronix.de> <76acd5cc-eb6f-4c56-a5e6-f6413736afbb@linux.dev> <601f0c4b-52d8-4b60-96bf-f2d65f8073d8@linux.dev> <20260209090621.GiZqTiMJ@linutronix.de> <8e762437-69f9-40d7-bb75-3a45bef1d5d6@linux.dev> <20260209114836.GPU-vnnh@linutronix.de> <78e2af2c-40e6-43f1-9471-42f350e69389@linux.dev> <20260210121207.9kLHroS0@linutronix.de> <87qzqr5vos.fsf@jax.kurt.home> Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3] igb: Retrieve Tx timestamp directly from interrupt for i210 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Kurt Kanzenbach wrote: > On Tue Feb 10 2026, Willem de Bruijn wrote: > > The core issue seems to be that the ptp_tx_work is not scheduled > > quickly enough. I wonder if that is the issue to be fixed. When/why > > is this too slow? > > The igb driver uses schedule_work() for the Tx timestamp retrieval. That > means the ptp_tx_work item is queued to the kernel-global workqueue. In > case there is load on the system, the kworker which handles ptp_tx_work > might be delayed too much, which results in ptp4l timeouts. > > Easy solution would be to tune the priority/affinity of the > kworker. However, we have to figure which kworker it is. Furthermore, > this kworker might handle other things as well, which are not related to > igb timestamping at all. Therefore, tuning the priority of the kworker > is not practical. > > Moving the timestamping in IRQ looked like a good solution, because the > device already signals that the Tx timestamp is available now. No need > to schedule any worker/work at all. So, it'd be very nice if > skb_tstamp_tx() could be called from IRQ context. BTW other drivers like > igc call this function in IRQ context as well. > > Alternative solution for igb is to move from schedule_work() to PTP AUX > worker. That is a dedicated PTP worker thread called ptpX, which could > handle the timestamping. This can be easily tuned with taskset and > chrt. However, there's one difference to the kworker approach: The > kworker always runs on the same CPU, where the IRQ triggered, the AUX > worker not necessarily. This means, Miroslav needs to be aware of this > and tune the AUX worker for his NTP use cases. > > I hope, that makes the motivation for this patch and discussion clear. It does thanks. I think we should look at the locking. It is not clear to me that sk_callback_lock needs to be held here at all. >From the lock documentation itself its use is more limited. sk->sk_socket->file is indeed dereferenced elsewhere without holding such locks. sk_capable is another indication.