All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	"Gomes, Vinicius" <vinicius.gomes@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"Keller, Jacob E" <jacob.e.keller@intel.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3] igb: Retrieve Tx timestamp directly from interrupt for i210
Date: Thu, 5 Feb 2026 16:27:03 +0000	[thread overview]
Message-ID: <66925f09-ef9f-4401-baec-7d4c82a68ce3@linux.dev> (raw)
In-Reply-To: <20260205145104.iWinkXHv@linutronix.de>

On 05/02/2026 14:51, Sebastian Andrzej Siewior wrote:
> On 2026-02-05 11:56:44 [+0000], Vadim Fedorenko wrote:
>> On 05/02/2026 10:37, Loktionov, Aleksandr wrote:
>>> spin_lock_irqsave(&wq_head->lock, flags);  <- RT mutex can sleep
>>
>> Hmm... that actually means we have some drivers broken for RT kernels if
>> they are processing TX timestamps within a single irq vector:
>> - hisilicon/hns3
>> - intel/i40e (and ice probably)
>> - marvell/mvpp2
>>
>> For igb/igc/i40e it's still OK to process TX timestamps directly in
>> MSI-X configuration, as ring processing has separate vector, right?
> 
> The statement made above is not accurate. Each and every driver does
> request_irq() and here on PREEMPT_RT you can freely acquire spinlock_t.
> 
> But !RT looks problematic…
> 
> __skb_tstamp_tx() invokes skb_may_tx_timestamp() which should exit early
> most of the time due to the passed bool (which is true) or
> sysctl_tstamp_allow_data which is true. However, should both be false
> then it tries to
> 	read_lock_bh(&sk->sk_callback_lock);
> 
> where lockdep will complain because this lock is now acquired with
> disabled interrupts.
> 
> The function will attempt do free the fresh/ cloned skb in error case
> via kfree_skb(). Since it is fresh skb, sk_buff::destructor is NULL and
> the warning in skb_release_head_state() won't trigger.
> 
> So the only thing that bothers me is the read_lock_bh() in
> skb_may_tx_timestamp() which deadlocks if the socket is write-locked on
> the same CPU.

Alright. Now you make me think whether we should enforce OPT_TSONLY
option on socket which doesn't have CAP_NET_RAW? Then we can get rid of 
this check, and in case sysctl was flipped off - drop TX timestamps as
it's done now?


  reply	other threads:[~2026-02-05 16:27 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  7:54 [Intel-wired-lan] [PATCH iwl-next v3] igb: Retrieve Tx timestamp directly from interrupt for i210 Kurt Kanzenbach
2026-02-05  7:54 ` Kurt Kanzenbach
2026-02-05  9:47 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-02-05  9:47   ` Loktionov, Aleksandr
2026-02-05 10:03   ` Sebastian Andrzej Siewior
2026-02-05 10:03     ` Sebastian Andrzej Siewior
2026-02-05 10:37     ` Loktionov, Aleksandr
2026-02-05 10:37       ` Loktionov, Aleksandr
2026-02-05 10:52       ` Sebastian Andrzej Siewior
2026-02-05 10:52         ` RE: " Sebastian Andrzej Siewior
2026-02-05 11:56       ` Vadim Fedorenko
2026-02-05 14:51         ` Sebastian Andrzej Siewior
2026-02-05 16:27           ` Vadim Fedorenko [this message]
2026-02-05 16:43             ` Sebastian Andrzej Siewior
2026-02-05 16:48               ` Vadim Fedorenko
2026-02-05 21:41                 ` Willem de Bruijn
2026-02-06  7:44                   ` Sebastian Andrzej Siewior
2026-02-06 10:12                   ` Vadim Fedorenko
2026-02-08 16:25                     ` Willem de Bruijn
2026-02-09  9:06                       ` Sebastian Andrzej Siewior
2026-02-09 10:43                         ` Vadim Fedorenko
2026-02-09 11:48                           ` Sebastian Andrzej Siewior
2026-02-09 12:24                             ` Vadim Fedorenko
2026-02-09 12:46                               ` Willem de Bruijn
2026-02-10 12:12                                 ` Sebastian Andrzej Siewior
2026-02-10 16:14                                   ` Willem de Bruijn
2026-02-11 12:08                                     ` Kurt Kanzenbach
2026-02-11 16:29                                       ` Willem de Bruijn
2026-02-12 18:33                                         ` Sebastian Andrzej Siewior
2026-02-14 23:26                                         ` Sebastian Andrzej Siewior
2026-02-11 18:54                                       ` Jakub Kicinski
2026-02-12 16:28                                         ` Sebastian Andrzej Siewior
2026-02-11 19:29                                       ` Jacob Keller
2026-02-11 21:44                                         ` Jakub Kicinski
2026-02-12 16:47                                           ` Sebastian Andrzej Siewior
2026-02-05 11:58   ` Kurt Kanzenbach
2026-02-05 11:58     ` Kurt Kanzenbach
2026-02-05 12:20     ` Loktionov, Aleksandr
2026-02-05 12:20       ` Loktionov, Aleksandr
2026-02-06  0:05       ` Jacob Keller
2026-02-05 12:12 ` Sebastian Andrzej Siewior
2026-02-05 12:12   ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66925f09-ef9f-4401-baec-7d4c82a68ce3@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=vinicius.gomes@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.