From: Kuniyuki Iwashima <kuniyu@google.com>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Stanislav Fomichev <sdf@fomichev.me>,
Andrii Nakryiko <andrii@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Eduard Zingerman <eddyz87@gmail.com>
Cc: Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v1 bpf-next/net 0/5] bpf: Support RX/TX HW timestamp proxy.
Date: Fri, 12 Jun 2026 00:17:31 +0000 [thread overview]
Message-ID: <20260612001803.23341-1-kuniyu@google.com> (raw)
We have some hosts where packets come from special hardware
and are provided directly to userspace, bypassing the kernel
networking stack.
When standard socket applications are run on these hosts,
a userspace proxy is required to mediate traffic between the
hardware and the applications.
+---------+ +----------------------+
| proxy | | socket application |
+---------+ +----------------------+
^ ^ ^
userspace | | |
-----------| |-----------------------------------------------
| | | +---------------------+ | skb
| | `--->| virtual interface |<---'
kernel | | skb +---------------------+
-----------| |-----------------------------------------------
|
v
+------------+
| hardware |
+------------+
However, even though the hardware fully supports timestamping,
the HW timestamps are not directly accessible to the socket
applications because the skb is consumed/injected by the proxy.
This series extends ethtool and adds BPF kfuncs to transparently
support HW timestamp on such a setup.
Patch 1 is pure net-next patch to advertise fake timestamping
capability on virtual interfaces (e.g. ipvlan, geneve, etc).
Patch 2 is misc cleanup.
Patch 3 & 4 add kfunc to proxy RX/TX hwtstamp.
Patch 5 is selftest to demonstrate how it works.
Note the test requires this iproute2 commit:
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=c9a9f12aa619288fd3d4e16bc4b3c73b655a4efe
Kuniyuki Iwashima (5):
ethtool: Introduce ETHTOOL_MSG_TSINFO_SET for virtual interfaces.
bpf: Rename bpf_kfunc_set_tcp_reqsk to bpf_kfunc_set_sched_cls.
bpf: Add bpf_skb_set_hwtstamp().
bpf: Add kfunc to proxy TX HW Timestamp.
selftest: bpf: Add test for hwtstamp proxy.
Documentation/netlink/specs/ethtool.yaml | 13 +
include/linux/filter.h | 2 +
include/linux/netdevice.h | 11 +
include/linux/skbuff.h | 13 +
include/net/tcx.h | 1 +
include/uapi/linux/bpf.h | 1 +
.../uapi/linux/ethtool_netlink_generated.h | 1 +
include/uapi/linux/pkt_cls.h | 3 +-
kernel/bpf/verifier.c | 13 +-
net/core/dev.c | 39 ++
net/core/dev_ioctl.c | 31 +-
net/core/filter.c | 91 ++-
net/ethtool/common.c | 4 +
net/ethtool/netlink.c | 8 +
net/ethtool/netlink.h | 1 +
net/ethtool/tsconfig.c | 7 +-
net/ethtool/tsinfo.c | 123 +++-
tools/testing/selftests/bpf/bpf_kfuncs.h | 10 +
.../selftests/bpf/prog_tests/proxy_hwtstamp.c | 580 ++++++++++++++++++
.../selftests/bpf/progs/bpf_tracing_net.h | 1 +
.../selftests/bpf/progs/proxy_hwtstamp.c | 234 +++++++
21 files changed, 1169 insertions(+), 18 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/proxy_hwtstamp.c
create mode 100644 tools/testing/selftests/bpf/progs/proxy_hwtstamp.c
--
2.54.0.1136.gdb2ca164c4-goog
next reply other threads:[~2026-06-12 0:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 0:17 Kuniyuki Iwashima [this message]
2026-06-12 0:17 ` [PATCH v1 bpf-next/net 1/5] ethtool: Introduce ETHTOOL_MSG_TSINFO_SET for virtual interfaces Kuniyuki Iwashima
2026-06-12 0:17 ` [PATCH v1 bpf-next/net 2/5] bpf: Rename bpf_kfunc_set_tcp_reqsk to bpf_kfunc_set_sched_cls Kuniyuki Iwashima
2026-06-12 0:17 ` [PATCH v1 bpf-next/net 3/5] bpf: Add bpf_skb_set_hwtstamp() Kuniyuki Iwashima
2026-06-12 0:33 ` sashiko-bot
2026-06-12 5:41 ` Kuniyuki Iwashima
2026-06-12 0:17 ` [PATCH v1 bpf-next/net 4/5] bpf: Add kfunc to proxy TX HW Timestamp Kuniyuki Iwashima
2026-06-12 0:33 ` sashiko-bot
2026-06-12 5:59 ` Kuniyuki Iwashima
2026-06-12 3:37 ` Alexei Starovoitov
2026-06-12 4:16 ` Kuniyuki Iwashima
2026-06-12 0:17 ` [PATCH v1 bpf-next/net 5/5] selftest: bpf: Add test for hwtstamp proxy Kuniyuki Iwashima
2026-06-12 0:31 ` sashiko-bot
2026-06-12 6:03 ` Kuniyuki Iwashima
2026-06-12 16:04 ` Alexei Starovoitov
2026-06-12 18:55 ` Kuniyuki Iwashima
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=20260612001803.23341-1-kuniyu@google.com \
--to=kuniyu@google.com \
--cc=andrew@lunn.ch \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=willemb@google.com \
--cc=yonghong.song@linux.dev \
/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.