diff options
author | 2020-08-20 12:00:39 -0700 | |
---|---|---|
committer | 2020-08-24 14:35:00 -0700 | |
commit | 72be0fe6ba76282704cb84952bd5a1eb47910290 (patch) | |
tree | 09bb1361ab8aed72d9809fa71114c026b07450bf /scripts/bpf_helpers_doc.py | |
parent | tcp: Add saw_unknown to struct tcp_options_received (diff) | |
download | linux-dev-72be0fe6ba76282704cb84952bd5a1eb47910290.tar.xz linux-dev-72be0fe6ba76282704cb84952bd5a1eb47910290.zip |
bpf: tcp: Add bpf_skops_established()
In tcp_init_transfer(), it currently calls the bpf prog to give it a
chance to handle the just "ESTABLISHED" event (e.g. do setsockopt
on the newly established sk). Right now, it is done by calling the
general purpose tcp_call_bpf().
In the later patch, it also needs to pass the just-received skb which
concludes the 3 way handshake. E.g. the SYNACK received at the active side.
The bpf prog can then learn some specific header options written by the
peer's bpf-prog and potentially do setsockopt on the newly established sk.
Thus, instead of reusing the general purpose tcp_call_bpf(), a new function
bpf_skops_established() is added to allow passing the "skb" to the bpf
prog. The actual skb passing from bpf_skops_established() to the bpf prog
will happen together in a later patch which has the necessary bpf pieces.
A "skb" arg is also added to tcp_init_transfer() such that
it can then be passed to bpf_skops_established().
Calling the new bpf_skops_established() instead of tcp_call_bpf()
should be a noop in this patch.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200820190039.2884750-1-kafai@fb.com
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions