]> exis.tech > repos - linux.git/blob - include/net/aligned_data.h
Linux 6.17
[linux.git] / include / net / aligned_data.h
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 #if defined(CONFIG_INET)
15 atomic_long_t tcp_memory_allocated ____cacheline_aligned_in_smp;
16 atomic_long_t udp_memory_allocated ____cacheline_aligned_in_smp;
17 #endif
18 };
19
20 extern struct net_aligned_data net_aligned_data;
21
22 #endif /* _NET_ALIGNED_DATA_H */