Skip to content

Commit b94e032

Browse files
kuba-mooMartin KaFai Lau
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
1 parent 04aae21 commit b94e032

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

include/linux/skbuff.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -944,16 +944,6 @@ struct sk_buff {
944944
__u8 ip_summed:2;
945945
__u8 ooo_okay:1;
946946

947-
__u8 l4_hash:1;
948-
__u8 sw_hash:1;
949-
__u8 wifi_acked_valid:1;
950-
__u8 wifi_acked:1;
951-
__u8 no_fcs:1;
952-
/* Indicates the inner headers are valid in the skbuff. */
953-
__u8 encapsulation:1;
954-
__u8 encap_hdr_csum:1;
955-
__u8 csum_valid:1;
956-
957947
/* private: */
958948
__u8 __mono_tc_offset[0];
959949
/* public: */
@@ -966,6 +956,16 @@ struct sk_buff {
966956
__u8 tc_skip_classify:1;
967957
__u8 tc_at_ingress:1; /* See TC_AT_INGRESS_MASK */
968958
#endif
959+
960+
__u8 l4_hash:1;
961+
__u8 sw_hash:1;
962+
__u8 wifi_acked_valid:1;
963+
__u8 wifi_acked:1;
964+
__u8 no_fcs:1;
965+
/* Indicates the inner headers are valid in the skbuff. */
966+
__u8 encapsulation:1;
967+
__u8 encap_hdr_csum:1;
968+
__u8 csum_valid:1;
969969
#ifdef CONFIG_IPV6_NDISC_NODETYPE
970970
__u8 ndisc_nodetype:2;
971971
#endif

0 commit comments

Comments
 (0)