From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: JR Lanteigne <root@dnim.dev>, Miroslav Lichvar <mlichvar@redhat.com>
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 10:06:08 -0400 [thread overview]
Message-ID: <willemdebruijn.kernel.1e07ba16c4cf4@gmail.com> (raw)
In-Reply-To: <178756707212.4073008.8425791726071449399@dnim.dev>
JR Lanteigne wrote:
> Miroslav Lichvar wrote:
> > 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.
>
> Right: with the fallback a nonzero if_index is no longer guaranteed
> to be the physical timestamping device. An application that maps the
> index to a PHC without validating it could see the aggregating
> device where it previously saw 0.
>
> Reporting the physical interface does not look implementable in the
> two failing cases. Without CONFIG_NET_RX_BUSY_POLL there is no napi
> id recorded at all. For cpsw the napi belongs to a DMA channel
> shared by both ports, so there is no per-napi net_device to attach;
> the delivering port is only known per packet, and there skb->dev is
> set correctly, so skb_iif is exactly the physical interface. The
> index only becomes an aggregate with bonding or bridging on top,
> where the napi lookup would have failed anyway.
>
> So the choice for these packets is between 0 and the skb_iif value,
> which is what IP_PKTINFO already reports. No objection from me if
> this is dropped; I can respin if there is a form of the fallback
> worth keeping.
It may be possible to detect whether an skb_iif points to a physical
or aggregate device (e.g., through lower_dev)? If so, then the value
can still be used in most cases.
next prev parent reply other threads:[~2026-08-24 14:06 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
2026-08-24 10:24 ` JR Lanteigne
2026-08-24 14:06 ` Willem de Bruijn [this message]
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=willemdebruijn.kernel.1e07ba16c4cf4@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=mlichvar@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox