xref: /linux/include/net/hotdata.h (revision 71dfa617ea9f18e4585fe78364217cd32b1fc382)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _NET_HOTDATA_H
3 #define _NET_HOTDATA_H
4 
5 #include <linux/types.h>
6 #include <linux/netdevice.h>
7 #include <net/protocol.h>
8 
9 /* Read mostly data used in network fast paths. */
10 struct net_hotdata {
11 #if IS_ENABLED(CONFIG_INET)
12 	struct packet_offload	ip_packet_offload;
13 	struct net_offload	tcpv4_offload;
14 	struct net_protocol	tcp_protocol;
15 	struct net_offload 	udpv4_offload;
16 	struct net_protocol	udp_protocol;
17 	struct packet_offload	ipv6_packet_offload;
18 	struct net_offload	tcpv6_offload;
19 #if IS_ENABLED(CONFIG_IPV6)
20 	struct inet6_protocol	tcpv6_protocol;
21 	struct inet6_protocol	udpv6_protocol;
22 #endif
23 	struct net_offload	udpv6_offload;
24 #endif
25 	struct list_head	offload_base;
26 	struct list_head	ptype_all;
27 	struct kmem_cache	*skbuff_cache;
28 	struct kmem_cache	*skbuff_fclone_cache;
29 	struct kmem_cache	*skb_small_head_cache;
30 #ifdef CONFIG_RPS
31 	struct rps_sock_flow_table __rcu *rps_sock_flow_table;
32 	u32			rps_cpu_mask;
33 #endif
34 	int			gro_normal_batch;
35 	int			netdev_budget;
36 	int			netdev_budget_usecs;
37 	int			tstamp_prequeue;
38 	int			max_backlog;
39 	int			dev_tx_weight;
40 	int			dev_rx_weight;
41 };
42 
43 #define inet_ehash_secret	net_hotdata.tcp_protocol.secret
44 #define udp_ehash_secret	net_hotdata.udp_protocol.secret
45 #define inet6_ehash_secret	net_hotdata.tcpv6_protocol.secret
46 #define tcp_ipv6_hash_secret	net_hotdata.tcpv6_offload.secret
47 #define udp6_ehash_secret	net_hotdata.udpv6_protocol.secret
48 #define udp_ipv6_hash_secret	net_hotdata.udpv6_offload.secret
49 
50 extern struct net_hotdata net_hotdata;
51 
52 #endif /* _NET_HOTDATA_H */
53