bpf: Support RX/TX HW timestamp proxy.
Status from this message: Nacked-by: Jakub Kicinski <[email protected]>
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest4 patches 1 replyNAK
- v25 patches 10 repliesSuperseded
- v15 patches 7 repliesSuperseded
Changes in v3 from the cover letter
* Drop ethtool patch and rebase on bpf-next.git
* Patch 4: Drop bpf_kfunc.h change
Patches in v3
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpf: Rename bpf_kfunc_set_tcp_reqsk to bpf_kfunc_set_sched_cls.net/ | +5 | 0 replies | |
| 2/4 | bpf: Add bpf_skb_set_hwtstamp().include/ kernel/ net/ | +38 | 0 replies | |
| 3/4 | bpf: Add kfunc to proxy TX HW Timestamp.include/ include/ include/ +5 more | +121 | 0 replies | |
| 4/4 | selftest: bpf: Add test for hwtstamp proxy.tools/ tools/ tools/ | +825 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by.
| Patch | Jakub Kicinski |
|---|---|
| Series | Nacked-by |
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 bpf-next 0/4] bpf: Support RX/TX HW timestamp proxy.
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 misc cleanup.
Patch 2 & 3 add kfunc to proxy RX/TX hwtstamp.
Patch 4 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
Changes:
v3:
* Drop ethtool patch and rebase on bpf-next.git
* Patch 4: Drop bpf_kfunc.h change
v2: https://lore.kernel.org/bpf/[email protected]/
* Patch 3:
* Remove __packed and use unnamed bit-field in struct bpf_hwtstamp (Alexei Starovoitov)
* Use skb_unclone() instead of skb_heaeder_clone() (Sashiko)
* Patch 4
* Remove __packed and use unnamed bit-field in struct bpf_tx_tstamp_cmpl (Alexei Starovoitov)
* Check !skb_at_tc_ingress() in bpf_skb_complete_tx_tstamp() (Sashiko)
* Use skb_unclone() instead of skb_heaeder_clone() (Sashiko)
* Patch 5
* Use scm_timestamping64 (Sashiko)
* Correct saw_tskey check (Sashiko)
* Fix retval check for bpf_skb_get_tunnel_opt() with (int) cast (Sashiko)
* bpf-style comment
v1: https://lore.kernel.org/bpf/[email protected]/
Kuniyuki Iwashima (4):
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.
include/linux/filter.h | 2 + include/linux/skbuff.h | 13 + include/net/tcx.h | 1 + include/uapi/linux/bpf.h | 1 + include/uapi/linux/pkt_cls.h | 3 +- kernel/bpf/verifier.c | 13 +- net/core/dev.c | 39 ++ net/core/filter.c | 98 ++- .../selftests/bpf/prog_tests/proxy_hwtstamp.c | 588 ++++++++++++++++++ .../selftests/bpf/progs/bpf_tracing_net.h | 1 + .../selftests/bpf/progs/proxy_hwtstamp.c | 236 +++++++ 11 files changed, 988 insertions(+), 7 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/proxy_hwtstamp.c create mode 100644 tools/testing/selftests/bpf/progs/proxy_hwtstamp.c
Signature · 1 line
2.54.0.1136.gdb2ca164c4-goog