diff mbox series

[v5,13/13] SIW addition to kernel build environment

Message ID 20190219100903.15408-14-bmt@zurich.ibm.com (mailing list archive)
State Superseded
Delegated to: Jason Gunthorpe
Headers show
Series SIW: Request for Comments | expand

Commit Message

Bernard Metzler Feb. 19, 2019, 10:09 a.m. UTC
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
---
 MAINTAINERS                        |  7 +++++++
 drivers/infiniband/Kconfig         |  1 +
 drivers/infiniband/sw/Makefile     |  1 +
 drivers/infiniband/sw/siw/Kconfig  | 17 +++++++++++++++++
 drivers/infiniband/sw/siw/Makefile | 15 +++++++++++++++
 5 files changed, 41 insertions(+)
 create mode 100644 drivers/infiniband/sw/siw/Kconfig
 create mode 100644 drivers/infiniband/sw/siw/Makefile

Comments

kernel test robot Feb. 21, 2019, 4:02 p.m. UTC | #1
Hi Bernard,

I love your patch! Yet something to improve:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on next-20190221]
[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/Bernard-Metzler/SIW-Request-for-Comments/20190221-220427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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=m68k 

All error/warnings (new ones prefixed by >>):

   In file included from include/asm-generic/percpu.h:7,
                    from ./arch/m68k/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:42:
   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:249: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:249: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:249: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:249: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:249: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:249: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:249: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:249: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:249: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:416:3: error: 'const struct ib_device_ops' has no member named 'dealloc_driver'; did you mean 'dealloc_fmr'?
     .dealloc_driver = siw_device_cleanup,
      ^~~~~~~~~~~~~~
      dealloc_fmr
>> drivers/infiniband/sw/siw/siw_main.c:416:20: error: initialization of 'void (*)(struct ib_qp *)' from incompatible pointer type 'void (*)(struct ib_device *)' [-Werror=incompatible-pointer-types]
     .dealloc_driver = siw_device_cleanup,
                       ^~~~~~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:416:20: note: (near initialization for 'siw_device_ops.drain_sq')
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_device_create':
>> drivers/infiniband/sw/siw/siw_main.c:514:7: error: implicit declaration of function 'ib_device_set_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     rv = ib_device_set_netdev(base_dev, netdev, 1);
          ^~~~~~~~~~~~~~~~~~~~
          ib_device_try_get
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_netdev_event':
>> drivers/infiniband/sw/siw/siw_main.c:615:13: error: implicit declaration of function 'ib_device_get_by_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
                ^~~~~~~~~~~~~~~~~~~~~~~
                ib_device_try_get
>> drivers/infiniband/sw/siw/siw_main.c:615:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
>> drivers/infiniband/sw/siw/siw_main.c:647:3: error: implicit declaration of function 'ib_unregister_device_queued'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration]
      ib_unregister_device_queued(&sdev->base_dev);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ib_unregister_device
   drivers/infiniband/sw/siw/siw_main.c: In function 'siw_newlink':
   drivers/infiniband/sw/siw/siw_main.c:679:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
   drivers/infiniband/sw/siw/siw_main.c: At top level:
>> drivers/infiniband/sw/siw/siw_main.c:711: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:712:3: error: 'struct rdma_link_ops' has no member named 'type'
     .type = "siw",
      ^~~~
   drivers/infiniband/sw/siw/siw_main.c:712:10: warning: excess elements in struct initializer
     .type = "siw",
             ^~~~~
   drivers/infiniband/sw/siw/siw_main.c:712:10: note: (near initialization for 'siw_link_ops')
>> drivers/infiniband/sw/siw/siw_main.c:713:3: error: 'struct rdma_link_ops' has no member named 'newlink'
     .newlink = siw_newlink,
      ^~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:713:13: warning: excess elements in struct initializer
     .newlink = siw_newlink,
                ^~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_main.c:713: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:763: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:797: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:798: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:813:24: error: expected declaration specifiers or '...' before string constant
    MODULE_ALIAS_RDMA_LINK("siw");
                           ^~~~~
>> drivers/infiniband/sw/siw/siw_main.c:711: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:238: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:238: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:767: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:935: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/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from include/linux/uaccess.h:5,
                    from drivers/infiniband/sw/siw/siw_verbs.c:42:
   drivers/infiniband/sw/siw/siw_verbs.c: In function 'siw_map_mr_sg':
   drivers/infiniband/sw/siw/siw_verbs.c:1550: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:47: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:1548:3: note: in expansion of macro 'siw_dbg'
      siw_dbg(mr->mem.hdr.sdev,
      ^~~~~~~
--
   In file included from include/asm-generic/percpu.h:7,
                    from ./arch/m68k/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:42:
   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:249: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:249: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:249: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:249: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:249: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:249: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:249: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:249: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:249: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:416:3: error: 'const struct ib_device_ops' has no member named 'dealloc_driver'; did you mean 'dealloc_fmr'?
     .dealloc_driver = siw_device_cleanup,
      ^~~~~~~~~~~~~~
      dealloc_fmr
   drivers/infiniband//sw/siw/siw_main.c:416:20: error: initialization of 'void (*)(struct ib_qp *)' from incompatible pointer type 'void (*)(struct ib_device *)' [-Werror=incompatible-pointer-types]
     .dealloc_driver = siw_device_cleanup,
                       ^~~~~~~~~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:416:20: note: (near initialization for 'siw_device_ops.drain_sq')
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_device_create':
   drivers/infiniband//sw/siw/siw_main.c:514:7: error: implicit declaration of function 'ib_device_set_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     rv = ib_device_set_netdev(base_dev, netdev, 1);
          ^~~~~~~~~~~~~~~~~~~~
          ib_device_try_get
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_netdev_event':
   drivers/infiniband//sw/siw/siw_main.c:615:13: error: implicit declaration of function 'ib_device_get_by_netdev'; did you mean 'ib_device_try_get'? [-Werror=implicit-function-declaration]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
                ^~~~~~~~~~~~~~~~~~~~~~~
                ib_device_try_get
   drivers/infiniband//sw/siw/siw_main.c:615:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
   drivers/infiniband//sw/siw/siw_main.c:647:3: error: implicit declaration of function 'ib_unregister_device_queued'; did you mean 'ib_unregister_device'? [-Werror=implicit-function-declaration]
      ib_unregister_device_queued(&sdev->base_dev);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      ib_unregister_device
   drivers/infiniband//sw/siw/siw_main.c: In function 'siw_newlink':
   drivers/infiniband//sw/siw/siw_main.c:679:11: warning: assignment to 'struct ib_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
     base_dev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_SIW);
              ^
   drivers/infiniband//sw/siw/siw_main.c: At top level:
   drivers/infiniband//sw/siw/siw_main.c:711: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:712:3: error: 'struct rdma_link_ops' has no member named 'type'
     .type = "siw",
      ^~~~
   drivers/infiniband//sw/siw/siw_main.c:712:10: warning: excess elements in struct initializer
     .type = "siw",
             ^~~~~
   drivers/infiniband//sw/siw/siw_main.c:712:10: note: (near initialization for 'siw_link_ops')
   drivers/infiniband//sw/siw/siw_main.c:713:3: error: 'struct rdma_link_ops' has no member named 'newlink'
     .newlink = siw_newlink,
      ^~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:713:13: warning: excess elements in struct initializer
     .newlink = siw_newlink,
                ^~~~~~~~~~~
   drivers/infiniband//sw/siw/siw_main.c:713: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:763: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:797: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);
     ^~~~~~~~~~~~~~~~~~~~

vim +/__pcpu_unique_use_cnt +92 include/linux/percpu-defs.h

62fde541 Tejun Heo          2014-06-17   37  
5028eaa9 David Howells      2009-04-21   38  /*
5028eaa9 David Howells      2009-04-21   39   * Base implementations of per-CPU variable declarations and definitions, where
5028eaa9 David Howells      2009-04-21   40   * the section in which the variable is to be placed is provided by the
7c756e6e Tejun Heo          2009-06-24   41   * 'sec' argument.  This may be used to affect the parameters governing the
5028eaa9 David Howells      2009-04-21   42   * variable's storage.
5028eaa9 David Howells      2009-04-21   43   *
5028eaa9 David Howells      2009-04-21   44   * NOTE!  The sections for the DECLARE and for the DEFINE must match, lest
5028eaa9 David Howells      2009-04-21   45   * linkage errors occur due the compiler generating the wrong code to access
5028eaa9 David Howells      2009-04-21   46   * that section.
5028eaa9 David Howells      2009-04-21   47   */
7c756e6e Tejun Heo          2009-06-24   48  #define __PCPU_ATTRS(sec)						\
e0fdb0e0 Rusty Russell      2009-10-29   49  	__percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))	\
7c756e6e Tejun Heo          2009-06-24   50  	PER_CPU_ATTRIBUTES
7c756e6e Tejun Heo          2009-06-24   51  
7c756e6e Tejun Heo          2009-06-24   52  #define __PCPU_DUMMY_ATTRS						\
7c756e6e Tejun Heo          2009-06-24   53  	__attribute__((section(".discard"), unused))
7c756e6e Tejun Heo          2009-06-24   54  
7c756e6e Tejun Heo          2009-06-24   55  /*
7c756e6e Tejun Heo          2009-06-24   56   * s390 and alpha modules require percpu variables to be defined as
7c756e6e Tejun Heo          2009-06-24   57   * weak to force the compiler to generate GOT based external
7c756e6e Tejun Heo          2009-06-24   58   * references for them.  This is necessary because percpu sections
7c756e6e Tejun Heo          2009-06-24   59   * will be located outside of the usually addressable area.
7c756e6e Tejun Heo          2009-06-24   60   *
7c756e6e Tejun Heo          2009-06-24   61   * This definition puts the following two extra restrictions when
7c756e6e Tejun Heo          2009-06-24   62   * defining percpu variables.
7c756e6e Tejun Heo          2009-06-24   63   *
7c756e6e Tejun Heo          2009-06-24   64   * 1. The symbol must be globally unique, even the static ones.
7c756e6e Tejun Heo          2009-06-24   65   * 2. Static percpu variables cannot be defined inside a function.
7c756e6e Tejun Heo          2009-06-24   66   *
7c756e6e Tejun Heo          2009-06-24   67   * Archs which need weak percpu definitions should define
7c756e6e Tejun Heo          2009-06-24   68   * ARCH_NEEDS_WEAK_PER_CPU in asm/percpu.h when necessary.
7c756e6e Tejun Heo          2009-06-24   69   *
7c756e6e Tejun Heo          2009-06-24   70   * To ensure that the generic code observes the above two
7c756e6e Tejun Heo          2009-06-24   71   * restrictions, if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is set weak
7c756e6e Tejun Heo          2009-06-24   72   * definition is used for all cases.
7c756e6e Tejun Heo          2009-06-24   73   */
7c756e6e Tejun Heo          2009-06-24   74  #if defined(ARCH_NEEDS_WEAK_PER_CPU) || defined(CONFIG_DEBUG_FORCE_WEAK_PER_CPU)
7c756e6e Tejun Heo          2009-06-24   75  /*
7c756e6e Tejun Heo          2009-06-24   76   * __pcpu_scope_* dummy variable is used to enforce scope.  It
7c756e6e Tejun Heo          2009-06-24   77   * receives the static modifier when it's used in front of
7c756e6e Tejun Heo          2009-06-24   78   * DEFINE_PER_CPU() and will trigger build failure if
7c756e6e Tejun Heo          2009-06-24   79   * DECLARE_PER_CPU() is used for the same variable.
7c756e6e Tejun Heo          2009-06-24   80   *
7c756e6e Tejun Heo          2009-06-24   81   * __pcpu_unique_* dummy variable is used to enforce symbol uniqueness
7c756e6e Tejun Heo          2009-06-24   82   * such that hidden weak symbol collision, which will cause unrelated
7c756e6e Tejun Heo          2009-06-24   83   * variables to share the same address, can be detected during build.
7c756e6e Tejun Heo          2009-06-24   84   */
7c756e6e Tejun Heo          2009-06-24   85  #define DECLARE_PER_CPU_SECTION(type, name, sec)			\
7c756e6e Tejun Heo          2009-06-24   86  	extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name;		\
dd17c8f7 Rusty Russell      2009-10-29   87  	extern __PCPU_ATTRS(sec) __typeof__(type) name
7c756e6e Tejun Heo          2009-06-24   88  
7c756e6e Tejun Heo          2009-06-24   89  #define DEFINE_PER_CPU_SECTION(type, name, sec)				\
7c756e6e Tejun Heo          2009-06-24   90  	__PCPU_DUMMY_ATTRS char __pcpu_scope_##name;			\
0f5e4816 Tejun Heo          2009-10-29  @91  	extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;		\
7c756e6e Tejun Heo          2009-06-24  @92  	__PCPU_DUMMY_ATTRS char __pcpu_unique_##name;			\
b1a0fbfd Tejun Heo          2013-12-04   93  	extern __PCPU_ATTRS(sec) __typeof__(type) name;			\
69a60bc7 Alexander Pateenok 2018-10-30   94  	__PCPU_ATTRS(sec) __weak __typeof__(type) name
7c756e6e Tejun Heo          2009-06-24   95  #else
7c756e6e Tejun Heo          2009-06-24   96  /*
7c756e6e Tejun Heo          2009-06-24   97   * Normal declaration and definition macros.
7c756e6e Tejun Heo          2009-06-24   98   */
7c756e6e Tejun Heo          2009-06-24   99  #define DECLARE_PER_CPU_SECTION(type, name, sec)			\
dd17c8f7 Rusty Russell      2009-10-29  100  	extern __PCPU_ATTRS(sec) __typeof__(type) name
7c756e6e Tejun Heo          2009-06-24  101  

:::::: The code at line 92 was first introduced by commit
:::::: 7c756e6e19e71f0327760d8955f7077118ebb2b1 percpu: implement optional weak percpu definitions

:::::: TO: Tejun Heo <tj@kernel.org>
:::::: CC: Tejun Heo <tj@kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Feb. 22, 2019, 2:11 a.m. UTC | #2
Hi Bernard,

I love your patch! Yet something to improve:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on next-20190221]
[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/Bernard-Metzler/SIW-Request-for-Comments/20190221-220427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: i386-allmodconfig (attached as .config)
compiler: gcc-8 (Debian 8.2.0-20) 8.2.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/infiniband/sw/siw/siw_qp.c: In function 'siw_activate_tx':
   drivers/infiniband/sw/siw/siw_qp.c:1142: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 arch/x86/include/asm/atomic.h:8,
                    from arch/x86/include/asm/msr.h:67,
                    from arch/x86/include/asm/processor.h:21,
                    from arch/x86/include/asm/archrandom.h:26,
                    from include/linux/random.h:166,
                    from include/linux/net.h:22,
                    from drivers/infiniband/sw/siw/siw_qp.c:42:
   In function 'siw_cq_notify_now.isra.4',
       inlined from 'siw_sqe_complete' at drivers/infiniband/sw/siw/siw_qp.c:1269:13:
>> arch/x86/include/asm/cmpxchg.h:67:4: error: call to '__xchg_wrong_size' declared with attribute error: Bad argument size for xchg
       __ ## op ## _wrong_size();   \
       ^~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:78:27: note: in expansion of macro '__xchg_op'
    #define arch_xchg(ptr, v) __xchg_op((ptr), (v), xchg, "")
                              ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:415:2: note: in expansion of macro 'arch_xchg'
     arch_xchg(__ai_ptr, (new));     \
     ^~~~~~~~~
   arch/x86/include/asm/barrier.h:65:47: note: in expansion of macro 'xchg'
    #define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
                                                  ^~~~
   include/asm-generic/barrier.h:145:35: note: in expansion of macro '__smp_store_mb'
    #define smp_store_mb(var, value)  __smp_store_mb(var, value)
                                      ^~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_qp.c:1217:3: note: in expansion of macro 'smp_store_mb'
      smp_store_mb(*cq->notify, SIW_NOTIFY_NOT);
      ^~~~~~~~~~~~
   In function 'siw_cq_notify_now.isra.4',
       inlined from 'siw_rqe_complete' at drivers/infiniband/sw/siw/siw_qp.c:1324:13:
>> arch/x86/include/asm/cmpxchg.h:67:4: error: call to '__xchg_wrong_size' declared with attribute error: Bad argument size for xchg
       __ ## op ## _wrong_size();   \
       ^~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/cmpxchg.h:78:27: note: in expansion of macro '__xchg_op'
    #define arch_xchg(ptr, v) __xchg_op((ptr), (v), xchg, "")
                              ^~~~~~~~~
   include/asm-generic/atomic-instrumented.h:415:2: note: in expansion of macro 'arch_xchg'
     arch_xchg(__ai_ptr, (new));     \
     ^~~~~~~~~
   arch/x86/include/asm/barrier.h:65:47: note: in expansion of macro 'xchg'
    #define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
                                                  ^~~~
   include/asm-generic/barrier.h:145:35: note: in expansion of macro '__smp_store_mb'
    #define smp_store_mb(var, value)  __smp_store_mb(var, value)
                                      ^~~~~~~~~~~~~~
   drivers/infiniband/sw/siw/siw_qp.c:1217:3: note: in expansion of macro 'smp_store_mb'
      smp_store_mb(*cq->notify, SIW_NOTIFY_NOT);
      ^~~~~~~~~~~~

vim +/__xchg_wrong_size +67 arch/x86/include/asm/cmpxchg.h

e9826380 Jeremy Fitzhardinge 2011-08-18  37  
e9826380 Jeremy Fitzhardinge 2011-08-18  38  /* 
31a8394e Jeremy Fitzhardinge 2011-09-30  39   * An exchange-type operation, which takes a value and a pointer, and
7f5281ae Li Zhong            2013-04-25  40   * returns the old value.
e9826380 Jeremy Fitzhardinge 2011-08-18  41   */
31a8394e Jeremy Fitzhardinge 2011-09-30  42  #define __xchg_op(ptr, arg, op, lock)					\
e9826380 Jeremy Fitzhardinge 2011-08-18  43  	({								\
31a8394e Jeremy Fitzhardinge 2011-09-30  44  	        __typeof__ (*(ptr)) __ret = (arg);			\
31a8394e Jeremy Fitzhardinge 2011-09-30  45  		switch (sizeof(*(ptr))) {				\
e9826380 Jeremy Fitzhardinge 2011-08-18  46  		case __X86_CASE_B:					\
31a8394e Jeremy Fitzhardinge 2011-09-30  47  			asm volatile (lock #op "b %b0, %1\n"		\
2ca052a3 Jeremy Fitzhardinge 2012-04-02  48  				      : "+q" (__ret), "+m" (*(ptr))	\
31a8394e Jeremy Fitzhardinge 2011-09-30  49  				      : : "memory", "cc");		\
e9826380 Jeremy Fitzhardinge 2011-08-18  50  			break;						\
e9826380 Jeremy Fitzhardinge 2011-08-18  51  		case __X86_CASE_W:					\
31a8394e Jeremy Fitzhardinge 2011-09-30  52  			asm volatile (lock #op "w %w0, %1\n"		\
31a8394e Jeremy Fitzhardinge 2011-09-30  53  				      : "+r" (__ret), "+m" (*(ptr))	\
31a8394e Jeremy Fitzhardinge 2011-09-30  54  				      : : "memory", "cc");		\
e9826380 Jeremy Fitzhardinge 2011-08-18  55  			break;						\
e9826380 Jeremy Fitzhardinge 2011-08-18  56  		case __X86_CASE_L:					\
31a8394e Jeremy Fitzhardinge 2011-09-30  57  			asm volatile (lock #op "l %0, %1\n"		\
31a8394e Jeremy Fitzhardinge 2011-09-30  58  				      : "+r" (__ret), "+m" (*(ptr))	\
31a8394e Jeremy Fitzhardinge 2011-09-30  59  				      : : "memory", "cc");		\
e9826380 Jeremy Fitzhardinge 2011-08-18  60  			break;						\
e9826380 Jeremy Fitzhardinge 2011-08-18  61  		case __X86_CASE_Q:					\
31a8394e Jeremy Fitzhardinge 2011-09-30  62  			asm volatile (lock #op "q %q0, %1\n"		\
31a8394e Jeremy Fitzhardinge 2011-09-30  63  				      : "+r" (__ret), "+m" (*(ptr))	\
31a8394e Jeremy Fitzhardinge 2011-09-30  64  				      : : "memory", "cc");		\
e9826380 Jeremy Fitzhardinge 2011-08-18  65  			break;						\
e9826380 Jeremy Fitzhardinge 2011-08-18  66  		default:						\
31a8394e Jeremy Fitzhardinge 2011-09-30 @67  			__ ## op ## _wrong_size();			\
e9826380 Jeremy Fitzhardinge 2011-08-18  68  		}							\
31a8394e Jeremy Fitzhardinge 2011-09-30  69  		__ret;							\
e9826380 Jeremy Fitzhardinge 2011-08-18  70  	})
e9826380 Jeremy Fitzhardinge 2011-08-18  71  

:::::: The code at line 67 was first introduced by commit
:::::: 31a8394e069e47dc47f4c29e4213aa943342f19f x86: consolidate xchg and xadd macros

:::::: TO: Jeremy Fitzhardinge <jeremy@goop.org>
:::::: CC: Jeremy Fitzhardinge <jeremy@goop.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Gal Pressman Feb. 28, 2019, 11:51 a.m. UTC | #3
On 19-Feb-19 12:09, Bernard Metzler wrote:
> Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
> ---
>  MAINTAINERS                        |  7 +++++++
>  drivers/infiniband/Kconfig         |  1 +
>  drivers/infiniband/sw/Makefile     |  1 +
>  drivers/infiniband/sw/siw/Kconfig  | 17 +++++++++++++++++
>  drivers/infiniband/sw/siw/Makefile | 15 +++++++++++++++
>  5 files changed, 41 insertions(+)
>  create mode 100644 drivers/infiniband/sw/siw/Kconfig
>  create mode 100644 drivers/infiniband/sw/siw/Makefile
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8c68de3cfd80..34f0f0c7af19 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14055,6 +14055,13 @@ M:	Chris Boot <bootc@bootc.net>
>  S:	Maintained
>  F:	drivers/leds/leds-net48xx.c
>  
> +SOFT-ROCE DRIVER (siw)

This is not a soft roce driver :).

> +M:	Bernard Metzler <bmt@zurich.ibm.com>
> +L:	linux-rdma@vger.kernel.org
> +S:	Supported
> +F:	drivers/infiniband/sw/siw/
> +F:	include/uapi/rdma/siw_user.h
> +
>  SOFT-ROCE DRIVER (rxe)
>  M:	Moni Shoua <monis@mellanox.com>
>  L:	linux-rdma@vger.kernel.org
> 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---

According to checkpatch:
WARNING: prefer 'help' over '---help---' for new help texts

> +	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
> 

Reviewed-by: Gal Pressman <galpress@amazon.com>
Bernard Metzler Feb. 28, 2019, 11:55 a.m. UTC | #4
---
Bernard Metzler, PhD
Tech. Leader High Performance I/O, Principal Research Staff
IBM Zurich Research Laboratory
Saeumerstrasse 4
CH-8803 Rueschlikon, Switzerland
+41 44 724 8605

-----"Gal Pressman" <galpress@amazon.com> wrote: -----

>To: "Bernard Metzler" <bmt@zurich.ibm.com>,
><linux-rdma@vger.kernel.org>
>From: "Gal Pressman" <galpress@amazon.com>
>Date: 02/28/2019 12:51PM
>Subject: Re: [PATCH v5 13/13] SIW addition to kernel build
>environment
>
>On 19-Feb-19 12:09, Bernard Metzler wrote:
>> Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
>> ---
>>  MAINTAINERS                        |  7 +++++++
>>  drivers/infiniband/Kconfig         |  1 +
>>  drivers/infiniband/sw/Makefile     |  1 +
>>  drivers/infiniband/sw/siw/Kconfig  | 17 +++++++++++++++++
>>  drivers/infiniband/sw/siw/Makefile | 15 +++++++++++++++
>>  5 files changed, 41 insertions(+)
>>  create mode 100644 drivers/infiniband/sw/siw/Kconfig
>>  create mode 100644 drivers/infiniband/sw/siw/Makefile
>> 
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 8c68de3cfd80..34f0f0c7af19 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -14055,6 +14055,13 @@ M:	Chris Boot <bootc@bootc.net>
>>  S:	Maintained
>>  F:	drivers/leds/leds-net48xx.c
>>  
>> +SOFT-ROCE DRIVER (siw)
>
>This is not a soft roce driver :).

Hahaha! good catch. thanks! I am happy I 
at least changed the maintainer after copypaste.

>
>> +M:	Bernard Metzler <bmt@zurich.ibm.com>
>> +L:	linux-rdma@vger.kernel.org
>> +S:	Supported
>> +F:	drivers/infiniband/sw/siw/
>> +F:	include/uapi/rdma/siw_user.h
>> +
>>  SOFT-ROCE DRIVER (rxe)
>>  M:	Moni Shoua <monis@mellanox.com>
>>  L:	linux-rdma@vger.kernel.org
>> 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---
>
>According to checkpatch:
>WARNING: prefer 'help' over '---help---' for new help texts

OK, thanks!

>
>> +	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
>> 
>
>Reviewed-by: Gal Pressman <galpress@amazon.com>
>
>
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 8c68de3cfd80..34f0f0c7af19 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14055,6 +14055,13 @@  M:	Chris Boot <bootc@bootc.net>
 S:	Maintained
 F:	drivers/leds/leds-net48xx.c
 
+SOFT-ROCE DRIVER (siw)
+M:	Bernard Metzler <bmt@zurich.ibm.com>
+L:	linux-rdma@vger.kernel.org
+S:	Supported
+F:	drivers/infiniband/sw/siw/
+F:	include/uapi/rdma/siw_user.h
+
 SOFT-ROCE DRIVER (rxe)
 M:	Moni Shoua <monis@mellanox.com>
 L:	linux-rdma@vger.kernel.org
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