Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Clarify role of BPF_F_RECOMPUTE_CSUM

BPF_F_RECOMPUTE_CSUM doesn't update the actual L3 and L4 checksums in
the packet, but simply updates skb->csum (according to skb->ip_summed).
This patch clarifies that to avoid confusions.

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/ff6895d42936f03dbb82334d8bcfd50e00c79086.1744102490.git.paul.chaignon@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Paul Chaignon and committed by
Alexei Starovoitov
b412fd6b 690d43d3

+18 -10
+9 -5
include/uapi/linux/bpf.h
··· 1995 1995 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags) 1996 1996 * Description 1997 1997 * Store *len* bytes from address *from* into the packet 1998 - * associated to *skb*, at *offset*. *flags* are a combination of 1999 - * **BPF_F_RECOMPUTE_CSUM** (automatically recompute the 2000 - * checksum for the packet after storing the bytes) and 2001 - * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\ 2002 - * **->swhash** and *skb*\ **->l4hash** to 0). 1998 + * associated to *skb*, at *offset*. The *flags* are a combination 1999 + * of the following values: 2000 + * 2001 + * **BPF_F_RECOMPUTE_CSUM** 2002 + * Automatically update *skb*\ **->csum** after storing the 2003 + * bytes. 2004 + * **BPF_F_INVALIDATE_HASH** 2005 + * Set *skb*\ **->hash**, *skb*\ **->swhash** and *skb*\ 2006 + * **->l4hash** to 0. 2003 2007 * 2004 2008 * A call to this helper is susceptible to change the underlying 2005 2009 * packet buffer. Therefore, at load time, all checks on pointers
+9 -5
tools/include/uapi/linux/bpf.h
··· 1995 1995 * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags) 1996 1996 * Description 1997 1997 * Store *len* bytes from address *from* into the packet 1998 - * associated to *skb*, at *offset*. *flags* are a combination of 1999 - * **BPF_F_RECOMPUTE_CSUM** (automatically recompute the 2000 - * checksum for the packet after storing the bytes) and 2001 - * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\ 2002 - * **->swhash** and *skb*\ **->l4hash** to 0). 1998 + * associated to *skb*, at *offset*. The *flags* are a combination 1999 + * of the following values: 2000 + * 2001 + * **BPF_F_RECOMPUTE_CSUM** 2002 + * Automatically update *skb*\ **->csum** after storing the 2003 + * bytes. 2004 + * **BPF_F_INVALIDATE_HASH** 2005 + * Set *skb*\ **->hash**, *skb*\ **->swhash** and *skb*\ 2006 + * **->l4hash** to 0. 2003 2007 * 2004 2008 * A call to this helper is susceptible to change the underlying 2005 2009 * packet buffer. Therefore, at load time, all checks on pointers