hotdata.h 1.8 KB

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