xref: /linux/include/net/aligned_data.h (revision 998642e999d23324c5dbf38149606d09cec2c377)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _NET_ALIGNED_DATA_H
3 #define _NET_ALIGNED_DATA_H
4 
5 #include <linux/atomic.h>
6 #include <linux/types.h>
7 
8 /* Structure holding cacheline aligned fields on SMP builds.
9  * Each field or group should have an ____cacheline_aligned_in_smp
10  * attribute to ensure no accidental false sharing can happen.
11  */
12 struct net_aligned_data {
13 	atomic64_t	net_cookie ____cacheline_aligned_in_smp;
14 };
15 
16 extern struct net_aligned_data net_aligned_data;
17 
18 #endif /* _NET_ALIGNED_DATA_H */
19