Subject: Re: [PATCH net-next] tc: bpf: add checksum helpers

From: Daniel Borkmann <[email-masked]>
Date: Thu, 02 Apr 2015 17:00:47 +0200

On 04/02/2015 02:12 AM, Alexei Starovoitov wrote:
> Commit 608cd71a9c7c ("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: Alexei Starovoitov <ast-uqk4Ao+rVK5Wk0Htik3J/[email-masked]>

I think in future we need to find a better place for these helpers,
as they are for cls_bpf and act_bpf.

Acked-by: Daniel Borkmann <[email-masked]>