diff options
| author | Jason Xing <kerneljasonxing@gmail.com> | 2025-02-20 10:29:30 +0300 |
|---|---|---|
| committer | Martin KaFai Lau <martin.lau@kernel.org> | 2025-02-21 01:28:54 +0300 |
| commit | df600f3b1d7963e2203ebf0987f564946a2647f1 (patch) | |
| tree | 403a9725375a9c1910f7cea84e065b7dd2db5b08 /include | |
| parent | 24e82b7c045ba5afde5bd81f691b7a72283de35e (diff) | |
| download | linux-df600f3b1d7963e2203ebf0987f564946a2647f1.tar.xz | |
bpf: Prepare the sock_ops ctx and call bpf prog for TX timestamping
This patch introduces a new bpf_skops_tx_timestamping() function
that prepares the "struct bpf_sock_ops" ctx and then executes the
sockops BPF program.
The subsequent patch will utilize bpf_skops_tx_timestamping() at
the existing TX timestamping kernel callbacks (__sk_tstamp_tx
specifically) to call the sockops BPF program. Later, four callback
points to report information to user space based on this patch will
be introduced.
Signed-off-by: Jason Xing <kerneljasonxing@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250220072940.99994-3-kerneljasonxing@gmail.com
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/sock.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index a95eedacae76..2f6b55c59c16 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2924,6 +2924,13 @@ int sock_set_timestamping(struct sock *sk, int optname, struct so_timestamping timestamping); void sock_enable_timestamps(struct sock *sk); +#if defined(CONFIG_CGROUP_BPF) +void bpf_skops_tx_timestamping(struct sock *sk, struct sk_buff *skb, int op); +#else +static inline void bpf_skops_tx_timestamping(struct sock *sk, struct sk_buff *skb, int op) +{ +} +#endif void sock_no_linger(struct sock *sk); void sock_set_keepalive(struct sock *sk); void sock_set_priority(struct sock *sk, u32 priority); |
