summaryrefslogtreecommitdiff
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-03-20 18:41:14 -0700
committerMartin KaFai Lau <martin.lau@kernel.org>2023-03-20 21:57:49 -0700
commitb94e032b7ad6318b36615f0e0cc3b0d61a5531e8 (patch)
treeb895dc3f9d3caa60a32f5b28849fd8e141506cad /include/linux/skbuff.h
parent04aae213e719ec2bb310158c4025316ace50589b (diff)
net: skbuff: reorder bytes 2 and 3 of the bitfield
BPF needs to know the offsets of fields it tries to access. Zero-length fields are added to make offsetof() work. This unfortunately partitions the bitfield (fields across the zero-length members can't be coalesced). Reorder bytes 2 and 3, BPF needs to know the offset of fields previously in byte 3 and some fields in byte 2 should really be optional. The two bytes are always in the same cacheline so it should not matter. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20230321014115.997841-3-kuba@kernel.org Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 5a63878a4550..36d31e74db37 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -944,16 +944,6 @@ struct sk_buff {
__u8 ip_summed:2;
__u8 ooo_okay:1;
- __u8 l4_hash:1;
- __u8 sw_hash:1;
- __u8 wifi_acked_valid:1;
- __u8 wifi_acked:1;
- __u8 no_fcs:1;
- /* Indicates the inner headers are valid in the skbuff. */
- __u8 encapsulation:1;
- __u8 encap_hdr_csum:1;
- __u8 csum_valid:1;
-
/* private: */
__u8 __mono_tc_offset[0];
/* public: */
@@ -966,6 +956,16 @@ struct sk_buff {
__u8 tc_skip_classify:1;
__u8 tc_at_ingress:1; /* See TC_AT_INGRESS_MASK */
#endif
+
+ __u8 l4_hash:1;
+ __u8 sw_hash:1;
+ __u8 wifi_acked_valid:1;
+ __u8 wifi_acked:1;
+ __u8 no_fcs:1;
+ /* Indicates the inner headers are valid in the skbuff. */
+ __u8 encapsulation:1;
+ __u8 encap_hdr_csum:1;
+ __u8 csum_valid:1;
#ifdef CONFIG_IPV6_NDISC_NODETYPE
__u8 ndisc_nodetype:2;
#endif