• Alexei Starovoitov's avatar
    tc: bpf: add checksum helpers · 91bc4822
    Alexei Starovoitov authored
    Commit 608cd71a ("tc: bpf: generalize pedit action") has added the
    possibility to mangle packet data to BPF programs in the tc pipeline.
    This patch adds two helpers bpf_l3_csum_replace() and bpf_l4_csum_replace()
    for fixing up the protocol checksums after the packet mangling.
    
    It also adds 'flags' argument to bpf_skb_store_bytes() helper to avoid
    unnecessary checksum recomputations when BPF programs adjusting l3/l4
    checksums and documents all three helpers in uapi header.
    
    Moreover, a sample program is added to show how BPF programs can make use
    of the mangle and csum helpers.
    Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
    Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    91bc4822
Name
Last commit
Last update
..
Makefile Loading commit data...
bpf_helpers.h Loading commit data...
bpf_load.c Loading commit data...
bpf_load.h Loading commit data...
libbpf.c Loading commit data...
libbpf.h Loading commit data...
sock_example.c Loading commit data...
sockex1_kern.c Loading commit data...
sockex1_user.c Loading commit data...
sockex2_kern.c Loading commit data...
sockex2_user.c Loading commit data...
tcbpf1_kern.c Loading commit data...
test_maps.c Loading commit data...
test_verifier.c Loading commit data...