]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
8afd351c PE |
2 | /* |
3 | * ipv4 in net namespaces | |
4 | */ | |
5 | ||
6 | #ifndef __NETNS_IPV4_H__ | |
7 | #define __NETNS_IPV4_H__ | |
e4e4971c | 8 | |
7064d16e | 9 | #include <linux/uidgid.h> |
ac18e750 | 10 | #include <net/inet_frag.h> |
a7e53531 | 11 | #include <linux/rcupdate.h> |
949d6b40 | 12 | #include <linux/seqlock.h> |
df453700 | 13 | #include <linux/siphash.h> |
ac18e750 | 14 | |
752d14dc PE |
15 | struct ctl_table_header; |
16 | struct ipv4_devconf; | |
e4e4971c | 17 | struct fib_rules_ops; |
e4aef8ae | 18 | struct hlist_head; |
f4530fa5 | 19 | struct fib_table; |
6bd48fcf | 20 | struct sock; |
0bbf87d8 | 21 | struct local_ports { |
d9f28735 | 22 | u32 range; /* high << 16 | low */ |
ed2dfd90 | 23 | bool warned; |
0bbf87d8 | 24 | }; |
752d14dc | 25 | |
ba6b918a CW |
26 | struct ping_group_range { |
27 | seqlock_t lock; | |
28 | kgid_t range[2]; | |
29 | }; | |
30 | ||
1946e672 HY |
31 | struct inet_hashinfo; |
32 | ||
33 | struct inet_timewait_death_row { | |
fbb82952 | 34 | refcount_t tw_refcount; |
1946e672 | 35 | |
e9bd0cca | 36 | /* Padding to avoid false sharing, tw_refcount can be often written */ |
fbb82952 | 37 | struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp; |
1946e672 HY |
38 | int sysctl_max_tw_buckets; |
39 | }; | |
40 | ||
43713848 HY |
41 | struct tcp_fastopen_context; |
42 | ||
4ee2a8ca PM |
43 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
44 | struct sysctl_fib_multipath_hash_seed { | |
45 | u32 user_seed; | |
46 | u32 mp_seed; | |
47 | }; | |
48 | #endif | |
49 | ||
8afd351c | 50 | struct netns_ipv4 { |
18fd64d2 CL |
51 | /* Cacheline organization can be found documented in |
52 | * Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst. | |
53 | * Please update the document when adding new fields. | |
54 | */ | |
55 | ||
56 | /* TX readonly hotpath cache lines */ | |
57 | __cacheline_group_begin(netns_ipv4_read_tx); | |
58 | u8 sysctl_tcp_early_retrans; | |
59 | u8 sysctl_tcp_tso_win_divisor; | |
60 | u8 sysctl_tcp_tso_rtt_log; | |
61 | u8 sysctl_tcp_autocorking; | |
62 | int sysctl_tcp_min_snd_mss; | |
63 | unsigned int sysctl_tcp_notsent_lowat; | |
64 | int sysctl_tcp_limit_output_bytes; | |
65 | int sysctl_tcp_min_rtt_wlen; | |
66 | int sysctl_tcp_wmem[3]; | |
67 | u8 sysctl_ip_fwd_use_pmtu; | |
68 | __cacheline_group_end(netns_ipv4_read_tx); | |
69 | ||
70 | /* TXRX readonly hotpath cache lines */ | |
71 | __cacheline_group_begin(netns_ipv4_read_txrx); | |
72 | u8 sysctl_tcp_moderate_rcvbuf; | |
73 | __cacheline_group_end(netns_ipv4_read_txrx); | |
74 | ||
75 | /* RX readonly hotpath cache line */ | |
76 | __cacheline_group_begin(netns_ipv4_read_rx); | |
77 | u8 sysctl_ip_early_demux; | |
78 | u8 sysctl_tcp_early_demux; | |
d677aebd ED |
79 | u8 sysctl_tcp_l3mdev_accept; |
80 | /* 3 bytes hole, try to pack */ | |
18fd64d2 CL |
81 | int sysctl_tcp_reordering; |
82 | int sysctl_tcp_rmem[3]; | |
83 | __cacheline_group_end(netns_ipv4_read_rx); | |
84 | ||
e9bd0cca | 85 | struct inet_timewait_death_row tcp_death_row; |
67fb4330 | 86 | struct udp_table *udp_table; |
1caf8d39 | 87 | |
2a75de0c | 88 | #ifdef CONFIG_SYSCTL |
752d14dc | 89 | struct ctl_table_header *forw_hdr; |
e4a2d5c2 | 90 | struct ctl_table_header *frags_hdr; |
68528f09 | 91 | struct ctl_table_header *ipv4_hdr; |
39a23e75 | 92 | struct ctl_table_header *route_hdr; |
8d068875 | 93 | struct ctl_table_header *xfrm4_hdr; |
2a75de0c | 94 | #endif |
752d14dc PE |
95 | struct ipv4_devconf *devconf_all; |
96 | struct ipv4_devconf *devconf_dflt; | |
5796ef75 | 97 | struct ip_ra_chain __rcu *ra_chain; |
d9ff3049 | 98 | struct mutex ra_mutex; |
e4e4971c DL |
99 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
100 | struct fib_rules_ops *rules_ops; | |
a7e53531 AD |
101 | struct fib_table __rcu *fib_main; |
102 | struct fib_table __rcu *fib_default; | |
490f33c4 ED |
103 | unsigned int fib_rules_require_fldissect; |
104 | bool fib_has_custom_rules; | |
f4530fa5 | 105 | #endif |
a1f3316d | 106 | bool fib_has_custom_local_routes; |
490f33c4 | 107 | bool fib_offload_disabled; |
b650d953 | 108 | u8 sysctl_tcp_shrink_window; |
f4530fa5 | 109 | #ifdef CONFIG_IP_ROUTE_CLASSID |
213f5f8f | 110 | atomic_t fib_num_tclassid_users; |
e4e4971c | 111 | #endif |
e4aef8ae | 112 | struct hlist_head *fib_table_hash; |
6bd48fcf | 113 | struct sock *fibnl; |
ac18e750 | 114 | |
93a714d6 | 115 | struct sock *mc_autojoin_sk; |
349c9e3c | 116 | |
c8a627ed | 117 | struct inet_peer_base *peers; |
4907abc6 | 118 | struct fqdir *fqdir; |
a24022e1 | 119 | |
4b6bbf17 | 120 | u8 sysctl_icmp_echo_ignore_all; |
f1b8fa9f | 121 | u8 sysctl_icmp_echo_enable_probe; |
4b6bbf17 ED |
122 | u8 sysctl_icmp_echo_ignore_broadcasts; |
123 | u8 sysctl_icmp_ignore_bogus_error_responses; | |
124 | u8 sysctl_icmp_errors_use_inbound_ifaddr; | |
a24022e1 PE |
125 | int sysctl_icmp_ratelimit; |
126 | int sysctl_icmp_ratemask; | |
f17bf505 ED |
127 | int sysctl_icmp_msgs_per_sec; |
128 | int sysctl_icmp_msgs_burst; | |
b056b4cd ED |
129 | atomic_t icmp_global_credit; |
130 | u32 icmp_global_stamp; | |
1de6b15a | 131 | u32 ip_rt_min_pmtu; |
1135fad2 | 132 | int ip_rt_mtu_expires; |
2e9589ff | 133 | int ip_rt_min_advmss; |
1de6b15a | 134 | |
c9d8f1a6 | 135 | struct local_ports ip_local_ports; |
0bbf87d8 | 136 | |
4b6bbf17 ED |
137 | u8 sysctl_tcp_ecn; |
138 | u8 sysctl_tcp_ecn_fallback; | |
49213555 | 139 | |
4b6bbf17 ED |
140 | u8 sysctl_ip_default_ttl; |
141 | u8 sysctl_ip_no_pmtu_disc; | |
1c69dedc | 142 | u8 sysctl_ip_fwd_update_priority; |
4b6bbf17 ED |
143 | u8 sysctl_ip_nonlocal_bind; |
144 | u8 sysctl_ip_autobind_reuse; | |
287b7f38 | 145 | /* Shall we try to damage output packets if routing dev changes? */ |
4b6bbf17 | 146 | u8 sysctl_ip_dynaddr; |
6897445f | 147 | #ifdef CONFIG_NET_L3_MASTER_DEV |
4b6bbf17 | 148 | u8 sysctl_raw_l3mdev_accept; |
6897445f | 149 | #endif |
2932bcda | 150 | u8 sysctl_udp_early_demux; |
5d134f1c | 151 | |
4b6bbf17 | 152 | u8 sysctl_nexthop_compat_mode; |
4f80116d | 153 | |
4b6bbf17 | 154 | u8 sysctl_fwmark_reflect; |
4ecc1baf | 155 | u8 sysctl_tcp_fwmark_accept; |
4ecc1baf | 156 | u8 sysctl_tcp_mtu_probing; |
c04b79b6 | 157 | int sysctl_tcp_mtu_probe_floor; |
b0f9ca53 | 158 | int sysctl_tcp_base_mss; |
6b58e0a5 | 159 | int sysctl_tcp_probe_threshold; |
05cbc0db | 160 | u32 sysctl_tcp_probe_interval; |
e110861f | 161 | |
13b287e8 | 162 | int sysctl_tcp_keepalive_time; |
b840d15d | 163 | int sysctl_tcp_keepalive_intvl; |
4ecc1baf | 164 | u8 sysctl_tcp_keepalive_probes; |
13b287e8 | 165 | |
4ecc1baf ED |
166 | u8 sysctl_tcp_syn_retries; |
167 | u8 sysctl_tcp_synack_retries; | |
168 | u8 sysctl_tcp_syncookies; | |
f9ac779f | 169 | u8 sysctl_tcp_migrate_req; |
65466904 | 170 | u8 sysctl_tcp_comp_sack_nr; |
133c4c0d | 171 | u8 sysctl_tcp_backlog_ack_defer; |
562b1fdf HZ |
172 | u8 sysctl_tcp_pingpong_thresh; |
173 | ||
4ecc1baf ED |
174 | u8 sysctl_tcp_retries1; |
175 | u8 sysctl_tcp_retries2; | |
176 | u8 sysctl_tcp_orphan_retries; | |
177 | u8 sysctl_tcp_tw_reuse; | |
ca6a6f93 | 178 | unsigned int sysctl_tcp_tw_reuse_delay; |
1e579caa | 179 | int sysctl_tcp_fin_timeout; |
4ecc1baf ED |
180 | u8 sysctl_tcp_sack; |
181 | u8 sysctl_tcp_window_scaling; | |
182 | u8 sysctl_tcp_timestamps; | |
f086edef | 183 | int sysctl_tcp_rto_min_us; |
4ecc1baf ED |
184 | u8 sysctl_tcp_recovery; |
185 | u8 sysctl_tcp_thin_linear_timeouts; | |
186 | u8 sysctl_tcp_slow_start_after_idle; | |
187 | u8 sysctl_tcp_retrans_collapse; | |
188 | u8 sysctl_tcp_stdurg; | |
189 | u8 sysctl_tcp_rfc1337; | |
190 | u8 sysctl_tcp_abort_on_overflow; | |
191 | u8 sysctl_tcp_fack; /* obsolete */ | |
c6e21803 | 192 | int sysctl_tcp_max_reordering; |
dfa2f048 | 193 | int sysctl_tcp_adv_win_scale; /* obsolete */ |
4ecc1baf ED |
194 | u8 sysctl_tcp_dsack; |
195 | u8 sysctl_tcp_app_win; | |
196 | u8 sysctl_tcp_frto; | |
197 | u8 sysctl_tcp_nometrics_save; | |
198 | u8 sysctl_tcp_no_ssthresh_metrics_save; | |
4ecc1baf | 199 | u8 sysctl_tcp_workaround_signed_windows; |
b530b681 | 200 | int sysctl_tcp_challenge_ack_limit; |
4ecc1baf | 201 | u8 sysctl_tcp_min_tso_segs; |
4ecc1baf | 202 | u8 sysctl_tcp_reflect_tos; |
4170ba6b | 203 | int sysctl_tcp_invalid_ratelimit; |
23a7102a | 204 | int sysctl_tcp_pacing_ss_ratio; |
c26e91f8 | 205 | int sysctl_tcp_pacing_ca_ratio; |
d1e5e640 | 206 | unsigned int sysctl_tcp_child_ehash_entries; |
6d82aa24 | 207 | unsigned long sysctl_tcp_comp_sack_delay_ns; |
a70437cc | 208 | unsigned long sysctl_tcp_comp_sack_slack_ns; |
fee83d09 | 209 | int sysctl_max_syn_backlog; |
e1cfcbe8 | 210 | int sysctl_tcp_fastopen; |
6670e152 | 211 | const struct tcp_congestion_ops __rcu *tcp_congestion_control; |
43713848 | 212 | struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; |
3733be14 HY |
213 | unsigned int sysctl_tcp_fastopen_blackhole_timeout; |
214 | atomic_t tfo_active_disable_times; | |
215 | unsigned long tfo_active_disable_stamp; | |
79e3602c ED |
216 | u32 tcp_challenge_timestamp; |
217 | u32 tcp_challenge_count; | |
bd456f28 MAQ |
218 | u8 sysctl_tcp_plb_enabled; |
219 | u8 sysctl_tcp_plb_idle_rehash_rounds; | |
220 | u8 sysctl_tcp_plb_rehash_rounds; | |
221 | u8 sysctl_tcp_plb_suspend_rto_sec; | |
222 | int sysctl_tcp_plb_cong_thresh; | |
12ed8244 | 223 | |
1e802951 TZ |
224 | int sysctl_udp_wmem_min; |
225 | int sysctl_udp_rmem_min; | |
226 | ||
b2908fac | 227 | u8 sysctl_fib_notify_on_flag_change; |
ccce324d | 228 | u8 sysctl_tcp_syn_linear_timeouts; |
680aea08 | 229 | |
63a6fff3 | 230 | #ifdef CONFIG_NET_L3_MASTER_DEV |
cd04bd02 | 231 | u8 sysctl_udp_l3mdev_accept; |
63a6fff3 RS |
232 | #endif |
233 | ||
7d4b37eb | 234 | u8 sysctl_igmp_llm_reports; |
815c5270 | 235 | int sysctl_igmp_max_memberships; |
166b6b2d | 236 | int sysctl_igmp_max_msf; |
165094af | 237 | int sysctl_igmp_qrv; |
815c5270 | 238 | |
ba6b918a | 239 | struct ping_group_range ping_group_range; |
c319b4d7 | 240 | |
436c3b66 | 241 | atomic_t dev_addr_genid; |
70a269e6 | 242 | |
9804985b KI |
243 | unsigned int sysctl_udp_child_hash_entries; |
244 | ||
122ff243 WC |
245 | #ifdef CONFIG_SYSCTL |
246 | unsigned long *sysctl_local_reserved_ports; | |
4548b683 | 247 | int sysctl_ip_prot_sock; |
122ff243 WC |
248 | #endif |
249 | ||
70a269e6 | 250 | #ifdef CONFIG_IP_MROUTE |
f0ad0860 | 251 | #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES |
0c12295a | 252 | struct mr_table *mrt; |
f0ad0860 PM |
253 | #else |
254 | struct list_head mr_tables; | |
255 | struct fib_rules_ops *mr_rules_ops; | |
256 | #endif | |
a6db4494 DA |
257 | #endif |
258 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | |
4ee2a8ca | 259 | struct sysctl_fib_multipath_hash_seed sysctl_fib_multipath_hash_seed; |
ce5c9c20 | 260 | u32 sysctl_fib_multipath_hash_fields; |
be205fe6 ED |
261 | u8 sysctl_fib_multipath_use_neigh; |
262 | u8 sysctl_fib_multipath_hash_policy; | |
70a269e6 | 263 | #endif |
cacaad11 | 264 | |
04b1d4e5 | 265 | struct fib_notifier_ops *notifier_ops; |
16207384 | 266 | unsigned int fib_seq; /* writes protected by rtnl_mutex */ |
cacaad11 | 267 | |
4d65b948 YG |
268 | struct fib_notifier_ops *ipmr_notifier_ops; |
269 | unsigned int ipmr_seq; /* protected by rtnl_mutex */ | |
270 | ||
ca4c3fc2 | 271 | atomic_t rt_genid; |
df453700 | 272 | siphash_key_t ip_id_key; |
87173021 | 273 | struct hlist_head *inet_addr_lst; |
1675f385 | 274 | struct delayed_work addr_chk_work; |
8afd351c PE |
275 | }; |
276 | #endif |