[PATCH 13/13] block/brmr: include client and server modules into kernel compilation

From: Md Haris Iqbal

Date: Tue May 05 2026 - 03:55:02 EST


Add the per-directory Kconfig and Makefile, and wire them into the
parent drivers/block Kconfig and Makefile so BRMR can be enabled in
a kernel build.

Three Kconfig symbols are introduced:

CONFIG_BLK_DEV_BRMR (silent, selected by either side)
CONFIG_BLK_DEV_BRMR_CLIENT (depends on INFINIBAND_RMR_CLIENT)
CONFIG_BLK_DEV_BRMR_SERVER (depends on INFINIBAND_RMR_SERVER)

The Makefile builds two modules: brmr-client.ko and brmr-server.ko.
The server side acts as a consumer of the RMR server-side IO store
interface (struct rmr_srv_store_ops) to back an RMR pool with a
local block device.

Signed-off-by: Md Haris Iqbal <haris.iqbal@xxxxxxxxx>
Signed-off-by: Jia Li <jia.li@xxxxxxxxx>
---
drivers/block/Kconfig | 2 ++
drivers/block/Makefile | 1 +
drivers/block/brmr/Kconfig | 28 ++++++++++++++++++++++++++++
drivers/block/brmr/Makefile | 16 ++++++++++++++++
4 files changed, 47 insertions(+)
create mode 100644 drivers/block/brmr/Kconfig
create mode 100644 drivers/block/brmr/Makefile

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 858320b6ebb7..65167fcb1357 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -353,6 +353,8 @@ config BLKDEV_UBLK_LEGACY_OPCODES

source "drivers/block/rnbd/Kconfig"

+source "drivers/block/brmr/Kconfig"
+
config BLK_DEV_ZONED_LOOP
tristate "Zoned loopback device support"
depends on BLK_DEV_ZONED
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 2d8096eb8cdf..4793c9b0b383 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_BLK_DEV_PCIESSD_MTIP32XX) += mtip32xx/

obj-$(CONFIG_ZRAM) += zram/
obj-$(CONFIG_BLK_DEV_RNBD) += rnbd/
+obj-$(CONFIG_BLK_DEV_BRMR) += brmr/

obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk/
obj-$(CONFIG_BLK_DEV_RUST_NULL) += rnull/
diff --git a/drivers/block/brmr/Kconfig b/drivers/block/brmr/Kconfig
new file mode 100644
index 000000000000..a38d59d2c1d4
--- /dev/null
+++ b/drivers/block/brmr/Kconfig
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+config BLK_DEV_BRMR
+ bool
+
+config BLK_DEV_BRMR_CLIENT
+ tristate "Block device over RMR (BRMR) client"
+ depends on INFINIBAND_RMR_CLIENT
+ select BLK_DEV_BRMR
+ help
+ BRMR client is a block device driver that sits on top of the
+ RMR ULP and exposes a standard Linux block device (/dev/brmrX)
+ backed by an RMR pool. Together with RMR it provides a
+ single-hop replication and resynchronization solution for
+ RDMA-connected storage clusters.
+
+ If unsure, say N.
+
+config BLK_DEV_BRMR_SERVER
+ tristate "Block device over RMR (BRMR) server"
+ depends on INFINIBAND_RMR_SERVER
+ select BLK_DEV_BRMR
+ help
+ BRMR server exports a local block device as the backing store
+ for an RMR pool, so that BRMR clients can map it remotely
+ over RDMA.
+
+ If unsure, say N.
diff --git a/drivers/block/brmr/Makefile b/drivers/block/brmr/Makefile
new file mode 100644
index 000000000000..894ba2720557
--- /dev/null
+++ b/drivers/block/brmr/Makefile
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+ccflags-y := -I$(srctree)/drivers/infiniband/ulp/rtrs \
+ -I$(srctree)/drivers/infiniband/ulp/rmr \
+ -I$(srctree)/drivers/block/brmr
+
+brmr-client-y := brmr-clt.o \
+ brmr-clt-sysfs.o \
+ brmr-clt-reque.o \
+ brmr-clt-stats.o
+
+brmr-server-y := brmr-srv-sysfs.o \
+ brmr-srv.o
+
+obj-$(CONFIG_BLK_DEV_BRMR_CLIENT) += brmr-client.o
+obj-$(CONFIG_BLK_DEV_BRMR_SERVER) += brmr-server.o
--
2.43.0