aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorCong Wang <cong.wang@bytedance.com>2021-02-23 10:49:28 -0800
committerAlexei Starovoitov <ast@kernel.org>2021-02-26 12:28:03 -0800
commit16137b09a66f2b75090f1e56a9ba0e27ef845ebc (patch)
tree84e6f4a946e33b2654e36b3563d3488c27ac9f13 /include/net/tcp.h
parentskmsg: Get rid of struct sk_psock_parser (diff)
downloadlinux-dev-16137b09a66f2b75090f1e56a9ba0e27ef845ebc.tar.xz
linux-dev-16137b09a66f2b75090f1e56a9ba0e27ef845ebc.zip
bpf: Compute data_end dynamically with JIT code
Currently, we compute ->data_end with a compile-time constant offset of skb. But as Jakub pointed out, we can actually compute it in eBPF JIT code at run-time, so that we can competely get rid of ->data_end. This is similar to skb_shinfo(skb) computation in bpf_convert_shinfo_access(). Suggested-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: Cong Wang <cong.wang@bytedance.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Jakub Sitnicki <jakub@cloudflare.com> Link: https://lore.kernel.org/bpf/20210223184934.6054-4-xiyou.wangcong@gmail.com
Diffstat (limited to '')
-rw-r--r--include/net/tcp.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c00e125dcfb9..947ef5da6867 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -886,18 +886,12 @@ struct tcp_skb_cb {
struct {
__u32 flags;
struct sock *sk_redir;
- void *data_end;
} bpf;
};
};
#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))
-static inline void bpf_compute_data_end_sk_skb(struct sk_buff *skb)
-{
- TCP_SKB_CB(skb)->bpf.data_end = skb->data + skb_headlen(skb);
-}
-
static inline bool tcp_skb_bpf_ingress(const struct sk_buff *skb)
{
return TCP_SKB_CB(skb)->bpf.flags & BPF_F_INGRESS;