diff mbox series

[v10,13/26] RDMA/rtrs: include client and server modules into kernel compilation

Message ID 20200311161240.30190-14-jinpu.wang@cloud.ionos.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 March 11, 2020, 4:12 p.m. UTC
Add rtrs Makefile, Kconfig and also corresponding lines into upper
layer infiniband/ulp files.

Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/infiniband/Kconfig           |  1 +
 drivers/infiniband/ulp/Makefile      |  1 +
 drivers/infiniband/ulp/rtrs/Kconfig  | 27 +++++++++++++++++++++++++++
 drivers/infiniband/ulp/rtrs/Makefile | 15 +++++++++++++++
 4 files changed, 44 insertions(+)
 create mode 100644 drivers/infiniband/ulp/rtrs/Kconfig
 create mode 100644 drivers/infiniband/ulp/rtrs/Makefile

Comments

Jason Gunthorpe March 11, 2020, 7:03 p.m. UTC | #1
On Wed, Mar 11, 2020 at 05:12:27PM +0100, Jack Wang wrote:
> Add rtrs Makefile, Kconfig and also corresponding lines into upper
> layer infiniband/ulp files.
> 
> Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
> Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> ---
>  drivers/infiniband/Kconfig           |  1 +
>  drivers/infiniband/ulp/Makefile      |  1 +
>  drivers/infiniband/ulp/rtrs/Kconfig  | 27 +++++++++++++++++++++++++++
>  drivers/infiniband/ulp/rtrs/Makefile | 15 +++++++++++++++
>  4 files changed, 44 insertions(+)
>  create mode 100644 drivers/infiniband/ulp/rtrs/Kconfig
>  create mode 100644 drivers/infiniband/ulp/rtrs/Makefile

How is this using ib_devices without having a struct ib_client ?

Jason
Danil Kipnis March 12, 2020, 10:50 a.m. UTC | #2
On Wed, Mar 11, 2020 at 8:03 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
>
> On Wed, Mar 11, 2020 at 05:12:27PM +0100, Jack Wang wrote:
> > Add rtrs Makefile, Kconfig and also corresponding lines into upper
> > layer infiniband/ulp files.
> >
> > Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
> > Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> > ---
> >  drivers/infiniband/Kconfig           |  1 +
> >  drivers/infiniband/ulp/Makefile      |  1 +
> >  drivers/infiniband/ulp/rtrs/Kconfig  | 27 +++++++++++++++++++++++++++
> >  drivers/infiniband/ulp/rtrs/Makefile | 15 +++++++++++++++
> >  4 files changed, 44 insertions(+)
> >  create mode 100644 drivers/infiniband/ulp/rtrs/Kconfig
> >  create mode 100644 drivers/infiniband/ulp/rtrs/Makefile
>
> How is this using ib_devices without having a struct ib_client ?
Hi Jason,

After we resolved address using rdma_resolve_add() we access the
ib_device from rdma_cm_id. The ib_device has been registered on
rdma_cm module load in cma_init(). The handle device removal through
RDMA_CM_EVENT_DEVICE_REMOVAL.

Best,
Danil


>
> Jason
Jason Gunthorpe March 12, 2020, 12:03 p.m. UTC | #3
On Thu, Mar 12, 2020 at 11:50:59AM +0100, Danil Kipnis wrote:
> On Wed, Mar 11, 2020 at 8:03 PM Jason Gunthorpe <jgg@ziepe.ca> wrote:
> >
> > On Wed, Mar 11, 2020 at 05:12:27PM +0100, Jack Wang wrote:
> > > Add rtrs Makefile, Kconfig and also corresponding lines into upper
> > > layer infiniband/ulp files.
> > >
> > > Signed-off-by: Danil Kipnis <danil.kipnis@cloud.ionos.com>
> > > Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> > >  drivers/infiniband/Kconfig           |  1 +
> > >  drivers/infiniband/ulp/Makefile      |  1 +
> > >  drivers/infiniband/ulp/rtrs/Kconfig  | 27 +++++++++++++++++++++++++++
> > >  drivers/infiniband/ulp/rtrs/Makefile | 15 +++++++++++++++
> > >  4 files changed, 44 insertions(+)
> > >  create mode 100644 drivers/infiniband/ulp/rtrs/Kconfig
> > >  create mode 100644 drivers/infiniband/ulp/rtrs/Makefile
> >
> > How is this using ib_devices without having a struct ib_client ?
> Hi Jason,
> 
> After we resolved address using rdma_resolve_add() we access the
> ib_device from rdma_cm_id. The ib_device has been registered on
> rdma_cm module load in cma_init(). The handle device removal through
> RDMA_CM_EVENT_DEVICE_REMOVAL.

Hmm.. I actually don't know if this flow works OK in rdma cm or not..

Actually I expect if I look at rdma cm, I'll find it is broken..

However, it does sound like a reasonable approach, so nothing to do
here.

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index ade86388434f..477418b37786 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -107,6 +107,7 @@  source "drivers/infiniband/ulp/srpt/Kconfig"
 
 source "drivers/infiniband/ulp/iser/Kconfig"
 source "drivers/infiniband/ulp/isert/Kconfig"
+source "drivers/infiniband/ulp/rtrs/Kconfig"
 
 source "drivers/infiniband/ulp/opa_vnic/Kconfig"
 
diff --git a/drivers/infiniband/ulp/Makefile b/drivers/infiniband/ulp/Makefile
index 437813c7b481..4d0004b58377 100644
--- a/drivers/infiniband/ulp/Makefile
+++ b/drivers/infiniband/ulp/Makefile
@@ -5,3 +5,4 @@  obj-$(CONFIG_INFINIBAND_SRPT)		+= srpt/
 obj-$(CONFIG_INFINIBAND_ISER)		+= iser/
 obj-$(CONFIG_INFINIBAND_ISERT)		+= isert/
 obj-$(CONFIG_INFINIBAND_OPA_VNIC)	+= opa_vnic/
+obj-$(CONFIG_INFINIBAND_RTRS)		+= rtrs/
diff --git a/drivers/infiniband/ulp/rtrs/Kconfig b/drivers/infiniband/ulp/rtrs/Kconfig
new file mode 100644
index 000000000000..9092b62e6dc8
--- /dev/null
+++ b/drivers/infiniband/ulp/rtrs/Kconfig
@@ -0,0 +1,27 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+config INFINIBAND_RTRS
+	tristate
+	depends on INFINIBAND_ADDR_TRANS
+
+config INFINIBAND_RTRS_CLIENT
+	tristate "RTRS client module"
+	depends on INFINIBAND_ADDR_TRANS
+	select INFINIBAND_RTRS
+	help
+	  RDMA transport client module.
+
+	  RDMA Transport (RTRS) client implements a reliable transport layer
+	  and also multipathing functionality and that it is intended to be
+	  the base layer for a block storage initiator over RDMA.
+
+config INFINIBAND_RTRS_SERVER
+	tristate "RTRS server module"
+	depends on INFINIBAND_ADDR_TRANS
+	select INFINIBAND_RTRS
+	help
+	  RDMA transport server module.
+
+	  RDMA Transport (RTRS) server module processing connection and IO
+	  requests received from the RTRS client module, it will pass the
+	  IO requests to its user eg. RNBD_server.
diff --git a/drivers/infiniband/ulp/rtrs/Makefile b/drivers/infiniband/ulp/rtrs/Makefile
new file mode 100644
index 000000000000..3898509be270
--- /dev/null
+++ b/drivers/infiniband/ulp/rtrs/Makefile
@@ -0,0 +1,15 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+rtrs-client-y := rtrs-clt.o \
+		  rtrs-clt-stats.o \
+		  rtrs-clt-sysfs.o
+
+rtrs-server-y := rtrs-srv.o \
+		  rtrs-srv-stats.o \
+		  rtrs-srv-sysfs.o
+
+rtrs-core-y := rtrs.o
+
+obj-$(CONFIG_INFINIBAND_RTRS)        += rtrs-core.o
+obj-$(CONFIG_INFINIBAND_RTRS_CLIENT) += rtrs-client.o
+obj-$(CONFIG_INFINIBAND_RTRS_SERVER) += rtrs-server.o