blob: e3b9d8ed6ed5b43ab8e3c43764b8d9a27cd4c360 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001# SPDX-License-Identifier: GPL-2.0-only
2#
3# Network configuration
4#
5
6menuconfig NET
7 bool "Networking support"
8 select NLATTR
9 select GENERIC_NET_UTILS
10 select BPF
11 ---help---
12 Unless you really know what you are doing, you should say Y here.
13 The reason is that some programs need kernel networking support even
14 when running on a stand-alone machine that isn't connected to any
15 other computer.
16
17 If you are upgrading from an older kernel, you
18 should consider updating your networking tools too because changes
19 in the kernel and the tools often go hand in hand. The tools are
20 contained in the package net-tools, the location and version number
21 of which are given in <file:Documentation/Changes>.
22
23 For a general introduction to Linux networking, it is highly
24 recommended to read the NET-HOWTO, available from
25 <http://www.tldp.org/docs.html#howto>.
26
27if NET
28
29config ETHERNET_PACKET_MANGLE
30 bool
31 help
32 This option can be selected by phy drivers that need to mangle
33 packets going in or out of an ethernet device.
34
35config WANT_COMPAT_NETLINK_MESSAGES
36 bool
37 help
38 This option can be selected by other options that need compat
39 netlink messages.
40
41config COMPAT_NETLINK_MESSAGES
42 def_bool y
43 depends on COMPAT
44 depends on WEXT_CORE || WANT_COMPAT_NETLINK_MESSAGES
45 help
46 This option makes it possible to send different netlink messages
47 to tasks depending on whether the task is a compat task or not. To
48 achieve this, you need to set skb_shinfo(skb)->frag_list to the
49 compat skb before sending the skb, the netlink code will sort out
50 which message to actually pass to the task.
51
52 Newly written code should NEVER need this option but do
53 compat-independent messages instead!
54
55config NET_INGRESS
56 bool
57
58config NET_EGRESS
59 bool
60
61config NET_REDIRECT
62 bool
63
64config SKB_EXTENSIONS
65 bool
66
67menu "Networking options"
68
69source "net/packet/Kconfig"
70source "net/unix/Kconfig"
71source "net/tls/Kconfig"
72source "net/xfrm/Kconfig"
73source "net/iucv/Kconfig"
74source "net/smc/Kconfig"
75source "net/xdp/Kconfig"
76
77config INET
78 bool "TCP/IP networking"
79 ---help---
80 These are the protocols used on the Internet and on most local
81 Ethernets. It is highly recommended to say Y here (this will enlarge
82 your kernel by about 400 KB), since some programs (e.g. the X window
83 system) use TCP/IP even if your machine is not connected to any
84 other computer. You will get the so-called loopback device which
85 allows you to ping yourself (great fun, that!).
86
87 For an excellent introduction to Linux networking, please read the
88 Linux Networking HOWTO, available from
89 <http://www.tldp.org/docs.html#howto>.
90
91 If you say Y here and also to "/proc file system support" and
92 "Sysctl support" below, you can change various aspects of the
93 behavior of the TCP/IP code by writing to the (virtual) files in
94 /proc/sys/net/ipv4/*; the options are explained in the file
95 <file:Documentation/networking/ip-sysctl.txt>.
96
97 Short answer: say Y.
98
99if INET
100source "net/ipv4/Kconfig"
101source "net/ipv6/Kconfig"
102source "net/netlabel/Kconfig"
103
104endif # if INET
105
106config SOCK_DIAG
107 bool
108
109config NETWORK_SECMARK
110 bool "Security Marking"
111 help
112 This enables security marking of network packets, similar
113 to nfmark, but designated for security purposes.
114 If you are unsure how to answer this question, answer N.
115
116config NET_PTP_CLASSIFY
117 def_bool n
118
119config NETWORK_PHY_TIMESTAMPING
120 bool "Timestamping in PHY devices"
121 select NET_PTP_CLASSIFY
122 help
123 This allows timestamping of network packets by PHYs with
124 hardware timestamping capabilities. This option adds some
125 overhead in the transmit and receive paths.
126
127 If you are unsure how to answer this question, answer N.
128
129menuconfig NETFILTER
130 bool "Network packet filtering framework (Netfilter)"
131 ---help---
132 Netfilter is a framework for filtering and mangling network packets
133 that pass through your Linux box.
134
135 The most common use of packet filtering is to run your Linux box as
136 a firewall protecting a local network from the Internet. The type of
137 firewall provided by this kernel support is called a "packet
138 filter", which means that it can reject individual network packets
139 based on type, source, destination etc. The other kind of firewall,
140 a "proxy-based" one, is more secure but more intrusive and more
141 bothersome to set up; it inspects the network traffic much more
142 closely, modifies it and has knowledge about the higher level
143 protocols, which a packet filter lacks. Moreover, proxy-based
144 firewalls often require changes to the programs running on the local
145 clients. Proxy-based firewalls don't need support by the kernel, but
146 they are often combined with a packet filter, which only works if
147 you say Y here.
148
149 You should also say Y here if you intend to use your Linux box as
150 the gateway to the Internet for a local network of machines without
151 globally valid IP addresses. This is called "masquerading": if one
152 of the computers on your local network wants to send something to
153 the outside, your box can "masquerade" as that computer, i.e. it
154 forwards the traffic to the intended outside destination, but
155 modifies the packets to make it look like they came from the
156 firewall box itself. It works both ways: if the outside host
157 replies, the Linux box will silently forward the traffic to the
158 correct local computer. This way, the computers on your local net
159 are completely invisible to the outside world, even though they can
160 reach the outside and can receive replies. It is even possible to
161 run globally visible servers from within a masqueraded local network
162 using a mechanism called portforwarding. Masquerading is also often
163 called NAT (Network Address Translation).
164
165 Another use of Netfilter is in transparent proxying: if a machine on
166 the local network tries to connect to an outside host, your Linux
167 box can transparently forward the traffic to a local server,
168 typically a caching proxy server.
169
170 Yet another use of Netfilter is building a bridging firewall. Using
171 a bridge with Network packet filtering enabled makes iptables "see"
172 the bridged traffic. For filtering on the lower network and Ethernet
173 protocols over the bridge, use ebtables (under bridge netfilter
174 configuration).
175
176 Various modules exist for netfilter which replace the previous
177 masquerading (ipmasqadm), packet filtering (ipchains), transparent
178 proxying, and portforwarding mechanisms. Please see
179 <file:Documentation/Changes> under "iptables" for the location of
180 these packages.
181
182if NETFILTER
183
184config NETFILTER_DEBUG
185 bool "Network packet filtering debugging"
186 depends on NETFILTER
187 help
188 You can say Y here if you want to get additional messages useful in
189 debugging the netfilter code.
190
191config NETFILTER_ADVANCED
192 bool "Advanced netfilter configuration"
193 depends on NETFILTER
194 default y
195 help
196 If you say Y here you can select between all the netfilter modules.
197 If you say N the more unusual ones will not be shown and the
198 basic ones needed by most people will default to 'M'.
199
200 If unsure, say Y.
201
202config BRIDGE_NETFILTER
203 tristate "Bridged IP/ARP packets filtering"
204 depends on BRIDGE
205 depends on NETFILTER && INET
206 depends on NETFILTER_ADVANCED
207 select NETFILTER_FAMILY_BRIDGE
208 select SKB_EXTENSIONS
209 ---help---
210 Enabling this option will let arptables resp. iptables see bridged
211 ARP resp. IP traffic. If you want a bridging firewall, you probably
212 want this option enabled.
213 Enabling or disabling this option doesn't enable or disable
214 ebtables.
215
216 If unsure, say N.
217
218config NETIF_RX_FASTPATH_HOOK
219 bool "netif_rx fastpath hook"
220 default n
221 ---help---
222 Enableing this will allow registering a hook function to netif_rx that
223 can "steal" all incoming skbs by returning 1 or continue processing
224 as ususal by returning 0.
225
226 If unsure, say N
227source "net/netfilter/Kconfig"
228source "net/ipv4/netfilter/Kconfig"
229source "net/ipv6/netfilter/Kconfig"
230source "net/bridge/netfilter/Kconfig"
231
232endif
233
234source "net/bpfilter/Kconfig"
235
236source "net/dccp/Kconfig"
237source "net/sctp/Kconfig"
238source "net/rds/Kconfig"
239source "net/tipc/Kconfig"
240source "net/atm/Kconfig"
241source "net/l2tp/Kconfig"
242source "net/802/Kconfig"
243source "net/bridge/Kconfig"
244source "net/dsa/Kconfig"
245source "net/8021q/Kconfig"
246source "net/llc/Kconfig"
247source "drivers/net/appletalk/Kconfig"
248source "net/x25/Kconfig"
249source "net/lapb/Kconfig"
250source "net/phonet/Kconfig"
251source "net/6lowpan/Kconfig"
252source "net/ieee802154/Kconfig"
253source "net/mac802154/Kconfig"
254source "net/sched/Kconfig"
255source "net/dcb/Kconfig"
256source "net/dns_resolver/Kconfig"
257source "net/batman-adv/Kconfig"
258source "net/openvswitch/Kconfig"
259source "net/vmw_vsock/Kconfig"
260source "net/netlink/Kconfig"
261source "net/mpls/Kconfig"
262source "net/nsh/Kconfig"
263source "net/hsr/Kconfig"
264source "net/switchdev/Kconfig"
265source "net/l3mdev/Kconfig"
266source "net/qrtr/Kconfig"
267source "net/ncsi/Kconfig"
268
269config RPS
270 bool
271 depends on SMP && SYSFS
272 default y
273
274config RFS_ACCEL
275 bool
276 depends on RPS
277 select CPU_RMAP
278 default y
279
280config XPS
281 bool
282 depends on SMP
283 default y
284
285config HWBM
286 bool
287
288config CGROUP_NET_PRIO
289 bool "Network priority cgroup"
290 depends on CGROUPS
291 select SOCK_CGROUP_DATA
292 ---help---
293 Cgroup subsystem for use in assigning processes to network priorities on
294 a per-interface basis.
295
296config CGROUP_NET_CLASSID
297 bool "Network classid cgroup"
298 depends on CGROUPS
299 select SOCK_CGROUP_DATA
300 ---help---
301 Cgroup subsystem for use as general purpose socket classid marker that is
302 being used in cls_cgroup and for netfilter matching.
303
304config NET_RX_BUSY_POLL
305 bool
306 default y
307
308config BQL
309 bool
310 depends on SYSFS
311 select DQL
312 default y
313
314config BPF_JIT
315 bool "enable BPF Just In Time compiler"
316 depends on HAVE_CBPF_JIT || HAVE_EBPF_JIT
317 depends on MODULES
318 ---help---
319 Berkeley Packet Filter filtering capabilities are normally handled
320 by an interpreter. This option allows kernel to generate a native
321 code when filter is loaded in memory. This should speedup
322 packet sniffing (libpcap/tcpdump).
323
324 Note, admin should enable this feature changing:
325 /proc/sys/net/core/bpf_jit_enable
326 /proc/sys/net/core/bpf_jit_harden (optional)
327 /proc/sys/net/core/bpf_jit_kallsyms (optional)
328
329config BPF_STREAM_PARSER
330 bool "enable BPF STREAM_PARSER"
331 depends on INET
332 depends on BPF_SYSCALL
333 depends on CGROUP_BPF
334 select STREAM_PARSER
335 select NET_SOCK_MSG
336 ---help---
337 Enabling this allows a stream parser to be used with
338 BPF_MAP_TYPE_SOCKMAP.
339
340 BPF_MAP_TYPE_SOCKMAP provides a map type to use with network sockets.
341 It can be used to enforce socket policy, implement socket redirects,
342 etc.
343
344config NET_FLOW_LIMIT
345 bool
346 depends on RPS
347 default y
348 ---help---
349 The network stack has to drop packets when a receive processing CPU's
350 backlog reaches netdev_max_backlog. If a few out of many active flows
351 generate the vast majority of load, drop their traffic earlier to
352 maintain capacity for the other flows. This feature provides servers
353 with many clients some protection against DoS by a single (spoofed)
354 flow that greatly exceeds average workload.
355
356menu "Network testing"
357
358config NET_PKTGEN
359 tristate "Packet Generator (USE WITH CAUTION)"
360 depends on INET && PROC_FS
361 ---help---
362 This module will inject preconfigured packets, at a configurable
363 rate, out of a given interface. It is used for network interface
364 stress testing and performance analysis. If you don't understand
365 what was just said, you don't need it: say N.
366
367 Documentation on how to use the packet generator can be found
368 at <file:Documentation/networking/pktgen.txt>.
369
370 To compile this code as a module, choose M here: the
371 module will be called pktgen.
372
373config NET_DROP_MONITOR
374 tristate "Network packet drop alerting service"
375 depends on INET && TRACEPOINTS
376 ---help---
377 This feature provides an alerting service to userspace in the
378 event that packets are discarded in the network stack. Alerts
379 are broadcast via netlink socket to any listening user space
380 process. If you don't need network drop alerts, or if you are ok
381 just checking the various proc files and other utilities for
382 drop statistics, say N here.
383
384endmenu
385
386endmenu
387
388source "net/ax25/Kconfig"
389source "net/can/Kconfig"
390source "net/bluetooth/Kconfig"
391source "net/rxrpc/Kconfig"
392source "net/kcm/Kconfig"
393source "net/strparser/Kconfig"
394
395config FIB_RULES
396 bool
397
398menuconfig WIRELESS
399 bool "Wireless"
400 depends on !S390
401 default y
402
403if WIRELESS
404
405source "net/wireless/Kconfig"
406source "net/mac80211/Kconfig"
407
408endif # WIRELESS
409
410source "net/wimax/Kconfig"
411
412source "net/rfkill/Kconfig"
413source "net/9p/Kconfig"
414source "net/caif/Kconfig"
415source "net/ceph/Kconfig"
416source "net/nfc/Kconfig"
417source "net/psample/Kconfig"
418source "net/ife/Kconfig"
419
420config LWTUNNEL
421 bool "Network light weight tunnels"
422 ---help---
423 This feature provides an infrastructure to support light weight
424 tunnels like mpls. There is no netdevice associated with a light
425 weight tunnel endpoint. Tunnel encapsulation parameters are stored
426 with light weight tunnel state associated with fib routes.
427
428config LWTUNNEL_BPF
429 bool "Execute BPF program as route nexthop action"
430 depends on LWTUNNEL && INET
431 default y if LWTUNNEL=y
432 ---help---
433 Allows to run BPF programs as a nexthop action following a route
434 lookup for incoming and outgoing packets.
435
436config DST_CACHE
437 bool
438 default n
439
440config GRO_CELLS
441 bool
442 default n
443
444config SOCK_VALIDATE_XMIT
445 bool
446
447config NET_SOCK_MSG
448 bool
449 default n
450 help
451 The NET_SOCK_MSG provides a framework for plain sockets (e.g. TCP) or
452 ULPs (upper layer modules, e.g. TLS) to process L7 application data
453 with the help of BPF programs.
454
455config NET_DEVLINK
456 bool
457 default n
458 imply NET_DROP_MONITOR
459
460config PAGE_POOL
461 bool
462
463config FAILOVER
464 tristate "Generic failover module"
465 help
466 The failover module provides a generic interface for paravirtual
467 drivers to register a netdev and a set of ops with a failover
468 instance. The ops are used as event handlers that get called to
469 handle netdev register/unregister/link change/name change events
470 on slave pci ethernet devices with the same mac address as the
471 failover netdev. This enables paravirtual drivers to use a
472 VF as an accelerated low latency datapath. It also allows live
473 migration of VMs with direct attached VFs by failing over to the
474 paravirtual datapath when the VF is unplugged.
475
476endif # if NET
477
478# Used by archs to tell that they support BPF JIT compiler plus which flavour.
479# Only one of the two can be selected for a specific arch since eBPF JIT supersedes
480# the cBPF JIT.
481
482# Classic BPF JIT (cBPF)
483config HAVE_CBPF_JIT
484 bool
485
486# Extended BPF JIT (eBPF)
487config HAVE_EBPF_JIT
488 bool