All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miroslav Lichvar <mlichvar@redhat.com>
To: JR Lanteigne <root@dnim.dev>
Cc: Eric Dumazet <edumazet@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net] net: fall back to skb_iif for the timestamping pktinfo if_index
Date: Mon, 24 Aug 2026 09:58:12 +0200	[thread overview]
Message-ID: <aov5lCT4P_3tmRqR@localhost> (raw)
In-Reply-To: <178746246095.3786864.2262454553798466512@dnim.dev>

On Sun, Aug 23, 2026 at 02:21:00AM -0300, JR Lanteigne wrote:
> put_ts_pktinfo() resolves the interface index of a received packet
> from its napi id. The lookup fails on drivers whose napi instances
> are not attached to the delivering net_device (e.g. ti cpsw, which
> keeps them on an internal dummy device) and on kernels built without
> CONFIG_NET_RX_BUSY_POLL, where skb_napi_id() is always 0. In those
> cases SCM_TIMESTAMPING_PKTINFO carries if_index 0 and applications
> cannot tell which interface produced the hardware timestamp. chronyd,
> for example, then ignores valid hardware timestamps.

That's the intended behavior, from timestamping.rst:
  A valid (non-zero) interface index will be returned only if
  CONFIG_NET_RX_BUSY_POLL is enabled and the driver is using NAPI. 
 
> Fall back to skb->skb_iif, which is set for every received packet.
> On aggregated interfaces this reports the aggregating device instead
> of the physical one, but only in cases where the napi lookup already
> failed and nothing was reported at all.

That would cause applications to receive a wrong index in some cases,
right? If it's possible, it should report the index of the physical
interface, but it should not be guessing.

> A userspace fallback for existing kernels was proposed to chrony
> separately.

That makes sense to me. It's a bug that it doesn't check for
zero value.

-- 
Miroslav Lichvar


  parent reply	other threads:[~2026-08-24  7:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23  5:21 [PATCH net] net: fall back to skb_iif for the timestamping pktinfo if_index JR Lanteigne
2026-08-24  2:21 ` Willem de Bruijn
2026-08-24 10:24   ` JR Lanteigne
2026-08-24  7:58 ` Miroslav Lichvar [this message]
2026-08-24 10:24   ` JR Lanteigne
2026-08-24 14:06     ` Willem de Bruijn
2026-08-24 16:55       ` JR Lanteigne
2026-08-24 18:35         ` Willem de Bruijn

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=aov5lCT4P_3tmRqR@localhost \
    --to=mlichvar@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=root@dnim.dev \
    --cc=willemb@google.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.