diff mbox series

[v7,23/25] block/rnbd: include client and server modules into kernel compilation

Message ID 20200116125915.14815-24-jinpuwang@gmail.com (mailing list archive)
State New, archived
Headers show
Series RTRS (former IBTRS) RDMA Transport Library and RNBD (former IBNBD) RDMA Network Block Device | expand

Commit Message

Jinpu Wang Jan. 16, 2020, 12:59 p.m. UTC
From: Jack Wang <jinpu.wang@cloud.ionos.com>

Add rnbd Makefile, Kconfig and also corresponding lines into upper
block layer files.

Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/block/Kconfig       |  2 ++
 drivers/block/Makefile      |  1 +
 drivers/block/rnbd/Kconfig  | 28 ++++++++++++++++++++++++++++
 drivers/block/rnbd/Makefile | 17 +++++++++++++++++
 4 files changed, 48 insertions(+)
 create mode 100644 drivers/block/rnbd/Kconfig
 create mode 100644 drivers/block/rnbd/Makefile

Comments

Leon Romanovsky Jan. 16, 2020, 2:40 p.m. UTC | #1
On Thu, Jan 16, 2020 at 01:59:13PM +0100, Jack Wang wrote:
> From: Jack Wang <jinpu.wang@cloud.ionos.com>
>
> Add rnbd Makefile, Kconfig and also corresponding lines into upper
> block layer files.
>
> Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
> Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> ---
>  drivers/block/Kconfig       |  2 ++
>  drivers/block/Makefile      |  1 +
>  drivers/block/rnbd/Kconfig  | 28 ++++++++++++++++++++++++++++
>  drivers/block/rnbd/Makefile | 17 +++++++++++++++++
>  4 files changed, 48 insertions(+)
>  create mode 100644 drivers/block/rnbd/Kconfig
>  create mode 100644 drivers/block/rnbd/Makefile
>
> diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
> index 1bb8ec575352..1636a7d9e91e 100644
> --- a/drivers/block/Kconfig
> +++ b/drivers/block/Kconfig
> @@ -468,4 +468,6 @@ config BLK_DEV_RSXX
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called rsxx.
>
> +source "drivers/block/rnbd/Kconfig"
> +
>  endif # BLK_DEV
> diff --git a/drivers/block/Makefile b/drivers/block/Makefile
> index a53cc1e3a2d3..914f9d07835c 100644
> --- a/drivers/block/Makefile
> +++ b/drivers/block/Makefile
> @@ -36,6 +36,7 @@ obj-$(CONFIG_BLK_DEV_PCIESSD_MTIP32XX)	+= mtip32xx/
>
>  obj-$(CONFIG_BLK_DEV_RSXX) += rsxx/
>  obj-$(CONFIG_ZRAM) += zram/
> +obj-$(CONFIG_BLK_DEV_RNBD)	+= rnbd/
>
>  obj-$(CONFIG_BLK_DEV_NULL_BLK)	+= null_blk.o
>  null_blk-objs	:= null_blk_main.o
> diff --git a/drivers/block/rnbd/Kconfig b/drivers/block/rnbd/Kconfig
> new file mode 100644
> index 000000000000..56e44745a36a
> --- /dev/null
> +++ b/drivers/block/rnbd/Kconfig
> @@ -0,0 +1,28 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +config BLK_DEV_RNBD
> +	bool
> +
> +config BLK_DEV_RNBD_CLIENT
> +	tristate "Network block device driver on top of RTRS transport"
> +	depends on INFINIBAND_RTRS_CLIENT
> +	select BLK_DEV_RNBD
> +	help
> +	  RNBD client is a network block device driver using rdma transport.
> +
> +	  RNBD client allows for mapping of a remote block devices over
> +	  RTRS protocol from a target system where RNBD server is running.
> +
> +	  If unsure, say N.
> +
> +config BLK_DEV_RNBD_SERVER
> +	tristate "Network block device over RDMA server support"
> +	depends on INFINIBAND_RTRS_SERVER
> +	select BLK_DEV_RNBD
> +	help
> +	  RNBD server is the server side of RNBD using rdma transport.
> +
> +	  RNBD server allows for exporting local block devices to a remote client
> +	  over RTRS protocol.
> +
> +	  If unsure, say N.
> diff --git a/drivers/block/rnbd/Makefile b/drivers/block/rnbd/Makefile
> new file mode 100644
> index 000000000000..125c3576f221
> --- /dev/null
> +++ b/drivers/block/rnbd/Makefile
> @@ -0,0 +1,17 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +ccflags-y := -Idrivers/infiniband/ulp/rtrs
> +
> +rnbd-client-y := rnbd-clt.o \
> +		  rnbd-common.o \
> +		  rnbd-clt-sysfs.o
> +
> +rnbd-server-y := rnbd-srv.o \
> +		  rnbd-common.o \
> +		  rnbd-srv-dev.o \
> +		  rnbd-srv-sysfs.o
> +
> +obj-$(CONFIG_BLK_DEV_RNBD_CLIENT) += rnbd-client.o
> +obj-$(CONFIG_BLK_DEV_RNBD_SERVER) += rnbd-server.o
> +
> +-include $(src)/compat/compat.mk

What is it?

Thanks

> --
> 2.17.1
>
Jinpu Wang Jan. 16, 2020, 2:54 p.m. UTC | #2
> > +obj-$(CONFIG_BLK_DEV_RNBD_CLIENT) += rnbd-client.o
> > +obj-$(CONFIG_BLK_DEV_RNBD_SERVER) += rnbd-server.o
> > +
> > +-include $(src)/compat/compat.mk
>
> What is it?
>
> Thanks
quote from Roman
"'
Well, in our production we use same source code and in order not to spoil
sources with 'ifdef' macros for different kernel versions we use compat
layer, which obviously will never go upstream.  This line is the only
clean way to keep sources always up-to-date with latest kernel and still
be compatible with what we have on our servers in production.

'-' prefix at the beginning of the line tells make to ignore it if
file does not exist, so should not rise any error for compilation
against latest kernel.

Here is an example of the compat layer for RNBD block device:
https://github.com/ionos-enterprise/ibnbd/tree/master/rnbd/compat
"'

We will remove it also the one in the makefile for rtrs if we need to
send another round.

Thanks
Leon Romanovsky Jan. 16, 2020, 3:59 p.m. UTC | #3
On Thu, Jan 16, 2020 at 03:54:03PM +0100, Jinpu Wang wrote:
> > > +obj-$(CONFIG_BLK_DEV_RNBD_CLIENT) += rnbd-client.o
> > > +obj-$(CONFIG_BLK_DEV_RNBD_SERVER) += rnbd-server.o
> > > +
> > > +-include $(src)/compat/compat.mk
> >
> > What is it?
> >
> > Thanks
> quote from Roman
> "'
> Well, in our production we use same source code and in order not to spoil
> sources with 'ifdef' macros for different kernel versions we use compat
> layer, which obviously will never go upstream.  This line is the only
> clean way to keep sources always up-to-date with latest kernel and still
> be compatible with what we have on our servers in production.
>
> '-' prefix at the beginning of the line tells make to ignore it if
> file does not exist, so should not rise any error for compilation
> against latest kernel.
>
> Here is an example of the compat layer for RNBD block device:
> https://github.com/ionos-enterprise/ibnbd/tree/master/rnbd/compat
> "'
>
> We will remove it also the one in the makefile for rtrs if we need to
> send another round.

Yes, remove it please.

>
> Thanks
Jinpu Wang Jan. 16, 2020, 4:53 p.m. UTC | #4
On Thu, Jan 16, 2020 at 4:59 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> On Thu, Jan 16, 2020 at 03:54:03PM +0100, Jinpu Wang wrote:
> > > > +obj-$(CONFIG_BLK_DEV_RNBD_CLIENT) += rnbd-client.o
> > > > +obj-$(CONFIG_BLK_DEV_RNBD_SERVER) += rnbd-server.o
> > > > +
> > > > +-include $(src)/compat/compat.mk
> > >
> > > What is it?
> > >
> > > Thanks
> > quote from Roman
> > "'
> > Well, in our production we use same source code and in order not to spoil
> > sources with 'ifdef' macros for different kernel versions we use compat
> > layer, which obviously will never go upstream.  This line is the only
> > clean way to keep sources always up-to-date with latest kernel and still
> > be compatible with what we have on our servers in production.
> >
> > '-' prefix at the beginning of the line tells make to ignore it if
> > file does not exist, so should not rise any error for compilation
> > against latest kernel.
> >
> > Here is an example of the compat layer for RNBD block device:
> > https://github.com/ionos-enterprise/ibnbd/tree/master/rnbd/compat
> > "'
> >
> > We will remove it also the one in the makefile for rtrs if we need to
> > send another round.
>
> Yes, remove it please.
>
> >
> > Thanks
ok, thanks
diff mbox series

Patch

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 1bb8ec575352..1636a7d9e91e 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -468,4 +468,6 @@  config BLK_DEV_RSXX
 	  To compile this driver as a module, choose M here: the
 	  module will be called rsxx.
 
+source "drivers/block/rnbd/Kconfig"
+
 endif # BLK_DEV
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index a53cc1e3a2d3..914f9d07835c 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -36,6 +36,7 @@  obj-$(CONFIG_BLK_DEV_PCIESSD_MTIP32XX)	+= mtip32xx/
 
 obj-$(CONFIG_BLK_DEV_RSXX) += rsxx/
 obj-$(CONFIG_ZRAM) += zram/
+obj-$(CONFIG_BLK_DEV_RNBD)	+= rnbd/
 
 obj-$(CONFIG_BLK_DEV_NULL_BLK)	+= null_blk.o
 null_blk-objs	:= null_blk_main.o
diff --git a/drivers/block/rnbd/Kconfig b/drivers/block/rnbd/Kconfig
new file mode 100644
index 000000000000..56e44745a36a
--- /dev/null
+++ b/drivers/block/rnbd/Kconfig
@@ -0,0 +1,28 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+config BLK_DEV_RNBD
+	bool
+
+config BLK_DEV_RNBD_CLIENT
+	tristate "Network block device driver on top of RTRS transport"
+	depends on INFINIBAND_RTRS_CLIENT
+	select BLK_DEV_RNBD
+	help
+	  RNBD client is a network block device driver using rdma transport.
+
+	  RNBD client allows for mapping of a remote block devices over
+	  RTRS protocol from a target system where RNBD server is running.
+
+	  If unsure, say N.
+
+config BLK_DEV_RNBD_SERVER
+	tristate "Network block device over RDMA server support"
+	depends on INFINIBAND_RTRS_SERVER
+	select BLK_DEV_RNBD
+	help
+	  RNBD server is the server side of RNBD using rdma transport.
+
+	  RNBD server allows for exporting local block devices to a remote client
+	  over RTRS protocol.
+
+	  If unsure, say N.
diff --git a/drivers/block/rnbd/Makefile b/drivers/block/rnbd/Makefile
new file mode 100644
index 000000000000..125c3576f221
--- /dev/null
+++ b/drivers/block/rnbd/Makefile
@@ -0,0 +1,17 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+ccflags-y := -Idrivers/infiniband/ulp/rtrs
+
+rnbd-client-y := rnbd-clt.o \
+		  rnbd-common.o \
+		  rnbd-clt-sysfs.o
+
+rnbd-server-y := rnbd-srv.o \
+		  rnbd-common.o \
+		  rnbd-srv-dev.o \
+		  rnbd-srv-sysfs.o
+
+obj-$(CONFIG_BLK_DEV_RNBD_CLIENT) += rnbd-client.o
+obj-$(CONFIG_BLK_DEV_RNBD_SERVER) += rnbd-server.o
+
+-include $(src)/compat/compat.mk