Message ID | 20190130172136.23625-14-bmt@zurich.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | SIW: Request for Comments | expand |
On Wed, Jan 30, 2019 at 06:21:36PM +0100, bmt@zurich.ibm.com wrote: > From: Bernard Metzler <bmt@zurich.ibm.com> > > Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com> > drivers/infiniband/Kconfig | 1 + > drivers/infiniband/sw/Makefile | 1 + > drivers/infiniband/sw/siw/Kconfig | 17 +++++++++++++++++ > drivers/infiniband/sw/siw/Makefile | 15 +++++++++++++++ > 4 files changed, 34 insertions(+) > create mode 100644 drivers/infiniband/sw/siw/Kconfig > create mode 100644 drivers/infiniband/sw/siw/Makefile > > diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig > index a1fb840de45d..6d160aac26df 100644 > +++ b/drivers/infiniband/Kconfig > @@ -107,6 +107,7 @@ source "drivers/infiniband/hw/hfi1/Kconfig" > source "drivers/infiniband/hw/qedr/Kconfig" > source "drivers/infiniband/sw/rdmavt/Kconfig" > source "drivers/infiniband/sw/rxe/Kconfig" > +source "drivers/infiniband/sw/siw/Kconfig" > endif > > source "drivers/infiniband/ulp/ipoib/Kconfig" > diff --git a/drivers/infiniband/sw/Makefile b/drivers/infiniband/sw/Makefile > index 8b095b27db87..d37610fcbbc7 100644 > +++ b/drivers/infiniband/sw/Makefile > @@ -1,2 +1,3 @@ > obj-$(CONFIG_INFINIBAND_RDMAVT) += rdmavt/ > obj-$(CONFIG_RDMA_RXE) += rxe/ > +obj-$(CONFIG_RDMA_SIW) += siw/ > diff --git a/drivers/infiniband/sw/siw/Kconfig b/drivers/infiniband/sw/siw/Kconfig > new file mode 100644 > index 000000000000..f4f0210256bd > +++ b/drivers/infiniband/sw/siw/Kconfig > @@ -0,0 +1,17 @@ > +config RDMA_SIW > + tristate "Software RDMA over TCP/IP (iWARP) driver" > + depends on INET && INFINIBAND && CRYPTO_CRC32 > + ---help--- > + This driver implements the iWARP RDMA transport over > + the Linux TCP/IP network stack. It enables a system with a > + standard Ethernet adapter to interoperate with a iWARP > + adapter or with another system running the SIW driver. > + (See also RXE which is a similar software driver for RoCE.) > + > + The driver interfaces with the Linux RDMA stack and > + implements both a kernel and user space RDMA verbs API. > + The user space verbs API requires a support > + library named libsiw which is loaded by the generic user > + space verbs API, libibverbs. To implement RDMA over > + TCP/IP, the driver further interfaces with the Linux > + in-kernel TCP socket layer. > diff --git a/drivers/infiniband/sw/siw/Makefile b/drivers/infiniband/sw/siw/Makefile > new file mode 100644 > index 000000000000..20f31c9e827b > +++ b/drivers/infiniband/sw/siw/Makefile > @@ -0,0 +1,15 @@ > +obj-$(CONFIG_RDMA_SIW) += siw.o > + > +siw-y := \ > + siw_main.o \ > + siw_cm.o \ > + siw_verbs.o \ > + siw_obj.o \ > + siw_qp.o \ > + siw_qp_tx.o \ > + siw_qp_rx.o \ > + siw_cq.o \ > + siw_cm.o \ > + siw_debug.o \ > + siw_ae.o \ > + siw_mem.o keep sorted
Hi Bernard, Thank you for the patch! Yet something to improve: [auto build test ERROR on rdma/for-next] [also build test ERROR on next-20190130] [cannot apply to v5.0-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/bmt-zurich-ibm-com/SIW-Request-for-Comments/20190131-100843 base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next config: sh-allyesconfig (attached as .config) compiler: sh4-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree GCC_VERSION=8.2.0 make.cross ARCH=sh All error/warnings (new ones prefixed by >>): drivers/infiniband/sw/siw/siw_main.c: In function 'siw_dev_from_netdev': >> drivers/infiniband/sw/siw/siw_main.c:209:3: error: implicit declaration of function 'ib_device_get_by_netdev'; did you mean 'device_get_devnode'? [-Werror=implicit-function-declaration] ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW); ^~~~~~~~~~~~~~~~~~~~~~~ device_get_devnode >> drivers/infiniband/sw/siw/siw_main.c:209:3: warning: initialization of 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] In file included from include/asm-generic/percpu.h:7, from ./arch/sh/include/generated/asm/percpu.h:1, from include/linux/percpu.h:13, from include/linux/netdevice.h:36, from drivers/infiniband/sw/siw/siw_main.c:41: drivers/infiniband/sw/siw/siw_main.c: At top level: >> include/linux/percpu-defs.h:91:33: warning: '__pcpu_unique_use_cnt' initialized and declared 'extern' extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION' DEFINE_PER_CPU_SECTION(type, name, "") ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ >> include/linux/percpu-defs.h:92:26: error: redefinition of '__pcpu_unique_use_cnt' __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION' DEFINE_PER_CPU_SECTION(type, name, "") ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:91:33: note: previous definition of '__pcpu_unique_use_cnt' was here extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION' DEFINE_PER_CPU_SECTION(type, name, "") ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ >> drivers/infiniband/sw/siw/siw_main.c:268:33: warning: 'use_cnt' initialized and declared 'extern' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~ include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name; \ ^~~~ drivers/infiniband/sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ >> drivers/infiniband/sw/siw/siw_main.c:268:33: error: redefinition of 'use_cnt' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~ include/linux/percpu-defs.h:94:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION' __PCPU_ATTRS(sec) __weak __typeof__(type) name ^~~~ drivers/infiniband/sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_main.c:268:33: note: previous definition of 'use_cnt' was here static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~ include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name; \ ^~~~ drivers/infiniband/sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_main.c: In function 'siw_device_create': >> drivers/infiniband/sw/siw/siw_main.c:431:10: error: 'struct ib_device' has no member named 'driver_unregister' base_dev->driver_unregister = siw_unregistered; ^~ >> drivers/infiniband/sw/siw/siw_main.c:572:16: error: 'struct iw_cm_verbs' has no member named 'driver_flags' base_dev->iwcm->driver_flags = IW_F_NO_PORT_MAP; ^~ >> drivers/infiniband/sw/siw/siw_main.c:572:33: error: 'IW_F_NO_PORT_MAP' undeclared (first use in this function); did you mean 'IFLA_PORT_MAX'? base_dev->iwcm->driver_flags = IW_F_NO_PORT_MAP; ^~~~~~~~~~~~~~~~ IFLA_PORT_MAX drivers/infiniband/sw/siw/siw_main.c:572:33: note: each undeclared identifier is reported only once for each function it appears in drivers/infiniband/sw/siw/siw_main.c: In function 'siw_netdev_unregistered': >> drivers/infiniband/sw/siw/siw_main.c:635:2: error: implicit declaration of function 'ib_unregister_device_and_put'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration] ib_unregister_device_and_put(&sdev->base_dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ib_unregister_device drivers/infiniband/sw/siw/siw_main.c: In function 'siw_netdev_event': >> drivers/infiniband/sw/siw/siw_main.c:694:2: error: implicit declaration of function 'ib_device_put'; did you mean 'in_dev_put'? [-Werror=implicit-function-declaration] ib_device_put(&sdev->base_dev); ^~~~~~~~~~~~~ in_dev_put drivers/infiniband/sw/siw/siw_main.c: At top level: >> drivers/infiniband/sw/siw/siw_main.c:740:15: error: variable 'siw_link_ops' has initializer but incomplete type static struct rdma_link_ops siw_link_ops = { ^~~~~~~~~~~~~ >> drivers/infiniband/sw/siw/siw_main.c:741:3: error: 'struct rdma_link_ops' has no member named 'type' .type = "siw", ^~~~ >> drivers/infiniband/sw/siw/siw_main.c:741:10: warning: excess elements in struct initializer .type = "siw", ^~~~~ drivers/infiniband/sw/siw/siw_main.c:741:10: note: (near initialization for 'siw_link_ops') >> drivers/infiniband/sw/siw/siw_main.c:742:3: error: 'struct rdma_link_ops' has no member named 'newlink' .newlink = siw_newlink, ^~~~~~~ drivers/infiniband/sw/siw/siw_main.c:742:13: warning: excess elements in struct initializer .newlink = siw_newlink, ^~~~~~~~~~~ drivers/infiniband/sw/siw/siw_main.c:742:13: note: (near initialization for 'siw_link_ops') drivers/infiniband/sw/siw/siw_main.c: In function 'siw_init_module': >> drivers/infiniband/sw/siw/siw_main.c:795:2: error: implicit declaration of function 'rdma_link_register'; did you mean 'rdma_nl_register'? [-Werror=implicit-function-declaration] rdma_link_register(&siw_link_ops); ^~~~~~~~~~~~~~~~~~ rdma_nl_register drivers/infiniband/sw/siw/siw_main.c: In function 'siw_exit_module': >> drivers/infiniband/sw/siw/siw_main.c:829:2: error: implicit declaration of function 'rdma_link_unregister'; did you mean 'rdma_nl_unregister'? [-Werror=implicit-function-declaration] rdma_link_unregister(&siw_link_ops); ^~~~~~~~~~~~~~~~~~~~ rdma_nl_unregister >> drivers/infiniband/sw/siw/siw_main.c:830:2: error: implicit declaration of function 'ib_unregister_driver'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration] ib_unregister_driver(RDMA_DRIVER_SIW); ^~~~~~~~~~~~~~~~~~~~ ib_unregister_device drivers/infiniband/sw/siw/siw_main.c: At top level: >> drivers/infiniband/sw/siw/siw_main.c:846:24: error: expected declaration specifiers or '...' before string constant MODULE_ALIAS_RDMA_LINK("siw"); ^~~~~ >> drivers/infiniband/sw/siw/siw_main.c:740:29: error: storage size of 'siw_link_ops' isn't known static struct rdma_link_ops siw_link_ops = { ^~~~~~~~~~~~ cc1: some warnings being treated as errors -- drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_query_device': >> drivers/infiniband/sw/siw/siw_verbs.c:247:8: error: 'IB_DEVICE_ALLOW_USER_UNREG' undeclared (first use in this function); did you mean 'IB_DEVICE_SG_GAPS_REG'? | IB_DEVICE_ALLOW_USER_UNREG; ^~~~~~~~~~~~~~~~~~~~~~~~~~ IB_DEVICE_SG_GAPS_REG drivers/infiniband/sw/siw/siw_verbs.c:247:8: note: each undeclared identifier is reported only once for each function it appears in drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_copy_inline_sgl': >> drivers/infiniband/sw/siw/siw_verbs.c:804:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] sqe->sge[0].laddr = (u64)kbuf; ^ drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_post_send': drivers/infiniband/sw/siw/siw_verbs.c:972:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] sqe->base_mr = (uint64_t)reg_wr(wr)->mr; ^ In file included from include/linux/printk.h:331, from include/linux/kernel.h:14, from include/asm-generic/bug.h:18, from arch/sh/include/asm/bug.h:112, from include/linux/bug.h:5, from include/linux/thread_info.h:12, from include/asm-generic/current.h:5, from ./arch/sh/include/generated/asm/current.h:1, from include/linux/sched.h:12, from include/linux/uaccess.h:5, from drivers/infiniband/sw/siw/siw_verbs.c:41: drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_map_mr_sg': >> drivers/infiniband/sw/siw/siw_verbs.c:1587:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] OBJ_ID(&mr->mem), i, pble->size, (void *)pble->addr, ^ include/linux/dynamic_debug.h:136:9: note: in definition of macro 'dynamic_dev_dbg' ##__VA_ARGS__); \ ^~~~~~~~~~~ drivers/infiniband/sw/siw/siw_debug.h:65:2: note: in expansion of macro 'dev_dbg' dev_dbg(&(ddev)->base_dev.dev, "cpu%2d %s: " fmt, smp_processor_id(),\ ^~~~~~~ drivers/infiniband/sw/siw/siw_verbs.c:1585:3: note: in expansion of macro 'siw_dbg' siw_dbg(mr->mem.hdr.sdev, ^~~~~~~ -- drivers/infiniband/sw/siw/siw_qp.c: In function 'siw_activate_tx': >> drivers/infiniband/sw/siw/siw_qp.c:1137:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] wqe->sqe.sge[0].laddr = (u64)&wqe->sqe.sge[1]; ^ -- In file included from include/linux/kernel.h:14, from include/linux/list.h:9, from include/linux/random.h:10, from include/linux/net.h:22, from drivers/infiniband/sw/siw/siw_qp_rx.c:42: drivers/infiniband/sw/siw/siw_qp_rx.c: In function 'siw_rx_umem': >> drivers/infiniband/sw/siw/siw_qp_rx.c:139:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)dest_addr, (void *)umem->fp_addr); ^ include/linux/printk.h:305:37: note: in definition of macro 'pr_warning' printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~ drivers/infiniband/sw/siw/siw_qp_rx.c:137:4: note: in expansion of macro 'pr_warn' pr_warn("siw: %s: [QP %d]: bogus addr: %p, %p\n", ^~~~~~~ drivers/infiniband/sw/siw/siw_qp_rx.c:139:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)dest_addr, (void *)umem->fp_addr); ^ include/linux/printk.h:305:37: note: in definition of macro 'pr_warning' printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~ drivers/infiniband/sw/siw/siw_qp_rx.c:137:4: note: in expansion of macro 'pr_warn' pr_warn("siw: %s: [QP %d]: bogus addr: %p, %p\n", ^~~~~~~ drivers/infiniband/sw/siw/siw_qp_rx.c: In function 'siw_rx_pbl': drivers/infiniband/sw/siw/siw_qp_rx.c:227:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] if (siw_rx_kva(rctx, (void *)buf_addr, bytes) == bytes) { ^ drivers/infiniband/sw/siw/siw_qp_rx.c: In function 'siw_proc_send': drivers/infiniband/sw/siw/siw_qp_rx.c:560:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)(sge->laddr + rctx->sge_off), ^ drivers/infiniband/sw/siw/siw_qp_rx.c: In function 'siw_proc_write': drivers/infiniband/sw/siw/siw_qp_rx.c:665:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)(rctx->ddp_to + rctx->fpdu_part_rcvd), ^ drivers/infiniband/sw/siw/siw_qp_rx.c: In function 'siw_proc_rresp': drivers/infiniband/sw/siw/siw_qp_rx.c:904:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] rv = siw_rx_kva(rctx, (void *)(sge->laddr + wqe->processed), ^ -- drivers/infiniband/sw/siw/siw_qp_tx.c: In function 'siw_try_1seg': >> drivers/infiniband/sw/siw/siw_qp_tx.c:100:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)paddr, &wqe->sqe.sge[1], bytes); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:106:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)paddr, (void *)sge->laddr, bytes); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:106:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)paddr, (void *)sge->laddr, bytes); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:108:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] if (copy_from_user((void *)paddr, ^ drivers/infiniband/sw/siw/siw_qp_tx.c:109:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (const void __user *)sge->laddr, ^ drivers/infiniband/sw/siw/siw_qp_tx.c:129:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)paddr, buffer + off, bytes); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:134:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)paddr, buffer + off, part); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:148:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] memcpy((void *)(paddr + part), ^ drivers/infiniband/sw/siw/siw_qp_tx.c: In function 'siw_qp_prepare_tx': >> drivers/infiniband/sw/siw/siw_qp_tx.c:218:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] data = siw_try_1seg(c_tx, (u64)crc); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:241:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] data = siw_try_1seg(c_tx, (u64)crc); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:253:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] data = siw_try_1seg(c_tx, (u64)crc); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:268:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] data = siw_try_1seg(c_tx, (u64)crc); ^ drivers/infiniband/sw/siw/siw_qp_tx.c: In function 'siw_tx_hdt': drivers/infiniband/sw/siw/siw_qp_tx.c:533:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] iov[seg].iov_base = (void *)(sge->laddr + sge_off); ^ drivers/infiniband/sw/siw/siw_qp_tx.c:584:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (void *)(sge->laddr + sge_off), ^ drivers/infiniband/sw/siw/siw_qp_tx.c: In function 'siw_qp_sq_proc_tx': drivers/infiniband/sw/siw/siw_qp_tx.c:891:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] wqe->sqe.sge[0].laddr = (u64)&wqe->sqe.sge[1]; ^ drivers/infiniband/sw/siw/siw_qp_tx.c: In function 'siw_fastreg_mr': drivers/infiniband/sw/siw/siw_qp_tx.c:998:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] if (&mr->base_mr != (void *)sqe->base_mr) { ^ -- drivers/infiniband//sw/siw/siw_main.c: In function 'siw_dev_from_netdev': drivers/infiniband//sw/siw/siw_main.c:209:3: error: implicit declaration of function 'ib_device_get_by_netdev'; did you mean 'device_get_devnode'? [-Werror=implicit-function-declaration] ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW); ^~~~~~~~~~~~~~~~~~~~~~~ device_get_devnode drivers/infiniband//sw/siw/siw_main.c:209:3: warning: initialization of 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] In file included from include/asm-generic/percpu.h:7, from ./arch/sh/include/generated/asm/percpu.h:1, from include/linux/percpu.h:13, from include/linux/netdevice.h:36, from drivers/infiniband//sw/siw/siw_main.c:41: drivers/infiniband//sw/siw/siw_main.c: At top level: >> include/linux/percpu-defs.h:91:33: warning: '__pcpu_unique_use_cnt' initialized and declared 'extern' extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION' DEFINE_PER_CPU_SECTION(type, name, "") ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ >> include/linux/percpu-defs.h:92:26: error: redefinition of '__pcpu_unique_use_cnt' __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION' DEFINE_PER_CPU_SECTION(type, name, "") ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:91:33: note: previous definition of '__pcpu_unique_use_cnt' was here extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ ^~~~~~~~~~~~~~ include/linux/percpu-defs.h:114:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION' DEFINE_PER_CPU_SECTION(type, name, "") ^~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:268:33: warning: 'use_cnt' initialized and declared 'extern' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~ include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name; \ ^~~~ drivers/infiniband//sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:268:33: error: redefinition of 'use_cnt' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~ include/linux/percpu-defs.h:94:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION' __PCPU_ATTRS(sec) __weak __typeof__(type) name ^~~~ drivers/infiniband//sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:268:33: note: previous definition of 'use_cnt' was here static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~ include/linux/percpu-defs.h:93:44: note: in definition of macro 'DEFINE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name; \ ^~~~ drivers/infiniband//sw/siw/siw_main.c:268:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); ^~~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c: In function 'siw_device_create': drivers/infiniband//sw/siw/siw_main.c:431:10: error: 'struct ib_device' has no member named 'driver_unregister' base_dev->driver_unregister = siw_unregistered; ^~ drivers/infiniband//sw/siw/siw_main.c:572:16: error: 'struct iw_cm_verbs' has no member named 'driver_flags' base_dev->iwcm->driver_flags = IW_F_NO_PORT_MAP; ^~ drivers/infiniband//sw/siw/siw_main.c:572:33: error: 'IW_F_NO_PORT_MAP' undeclared (first use in this function); did you mean 'IFLA_PORT_MAX'? base_dev->iwcm->driver_flags = IW_F_NO_PORT_MAP; ^~~~~~~~~~~~~~~~ IFLA_PORT_MAX drivers/infiniband//sw/siw/siw_main.c:572:33: note: each undeclared identifier is reported only once for each function it appears in drivers/infiniband//sw/siw/siw_main.c: In function 'siw_netdev_unregistered': drivers/infiniband//sw/siw/siw_main.c:635:2: error: implicit declaration of function 'ib_unregister_device_and_put'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration] ib_unregister_device_and_put(&sdev->base_dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ib_unregister_device drivers/infiniband//sw/siw/siw_main.c: In function 'siw_netdev_event': drivers/infiniband//sw/siw/siw_main.c:694:2: error: implicit declaration of function 'ib_device_put'; did you mean 'in_dev_put'? [-Werror=implicit-function-declaration] ib_device_put(&sdev->base_dev); ^~~~~~~~~~~~~ in_dev_put drivers/infiniband//sw/siw/siw_main.c: At top level: drivers/infiniband//sw/siw/siw_main.c:740:15: error: variable 'siw_link_ops' has initializer but incomplete type static struct rdma_link_ops siw_link_ops = { ^~~~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:741:3: error: 'struct rdma_link_ops' has no member named 'type' .type = "siw", ^~~~ drivers/infiniband//sw/siw/siw_main.c:741:10: warning: excess elements in struct initializer .type = "siw", ^~~~~ drivers/infiniband//sw/siw/siw_main.c:741:10: note: (near initialization for 'siw_link_ops') drivers/infiniband//sw/siw/siw_main.c:742:3: error: 'struct rdma_link_ops' has no member named 'newlink' .newlink = siw_newlink, ^~~~~~~ drivers/infiniband//sw/siw/siw_main.c:742:13: warning: excess elements in struct initializer .newlink = siw_newlink, ^~~~~~~~~~~ drivers/infiniband//sw/siw/siw_main.c:742:13: note: (near initialization for 'siw_link_ops') drivers/infiniband//sw/siw/siw_main.c: In function 'siw_init_module': drivers/infiniband//sw/siw/siw_main.c:795:2: error: implicit declaration of function 'rdma_link_register'; did you mean 'rdma_nl_register'? [-Werror=implicit-function-declaration] rdma_link_register(&siw_link_ops); ^~~~~~~~~~~~~~~~~~ rdma_nl_register drivers/infiniband//sw/siw/siw_main.c: In function 'siw_exit_module': drivers/infiniband//sw/siw/siw_main.c:829:2: error: implicit declaration of function 'rdma_link_unregister'; did you mean 'rdma_nl_unregister'? [-Werror=implicit-function-declaration] rdma_link_unregister(&siw_link_ops); ^~~~~~~~~~~~~~~~~~~~ rdma_nl_unregister drivers/infiniband//sw/siw/siw_main.c:830:2: error: implicit declaration of function 'ib_unregister_driver'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration] ib_unregister_driver(RDMA_DRIVER_SIW); ^~~~~~~~~~~~~~~~~~~~ ib_unregister_device drivers/infiniband//sw/siw/siw_main.c: At top level: drivers/infiniband//sw/siw/siw_main.c:846:24: error: expected declaration specifiers or '...' before string constant vim +209 drivers/infiniband/sw/siw/siw_main.c 778298ca Bernard Metzler 2019-01-30 200 778298ca Bernard Metzler 2019-01-30 201 /* 778298ca Bernard Metzler 2019-01-30 202 * Returns siw device if registered for given net device. 778298ca Bernard Metzler 2019-01-30 203 * Increments reference count on contained base ib_device, 778298ca Bernard Metzler 2019-01-30 204 * if siw device was found (via ib_device_get_by_netdev()). 778298ca Bernard Metzler 2019-01-30 205 */ 778298ca Bernard Metzler 2019-01-30 206 static struct siw_device *siw_dev_from_netdev(struct net_device *netdev) 778298ca Bernard Metzler 2019-01-30 207 { 778298ca Bernard Metzler 2019-01-30 208 struct ib_device *base_dev = 778298ca Bernard Metzler 2019-01-30 @209 ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW); 778298ca Bernard Metzler 2019-01-30 210 778298ca Bernard Metzler 2019-01-30 211 return (base_dev != NULL) ? siw_dev_base2siw(base_dev) : NULL; 778298ca Bernard Metzler 2019-01-30 212 } 778298ca Bernard Metzler 2019-01-30 213 778298ca Bernard Metzler 2019-01-30 214 static struct net_device *siw_get_netdev(struct ib_device *base_dev, u8 port) 778298ca Bernard Metzler 2019-01-30 215 { 778298ca Bernard Metzler 2019-01-30 216 struct siw_device *sdev = siw_dev_base2siw(base_dev); 778298ca Bernard Metzler 2019-01-30 217 778298ca Bernard Metzler 2019-01-30 218 if (!sdev->netdev) 778298ca Bernard Metzler 2019-01-30 219 return NULL; 778298ca Bernard Metzler 2019-01-30 220 778298ca Bernard Metzler 2019-01-30 221 dev_hold(sdev->netdev); 778298ca Bernard Metzler 2019-01-30 222 778298ca Bernard Metzler 2019-01-30 223 return sdev->netdev; 778298ca Bernard Metzler 2019-01-30 224 } 778298ca Bernard Metzler 2019-01-30 225 778298ca Bernard Metzler 2019-01-30 226 static int siw_create_tx_threads(void) 778298ca Bernard Metzler 2019-01-30 227 { 778298ca Bernard Metzler 2019-01-30 228 int cpu, rv, assigned = 0; 778298ca Bernard Metzler 2019-01-30 229 778298ca Bernard Metzler 2019-01-30 230 for_each_online_cpu(cpu) { 778298ca Bernard Metzler 2019-01-30 231 /* Skip HT cores */ 778298ca Bernard Metzler 2019-01-30 232 if (cpu % cpumask_weight(topology_sibling_cpumask(cpu))) { 778298ca Bernard Metzler 2019-01-30 233 siw_tx_thread[cpu] = NULL; 778298ca Bernard Metzler 2019-01-30 234 continue; 778298ca Bernard Metzler 2019-01-30 235 } 778298ca Bernard Metzler 2019-01-30 236 siw_tx_thread[cpu] = kthread_create(siw_run_sq, 778298ca Bernard Metzler 2019-01-30 237 (unsigned long *)(long)cpu, 778298ca Bernard Metzler 2019-01-30 238 "siw_tx/%d", cpu); 778298ca Bernard Metzler 2019-01-30 239 if (IS_ERR(siw_tx_thread[cpu])) { 778298ca Bernard Metzler 2019-01-30 240 rv = PTR_ERR(siw_tx_thread[cpu]); 778298ca Bernard Metzler 2019-01-30 241 siw_tx_thread[cpu] = NULL; 778298ca Bernard Metzler 2019-01-30 242 pr_info("Creating TX thread for CPU %d failed", cpu); 778298ca Bernard Metzler 2019-01-30 243 continue; 778298ca Bernard Metzler 2019-01-30 244 } 778298ca Bernard Metzler 2019-01-30 245 kthread_bind(siw_tx_thread[cpu], cpu); 778298ca Bernard Metzler 2019-01-30 246 778298ca Bernard Metzler 2019-01-30 247 wake_up_process(siw_tx_thread[cpu]); 778298ca Bernard Metzler 2019-01-30 248 assigned++; 778298ca Bernard Metzler 2019-01-30 249 } 778298ca Bernard Metzler 2019-01-30 250 return assigned; 778298ca Bernard Metzler 2019-01-30 251 } 778298ca Bernard Metzler 2019-01-30 252 778298ca Bernard Metzler 2019-01-30 253 static int siw_dev_qualified(struct net_device *netdev) 778298ca Bernard Metzler 2019-01-30 254 { 778298ca Bernard Metzler 2019-01-30 255 /* 778298ca Bernard Metzler 2019-01-30 256 * Additional hardware support can be added here 778298ca Bernard Metzler 2019-01-30 257 * (e.g. ARPHRD_FDDI, ARPHRD_ATM, ...) - see 778298ca Bernard Metzler 2019-01-30 258 * <linux/if_arp.h> for type identifiers. 778298ca Bernard Metzler 2019-01-30 259 */ 778298ca Bernard Metzler 2019-01-30 260 if (netdev->type == ARPHRD_ETHER || 778298ca Bernard Metzler 2019-01-30 261 netdev->type == ARPHRD_IEEE802 || 778298ca Bernard Metzler 2019-01-30 262 (netdev->type == ARPHRD_LOOPBACK && loopback_enabled)) 778298ca Bernard Metzler 2019-01-30 263 return 1; 778298ca Bernard Metzler 2019-01-30 264 778298ca Bernard Metzler 2019-01-30 265 return 0; 778298ca Bernard Metzler 2019-01-30 266 } 778298ca Bernard Metzler 2019-01-30 267 778298ca Bernard Metzler 2019-01-30 @268 static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0)); 778298ca Bernard Metzler 2019-01-30 269 :::::: The code at line 209 was first introduced by commit :::::: 778298ca8fdd31ab3ce6b85e1493a4d545749fcc SIW network and RDMA core interface :::::: TO: Bernard Metzler <bmt@zurich.ibm.com> :::::: CC: 0day robot <lkp@intel.com> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index a1fb840de45d..6d160aac26df 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig @@ -107,6 +107,7 @@ source "drivers/infiniband/hw/hfi1/Kconfig" source "drivers/infiniband/hw/qedr/Kconfig" source "drivers/infiniband/sw/rdmavt/Kconfig" source "drivers/infiniband/sw/rxe/Kconfig" +source "drivers/infiniband/sw/siw/Kconfig" endif source "drivers/infiniband/ulp/ipoib/Kconfig" diff --git a/drivers/infiniband/sw/Makefile b/drivers/infiniband/sw/Makefile index 8b095b27db87..d37610fcbbc7 100644 --- a/drivers/infiniband/sw/Makefile +++ b/drivers/infiniband/sw/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_INFINIBAND_RDMAVT) += rdmavt/ obj-$(CONFIG_RDMA_RXE) += rxe/ +obj-$(CONFIG_RDMA_SIW) += siw/ diff --git a/drivers/infiniband/sw/siw/Kconfig b/drivers/infiniband/sw/siw/Kconfig new file mode 100644 index 000000000000..f4f0210256bd --- /dev/null +++ b/drivers/infiniband/sw/siw/Kconfig @@ -0,0 +1,17 @@ +config RDMA_SIW + tristate "Software RDMA over TCP/IP (iWARP) driver" + depends on INET && INFINIBAND && CRYPTO_CRC32 + ---help--- + This driver implements the iWARP RDMA transport over + the Linux TCP/IP network stack. It enables a system with a + standard Ethernet adapter to interoperate with a iWARP + adapter or with another system running the SIW driver. + (See also RXE which is a similar software driver for RoCE.) + + The driver interfaces with the Linux RDMA stack and + implements both a kernel and user space RDMA verbs API. + The user space verbs API requires a support + library named libsiw which is loaded by the generic user + space verbs API, libibverbs. To implement RDMA over + TCP/IP, the driver further interfaces with the Linux + in-kernel TCP socket layer. diff --git a/drivers/infiniband/sw/siw/Makefile b/drivers/infiniband/sw/siw/Makefile new file mode 100644 index 000000000000..20f31c9e827b --- /dev/null +++ b/drivers/infiniband/sw/siw/Makefile @@ -0,0 +1,15 @@ +obj-$(CONFIG_RDMA_SIW) += siw.o + +siw-y := \ + siw_main.o \ + siw_cm.o \ + siw_verbs.o \ + siw_obj.o \ + siw_qp.o \ + siw_qp_tx.o \ + siw_qp_rx.o \ + siw_cq.o \ + siw_cm.o \ + siw_debug.o \ + siw_ae.o \ + siw_mem.o