1# SPDX-License-Identifier: GPL-2.0
2#
3# Block layer core configuration
4#
5menuconfig BLOCK
6       bool "Enable the block layer" if EXPERT
7       default y
8       select SBITMAP
9       select SRCU
10       help
11	 Provide block layer support for the kernel.
12
13	 Disable this option to remove the block layer support from the
14	 kernel. This may be useful for embedded devices.
15
16	 If this option is disabled:
17
18	   - block device files will become unusable
19	   - some filesystems (such as ext3) will become unavailable.
20
21	 Also, SCSI character devices and USB storage will be disabled since
22	 they make use of various block layer definitions and facilities.
23
24	 Say Y here unless you know you really don't want to mount disks and
25	 suchlike.
26
27if BLOCK
28
29config BLK_RQ_ALLOC_TIME
30	bool
31
32config BLK_SCSI_REQUEST
33	bool
34
35config BLK_DEV_BSG
36	bool "Block layer SG support v4"
37	default y
38	select BLK_SCSI_REQUEST
39	help
40	  Saying Y here will enable generic SG (SCSI generic) v4 support
41	  for any block device.
42
43	  Unlike SG v3 (aka block/scsi_ioctl.c drivers/scsi/sg.c), SG v4
44	  can handle complicated SCSI commands: tagged variable length cdbs
45	  with bidirectional data transfers and generic request/response
46	  protocols (e.g. Task Management Functions and SMP in Serial
47	  Attached SCSI).
48
49	  This option is required by recent UDEV versions to properly
50	  access device serial numbers, etc.
51
52	  If unsure, say Y.
53
54config BLK_DEV_BSGLIB
55	bool "Block layer SG support v4 helper lib"
56	select BLK_DEV_BSG
57	select BLK_SCSI_REQUEST
58	help
59	  Subsystems will normally enable this if needed. Users will not
60	  normally need to manually enable this.
61
62	  If unsure, say N.
63
64config BLK_DEV_INTEGRITY
65	bool "Block layer data integrity support"
66	select CRC_T10DIF if BLK_DEV_INTEGRITY
67	---help---
68	Some storage devices allow extra information to be
69	stored/retrieved to help protect the data.  The block layer
70	data integrity option provides hooks which can be used by
71	filesystems to ensure better data integrity.
72
73	Say yes here if you have a storage device that provides the
74	T10/SCSI Data Integrity Field or the T13/ATA External Path
75	Protection.  If in doubt, say N.
76
77config BLK_DEV_ZONED
78	bool "Zoned block device support"
79	select MQ_IOSCHED_DEADLINE
80	---help---
81	Block layer zoned block device support. This option enables
82	support for ZAC/ZBC host-managed and host-aware zoned block devices.
83
84	Say yes here if you have a ZAC or ZBC storage device.
85
86config BLK_DEV_THROTTLING
87	bool "Block layer bio throttling support"
88	depends on BLK_CGROUP=y
89	---help---
90	Block layer bio throttling support. It can be used to limit
91	the IO rate to a device. IO rate policies are per cgroup and
92	one needs to mount and use blkio cgroup controller for creating
93	cgroups and specifying per device IO rate policies.
94
95	See Documentation/admin-guide/cgroup-v1/blkio-controller.rst for more information.
96
97config BLK_DEV_THROTTLING_LOW
98	bool "Block throttling .low limit interface support (EXPERIMENTAL)"
99	depends on BLK_DEV_THROTTLING
100	---help---
101	Add .low limit interface for block throttling. The low limit is a best
102	effort limit to prioritize cgroups. Depending on the setting, the limit
103	can be used to protect cgroups in terms of bandwidth/iops and better
104	utilize disk resource.
105
106	Note, this is an experimental interface and could be changed someday.
107
108config BLK_CMDLINE_PARSER
109	bool "Block device command line partition parser"
110	---help---
111	Enabling this option allows you to specify the partition layout from
112	the kernel boot args.  This is typically of use for embedded devices
113	which don't otherwise have any standardized method for listing the
114	partitions on a block device.
115
116	See Documentation/block/cmdline-partition.rst for more information.
117
118config BLK_WBT
119	bool "Enable support for block device writeback throttling"
120	---help---
121	Enabling this option enables the block layer to throttle buffered
122	background writeback from the VM, making it more smooth and having
123	less impact on foreground operations. The throttling is done
124	dynamically on an algorithm loosely based on CoDel, factoring in
125	the realtime performance of the disk.
126
127config BLK_CGROUP_IOLATENCY
128	bool "Enable support for latency based cgroup IO protection"
129	depends on BLK_CGROUP=y
130	---help---
131	Enabling this option enables the .latency interface for IO throttling.
132	The IO controller will attempt to maintain average IO latencies below
133	the configured latency target, throttling anybody with a higher latency
134	target than the victimized group.
135
136	Note, this is an experimental interface and could be changed someday.
137
138config BLK_CGROUP_IOCOST
139	bool "Enable support for cost model based cgroup IO controller"
140	depends on BLK_CGROUP=y
141	select BLK_RQ_ALLOC_TIME
142	---help---
143	Enabling this option enables the .weight interface for cost
144	model based proportional IO control.  The IO controller
145	distributes IO capacity between different groups based on
146	their share of the overall weight distribution.
147
148config BLK_WBT_MQ
149	bool "Multiqueue writeback throttling"
150	default y
151	depends on BLK_WBT
152	---help---
153	Enable writeback throttling by default on multiqueue devices.
154	Multiqueue currently doesn't have support for IO scheduling,
155	enabling this option is recommended.
156
157config BLK_DEBUG_FS
158	bool "Block layer debugging information in debugfs"
159	default y
160	depends on DEBUG_FS
161	---help---
162	Include block layer debugging information in debugfs. This information
163	is mostly useful for kernel developers, but it doesn't incur any cost
164	at runtime.
165
166	Unless you are building a kernel for a tiny system, you should
167	say Y here.
168
169config BLK_DEBUG_FS_ZONED
170       bool
171       default BLK_DEBUG_FS && BLK_DEV_ZONED
172
173config BLK_SED_OPAL
174	bool "Logic for interfacing with Opal enabled SEDs"
175	---help---
176	Builds Logic for interfacing with Opal enabled controllers.
177	Enabling this option enables users to setup/unlock/lock
178	Locking ranges for SED devices using the Opal protocol.
179
180menu "Partition Types"
181
182source "block/partitions/Kconfig"
183
184endmenu
185
186endif # BLOCK
187
188config BLOCK_COMPAT
189	bool
190	depends on BLOCK && COMPAT
191	default y
192
193config BLK_MQ_PCI
194	bool
195	depends on BLOCK && PCI
196	default y
197
198config BLK_MQ_VIRTIO
199	bool
200	depends on BLOCK && VIRTIO
201	default y
202
203config BLK_MQ_RDMA
204	bool
205	depends on BLOCK && INFINIBAND
206	default y
207
208config BLK_PM
209	def_bool BLOCK && PM
210
211source "block/Kconfig.iosched"
212