xref: /linux/include/net/aligned_data.h (revision 998642e999d23324c5dbf38149606d09cec2c377)
13715b5dfSEric Dumazet /* SPDX-License-Identifier: GPL-2.0-or-later */
23715b5dfSEric Dumazet #ifndef _NET_ALIGNED_DATA_H
33715b5dfSEric Dumazet #define _NET_ALIGNED_DATA_H
43715b5dfSEric Dumazet 
5*998642e9SEric Dumazet #include <linux/atomic.h>
63715b5dfSEric Dumazet #include <linux/types.h>
73715b5dfSEric Dumazet 
83715b5dfSEric Dumazet /* Structure holding cacheline aligned fields on SMP builds.
93715b5dfSEric Dumazet  * Each field or group should have an ____cacheline_aligned_in_smp
103715b5dfSEric Dumazet  * attribute to ensure no accidental false sharing can happen.
113715b5dfSEric Dumazet  */
123715b5dfSEric Dumazet struct net_aligned_data {
13*998642e9SEric Dumazet 	atomic64_t	net_cookie ____cacheline_aligned_in_smp;
143715b5dfSEric Dumazet };
153715b5dfSEric Dumazet 
163715b5dfSEric Dumazet extern struct net_aligned_data net_aligned_data;
173715b5dfSEric Dumazet 
183715b5dfSEric Dumazet #endif /* _NET_ALIGNED_DATA_H */
19