Linux Audio

Check our new training course

Loading...
v6.2
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * ipv4 in net namespaces
  4 */
  5
  6#ifndef __NETNS_IPV4_H__
  7#define __NETNS_IPV4_H__
  8
  9#include <linux/uidgid.h>
 10#include <net/inet_frag.h>
 11#include <linux/rcupdate.h>
 12#include <linux/seqlock.h>
 13#include <linux/siphash.h>
 14
 15struct ctl_table_header;
 16struct ipv4_devconf;
 17struct fib_rules_ops;
 18struct hlist_head;
 19struct fib_table;
 20struct sock;
 21struct local_ports {
 22	seqlock_t	lock;
 23	int		range[2];
 24	bool		warned;
 25};
 26
 27struct ping_group_range {
 28	seqlock_t	lock;
 29	kgid_t		range[2];
 30};
 31
 32struct inet_hashinfo;
 33
 34struct inet_timewait_death_row {
 35	refcount_t		tw_refcount;
 36
 37	/* Padding to avoid false sharing, tw_refcount can be often written */
 38	struct inet_hashinfo 	*hashinfo ____cacheline_aligned_in_smp;
 39	int			sysctl_max_tw_buckets;
 40};
 41
 42struct tcp_fastopen_context;
 43
 44struct netns_ipv4 {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 45	struct inet_timewait_death_row tcp_death_row;
 46	struct udp_table *udp_table;
 47
 48#ifdef CONFIG_SYSCTL
 49	struct ctl_table_header	*forw_hdr;
 50	struct ctl_table_header	*frags_hdr;
 51	struct ctl_table_header	*ipv4_hdr;
 52	struct ctl_table_header *route_hdr;
 53	struct ctl_table_header *xfrm4_hdr;
 54#endif
 55	struct ipv4_devconf	*devconf_all;
 56	struct ipv4_devconf	*devconf_dflt;
 57	struct ip_ra_chain __rcu *ra_chain;
 58	struct mutex		ra_mutex;
 59#ifdef CONFIG_IP_MULTIPLE_TABLES
 60	struct fib_rules_ops	*rules_ops;
 61	struct fib_table __rcu	*fib_main;
 62	struct fib_table __rcu	*fib_default;
 63	unsigned int		fib_rules_require_fldissect;
 64	bool			fib_has_custom_rules;
 65#endif
 66	bool			fib_has_custom_local_routes;
 67	bool			fib_offload_disabled;
 
 68#ifdef CONFIG_IP_ROUTE_CLASSID
 69	atomic_t		fib_num_tclassid_users;
 70#endif
 71	struct hlist_head	*fib_table_hash;
 72	struct sock		*fibnl;
 73
 74	struct sock		*mc_autojoin_sk;
 75
 76	struct inet_peer_base	*peers;
 77	struct fqdir		*fqdir;
 78
 79	u8 sysctl_icmp_echo_ignore_all;
 80	u8 sysctl_icmp_echo_enable_probe;
 81	u8 sysctl_icmp_echo_ignore_broadcasts;
 82	u8 sysctl_icmp_ignore_bogus_error_responses;
 83	u8 sysctl_icmp_errors_use_inbound_ifaddr;
 84	int sysctl_icmp_ratelimit;
 85	int sysctl_icmp_ratemask;
 86
 87	u32 ip_rt_min_pmtu;
 88	int ip_rt_mtu_expires;
 89	int ip_rt_min_advmss;
 90
 91	struct local_ports ip_local_ports;
 92
 93	u8 sysctl_tcp_ecn;
 94	u8 sysctl_tcp_ecn_fallback;
 95
 96	u8 sysctl_ip_default_ttl;
 97	u8 sysctl_ip_no_pmtu_disc;
 98	u8 sysctl_ip_fwd_use_pmtu;
 99	u8 sysctl_ip_fwd_update_priority;
100	u8 sysctl_ip_nonlocal_bind;
101	u8 sysctl_ip_autobind_reuse;
102	/* Shall we try to damage output packets if routing dev changes? */
103	u8 sysctl_ip_dynaddr;
104	u8 sysctl_ip_early_demux;
105#ifdef CONFIG_NET_L3_MASTER_DEV
106	u8 sysctl_raw_l3mdev_accept;
107#endif
108	u8 sysctl_tcp_early_demux;
109	u8 sysctl_udp_early_demux;
110
111	u8 sysctl_nexthop_compat_mode;
112
113	u8 sysctl_fwmark_reflect;
114	u8 sysctl_tcp_fwmark_accept;
115#ifdef CONFIG_NET_L3_MASTER_DEV
116	u8 sysctl_tcp_l3mdev_accept;
117#endif
118	u8 sysctl_tcp_mtu_probing;
119	int sysctl_tcp_mtu_probe_floor;
120	int sysctl_tcp_base_mss;
121	int sysctl_tcp_min_snd_mss;
122	int sysctl_tcp_probe_threshold;
123	u32 sysctl_tcp_probe_interval;
124
125	int sysctl_tcp_keepalive_time;
126	int sysctl_tcp_keepalive_intvl;
127	u8 sysctl_tcp_keepalive_probes;
128
129	u8 sysctl_tcp_syn_retries;
130	u8 sysctl_tcp_synack_retries;
131	u8 sysctl_tcp_syncookies;
132	u8 sysctl_tcp_migrate_req;
133	u8 sysctl_tcp_comp_sack_nr;
134	int sysctl_tcp_reordering;
 
 
135	u8 sysctl_tcp_retries1;
136	u8 sysctl_tcp_retries2;
137	u8 sysctl_tcp_orphan_retries;
138	u8 sysctl_tcp_tw_reuse;
139	int sysctl_tcp_fin_timeout;
140	unsigned int sysctl_tcp_notsent_lowat;
141	u8 sysctl_tcp_sack;
142	u8 sysctl_tcp_window_scaling;
143	u8 sysctl_tcp_timestamps;
144	u8 sysctl_tcp_early_retrans;
145	u8 sysctl_tcp_recovery;
146	u8 sysctl_tcp_thin_linear_timeouts;
147	u8 sysctl_tcp_slow_start_after_idle;
148	u8 sysctl_tcp_retrans_collapse;
149	u8 sysctl_tcp_stdurg;
150	u8 sysctl_tcp_rfc1337;
151	u8 sysctl_tcp_abort_on_overflow;
152	u8 sysctl_tcp_fack; /* obsolete */
153	int sysctl_tcp_max_reordering;
154	int sysctl_tcp_adv_win_scale;
155	u8 sysctl_tcp_dsack;
156	u8 sysctl_tcp_app_win;
157	u8 sysctl_tcp_frto;
158	u8 sysctl_tcp_nometrics_save;
159	u8 sysctl_tcp_no_ssthresh_metrics_save;
160	u8 sysctl_tcp_moderate_rcvbuf;
161	u8 sysctl_tcp_tso_win_divisor;
162	u8 sysctl_tcp_workaround_signed_windows;
163	int sysctl_tcp_limit_output_bytes;
164	int sysctl_tcp_challenge_ack_limit;
165	int sysctl_tcp_min_rtt_wlen;
166	u8 sysctl_tcp_min_tso_segs;
167	u8 sysctl_tcp_tso_rtt_log;
168	u8 sysctl_tcp_autocorking;
169	u8 sysctl_tcp_reflect_tos;
170	int sysctl_tcp_invalid_ratelimit;
171	int sysctl_tcp_pacing_ss_ratio;
172	int sysctl_tcp_pacing_ca_ratio;
173	int sysctl_tcp_wmem[3];
174	int sysctl_tcp_rmem[3];
175	unsigned int sysctl_tcp_child_ehash_entries;
176	unsigned long sysctl_tcp_comp_sack_delay_ns;
177	unsigned long sysctl_tcp_comp_sack_slack_ns;
178	int sysctl_max_syn_backlog;
179	int sysctl_tcp_fastopen;
180	const struct tcp_congestion_ops __rcu  *tcp_congestion_control;
181	struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
182	unsigned int sysctl_tcp_fastopen_blackhole_timeout;
183	atomic_t tfo_active_disable_times;
184	unsigned long tfo_active_disable_stamp;
185	u32 tcp_challenge_timestamp;
186	u32 tcp_challenge_count;
187	u8 sysctl_tcp_plb_enabled;
188	u8 sysctl_tcp_plb_idle_rehash_rounds;
189	u8 sysctl_tcp_plb_rehash_rounds;
190	u8 sysctl_tcp_plb_suspend_rto_sec;
191	int sysctl_tcp_plb_cong_thresh;
192
193	int sysctl_udp_wmem_min;
194	int sysctl_udp_rmem_min;
195
196	u8 sysctl_fib_notify_on_flag_change;
 
197
198#ifdef CONFIG_NET_L3_MASTER_DEV
199	u8 sysctl_udp_l3mdev_accept;
200#endif
201
202	u8 sysctl_igmp_llm_reports;
203	int sysctl_igmp_max_memberships;
204	int sysctl_igmp_max_msf;
205	int sysctl_igmp_qrv;
206
207	struct ping_group_range ping_group_range;
208
209	atomic_t dev_addr_genid;
210
211	unsigned int sysctl_udp_child_hash_entries;
212
213#ifdef CONFIG_SYSCTL
214	unsigned long *sysctl_local_reserved_ports;
215	int sysctl_ip_prot_sock;
216#endif
217
218#ifdef CONFIG_IP_MROUTE
219#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
220	struct mr_table		*mrt;
221#else
222	struct list_head	mr_tables;
223	struct fib_rules_ops	*mr_rules_ops;
224#endif
225#endif
226#ifdef CONFIG_IP_ROUTE_MULTIPATH
227	u32 sysctl_fib_multipath_hash_fields;
228	u8 sysctl_fib_multipath_use_neigh;
229	u8 sysctl_fib_multipath_hash_policy;
230#endif
231
232	struct fib_notifier_ops	*notifier_ops;
233	unsigned int	fib_seq;	/* protected by rtnl_mutex */
234
235	struct fib_notifier_ops	*ipmr_notifier_ops;
236	unsigned int	ipmr_seq;	/* protected by rtnl_mutex */
237
238	atomic_t	rt_genid;
239	siphash_key_t	ip_id_key;
240};
241#endif
v6.9.4
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * ipv4 in net namespaces
  4 */
  5
  6#ifndef __NETNS_IPV4_H__
  7#define __NETNS_IPV4_H__
  8
  9#include <linux/uidgid.h>
 10#include <net/inet_frag.h>
 11#include <linux/rcupdate.h>
 12#include <linux/seqlock.h>
 13#include <linux/siphash.h>
 14
 15struct ctl_table_header;
 16struct ipv4_devconf;
 17struct fib_rules_ops;
 18struct hlist_head;
 19struct fib_table;
 20struct sock;
 21struct local_ports {
 22	u32		range;	/* high << 16 | low */
 
 23	bool		warned;
 24};
 25
 26struct ping_group_range {
 27	seqlock_t	lock;
 28	kgid_t		range[2];
 29};
 30
 31struct inet_hashinfo;
 32
 33struct inet_timewait_death_row {
 34	refcount_t		tw_refcount;
 35
 36	/* Padding to avoid false sharing, tw_refcount can be often written */
 37	struct inet_hashinfo 	*hashinfo ____cacheline_aligned_in_smp;
 38	int			sysctl_max_tw_buckets;
 39};
 40
 41struct tcp_fastopen_context;
 42
 43struct netns_ipv4 {
 44	/* Cacheline organization can be found documented in
 45	 * Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst.
 46	 * Please update the document when adding new fields.
 47	 */
 48
 49	/* TX readonly hotpath cache lines */
 50	__cacheline_group_begin(netns_ipv4_read_tx);
 51	u8 sysctl_tcp_early_retrans;
 52	u8 sysctl_tcp_tso_win_divisor;
 53	u8 sysctl_tcp_tso_rtt_log;
 54	u8 sysctl_tcp_autocorking;
 55	int sysctl_tcp_min_snd_mss;
 56	unsigned int sysctl_tcp_notsent_lowat;
 57	int sysctl_tcp_limit_output_bytes;
 58	int sysctl_tcp_min_rtt_wlen;
 59	int sysctl_tcp_wmem[3];
 60	u8 sysctl_ip_fwd_use_pmtu;
 61	__cacheline_group_end(netns_ipv4_read_tx);
 62
 63	/* TXRX readonly hotpath cache lines */
 64	__cacheline_group_begin(netns_ipv4_read_txrx);
 65	u8 sysctl_tcp_moderate_rcvbuf;
 66	__cacheline_group_end(netns_ipv4_read_txrx);
 67
 68	/* RX readonly hotpath cache line */
 69	__cacheline_group_begin(netns_ipv4_read_rx);
 70	u8 sysctl_ip_early_demux;
 71	u8 sysctl_tcp_early_demux;
 72	int sysctl_tcp_reordering;
 73	int sysctl_tcp_rmem[3];
 74	__cacheline_group_end(netns_ipv4_read_rx);
 75
 76	struct inet_timewait_death_row tcp_death_row;
 77	struct udp_table *udp_table;
 78
 79#ifdef CONFIG_SYSCTL
 80	struct ctl_table_header	*forw_hdr;
 81	struct ctl_table_header	*frags_hdr;
 82	struct ctl_table_header	*ipv4_hdr;
 83	struct ctl_table_header *route_hdr;
 84	struct ctl_table_header *xfrm4_hdr;
 85#endif
 86	struct ipv4_devconf	*devconf_all;
 87	struct ipv4_devconf	*devconf_dflt;
 88	struct ip_ra_chain __rcu *ra_chain;
 89	struct mutex		ra_mutex;
 90#ifdef CONFIG_IP_MULTIPLE_TABLES
 91	struct fib_rules_ops	*rules_ops;
 92	struct fib_table __rcu	*fib_main;
 93	struct fib_table __rcu	*fib_default;
 94	unsigned int		fib_rules_require_fldissect;
 95	bool			fib_has_custom_rules;
 96#endif
 97	bool			fib_has_custom_local_routes;
 98	bool			fib_offload_disabled;
 99	u8			sysctl_tcp_shrink_window;
100#ifdef CONFIG_IP_ROUTE_CLASSID
101	atomic_t		fib_num_tclassid_users;
102#endif
103	struct hlist_head	*fib_table_hash;
104	struct sock		*fibnl;
105
106	struct sock		*mc_autojoin_sk;
107
108	struct inet_peer_base	*peers;
109	struct fqdir		*fqdir;
110
111	u8 sysctl_icmp_echo_ignore_all;
112	u8 sysctl_icmp_echo_enable_probe;
113	u8 sysctl_icmp_echo_ignore_broadcasts;
114	u8 sysctl_icmp_ignore_bogus_error_responses;
115	u8 sysctl_icmp_errors_use_inbound_ifaddr;
116	int sysctl_icmp_ratelimit;
117	int sysctl_icmp_ratemask;
118
119	u32 ip_rt_min_pmtu;
120	int ip_rt_mtu_expires;
121	int ip_rt_min_advmss;
122
123	struct local_ports ip_local_ports;
124
125	u8 sysctl_tcp_ecn;
126	u8 sysctl_tcp_ecn_fallback;
127
128	u8 sysctl_ip_default_ttl;
129	u8 sysctl_ip_no_pmtu_disc;
 
130	u8 sysctl_ip_fwd_update_priority;
131	u8 sysctl_ip_nonlocal_bind;
132	u8 sysctl_ip_autobind_reuse;
133	/* Shall we try to damage output packets if routing dev changes? */
134	u8 sysctl_ip_dynaddr;
 
135#ifdef CONFIG_NET_L3_MASTER_DEV
136	u8 sysctl_raw_l3mdev_accept;
137#endif
 
138	u8 sysctl_udp_early_demux;
139
140	u8 sysctl_nexthop_compat_mode;
141
142	u8 sysctl_fwmark_reflect;
143	u8 sysctl_tcp_fwmark_accept;
144#ifdef CONFIG_NET_L3_MASTER_DEV
145	u8 sysctl_tcp_l3mdev_accept;
146#endif
147	u8 sysctl_tcp_mtu_probing;
148	int sysctl_tcp_mtu_probe_floor;
149	int sysctl_tcp_base_mss;
 
150	int sysctl_tcp_probe_threshold;
151	u32 sysctl_tcp_probe_interval;
152
153	int sysctl_tcp_keepalive_time;
154	int sysctl_tcp_keepalive_intvl;
155	u8 sysctl_tcp_keepalive_probes;
156
157	u8 sysctl_tcp_syn_retries;
158	u8 sysctl_tcp_synack_retries;
159	u8 sysctl_tcp_syncookies;
160	u8 sysctl_tcp_migrate_req;
161	u8 sysctl_tcp_comp_sack_nr;
162	u8 sysctl_tcp_backlog_ack_defer;
163	u8 sysctl_tcp_pingpong_thresh;
164
165	u8 sysctl_tcp_retries1;
166	u8 sysctl_tcp_retries2;
167	u8 sysctl_tcp_orphan_retries;
168	u8 sysctl_tcp_tw_reuse;
169	int sysctl_tcp_fin_timeout;
 
170	u8 sysctl_tcp_sack;
171	u8 sysctl_tcp_window_scaling;
172	u8 sysctl_tcp_timestamps;
 
173	u8 sysctl_tcp_recovery;
174	u8 sysctl_tcp_thin_linear_timeouts;
175	u8 sysctl_tcp_slow_start_after_idle;
176	u8 sysctl_tcp_retrans_collapse;
177	u8 sysctl_tcp_stdurg;
178	u8 sysctl_tcp_rfc1337;
179	u8 sysctl_tcp_abort_on_overflow;
180	u8 sysctl_tcp_fack; /* obsolete */
181	int sysctl_tcp_max_reordering;
182	int sysctl_tcp_adv_win_scale; /* obsolete */
183	u8 sysctl_tcp_dsack;
184	u8 sysctl_tcp_app_win;
185	u8 sysctl_tcp_frto;
186	u8 sysctl_tcp_nometrics_save;
187	u8 sysctl_tcp_no_ssthresh_metrics_save;
 
 
188	u8 sysctl_tcp_workaround_signed_windows;
 
189	int sysctl_tcp_challenge_ack_limit;
 
190	u8 sysctl_tcp_min_tso_segs;
 
 
191	u8 sysctl_tcp_reflect_tos;
192	int sysctl_tcp_invalid_ratelimit;
193	int sysctl_tcp_pacing_ss_ratio;
194	int sysctl_tcp_pacing_ca_ratio;
 
 
195	unsigned int sysctl_tcp_child_ehash_entries;
196	unsigned long sysctl_tcp_comp_sack_delay_ns;
197	unsigned long sysctl_tcp_comp_sack_slack_ns;
198	int sysctl_max_syn_backlog;
199	int sysctl_tcp_fastopen;
200	const struct tcp_congestion_ops __rcu  *tcp_congestion_control;
201	struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
202	unsigned int sysctl_tcp_fastopen_blackhole_timeout;
203	atomic_t tfo_active_disable_times;
204	unsigned long tfo_active_disable_stamp;
205	u32 tcp_challenge_timestamp;
206	u32 tcp_challenge_count;
207	u8 sysctl_tcp_plb_enabled;
208	u8 sysctl_tcp_plb_idle_rehash_rounds;
209	u8 sysctl_tcp_plb_rehash_rounds;
210	u8 sysctl_tcp_plb_suspend_rto_sec;
211	int sysctl_tcp_plb_cong_thresh;
212
213	int sysctl_udp_wmem_min;
214	int sysctl_udp_rmem_min;
215
216	u8 sysctl_fib_notify_on_flag_change;
217	u8 sysctl_tcp_syn_linear_timeouts;
218
219#ifdef CONFIG_NET_L3_MASTER_DEV
220	u8 sysctl_udp_l3mdev_accept;
221#endif
222
223	u8 sysctl_igmp_llm_reports;
224	int sysctl_igmp_max_memberships;
225	int sysctl_igmp_max_msf;
226	int sysctl_igmp_qrv;
227
228	struct ping_group_range ping_group_range;
229
230	atomic_t dev_addr_genid;
231
232	unsigned int sysctl_udp_child_hash_entries;
233
234#ifdef CONFIG_SYSCTL
235	unsigned long *sysctl_local_reserved_ports;
236	int sysctl_ip_prot_sock;
237#endif
238
239#ifdef CONFIG_IP_MROUTE
240#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
241	struct mr_table		*mrt;
242#else
243	struct list_head	mr_tables;
244	struct fib_rules_ops	*mr_rules_ops;
245#endif
246#endif
247#ifdef CONFIG_IP_ROUTE_MULTIPATH
248	u32 sysctl_fib_multipath_hash_fields;
249	u8 sysctl_fib_multipath_use_neigh;
250	u8 sysctl_fib_multipath_hash_policy;
251#endif
252
253	struct fib_notifier_ops	*notifier_ops;
254	unsigned int	fib_seq;	/* protected by rtnl_mutex */
255
256	struct fib_notifier_ops	*ipmr_notifier_ops;
257	unsigned int	ipmr_seq;	/* protected by rtnl_mutex */
258
259	atomic_t	rt_genid;
260	siphash_key_t	ip_id_key;
261};
262#endif