diff mbox series

[rdma-next,10/11] RDMA/erdma: Add the ABI definitions

Message ID 20211221024858.25938-11-chengyou@linux.alibaba.com (mailing list archive)
State Superseded
Headers show
Series Elastic RDMA Adapter (ERDMA) driver | expand

Commit Message

Cheng Xu Dec. 21, 2021, 2:48 a.m. UTC
Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
---
 include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 include/uapi/rdma/erdma-abi.h

Comments

kernel test robot Dec. 21, 2021, 11:57 a.m. UTC | #1
Hi Cheng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on linus/master v5.16-rc6 next-20211220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cheng-Xu/Elastic-RDMA-Adapter-ERDMA-driver/20211221-105044
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: x86_64-randconfig-a004-20211220 (https://download.01.org/0day-ci/archive/20211221/202112211925.cA7D5851-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/8bafa2877f1dd44153ce36bb8a0a0c491f990b6b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cheng-Xu/Elastic-RDMA-Adapter-ERDMA-driver/20211221-105044
        git checkout 8bafa2877f1dd44153ce36bb8a0a0c491f990b6b
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from <command-line>:32:
>> ./usr/include/rdma/erdma-abi.h:14:2: error: unknown type name 'u64'
      14 |  u64 db_record_va;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:15:2: error: unknown type name 'u64'
      15 |  u64 qbuf_va;
         |  ^~~
>> ./usr/include/rdma/erdma-abi.h:16:2: error: unknown type name 'u32'
      16 |  u32 qbuf_len;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:17:2: error: unknown type name 'u32'
      17 |  u32 rsvd0;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:21:2: error: unknown type name 'u32'
      21 |  u32 cq_id;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:22:2: error: unknown type name 'u32'
      22 |  u32 num_cqe;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:26:2: error: unknown type name 'u64'
      26 |  u64 db_record_va;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:27:2: error: unknown type name 'u64'
      27 |  u64 qbuf_va;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:28:2: error: unknown type name 'u32'
      28 |  u32 qbuf_len;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:29:2: error: unknown type name 'u32'
      29 |  u32 rsvd0;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:33:2: error: unknown type name 'u32'
      33 |  u32 qp_id;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:34:2: error: unknown type name 'u32'
      34 |  u32 num_sqe;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:35:2: error: unknown type name 'u32'
      35 |  u32 num_rqe;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:36:2: error: unknown type name 'u32'
      36 |  u32 rq_offset;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:40:2: error: unknown type name 'u32'
      40 |  u32 dev_id;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:41:2: error: unknown type name 'u32'
      41 |  u32 pad;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:42:2: error: unknown type name 'u32'
      42 |  u32 sdb_type;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:43:2: error: unknown type name 'u32'
      43 |  u32 sdb_offset;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:44:2: error: unknown type name 'u64'
      44 |  u64 sdb;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:45:2: error: unknown type name 'u64'
      45 |  u64 rdb;
         |  ^~~
   ./usr/include/rdma/erdma-abi.h:46:2: error: unknown type name 'u64'
      46 |  u64 cdb;
         |  ^~~

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Dec. 22, 2021, 4:14 p.m. UTC | #2
Hi Cheng,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on rdma/for-next]
[also build test ERROR on linus/master v5.16-rc6 next-20211222]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cheng-Xu/Elastic-RDMA-Adapter-ERDMA-driver/20211221-105044
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: i386-randconfig-a014-20211220 (https://download.01.org/0day-ci/archive/20211223/202112230027.47XqoqUH-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 555eacf75f21cd1dfc6363d73ad187b730349543)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8bafa2877f1dd44153ce36bb8a0a0c491f990b6b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cheng-Xu/Elastic-RDMA-Adapter-ERDMA-driver/20211221-105044
        git checkout 8bafa2877f1dd44153ce36bb8a0a0c491f990b6b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from <built-in>:1:
>> ./usr/include/rdma/erdma-abi.h:14:2: error: unknown type name 'u64'
           u64 db_record_va;
           ^
   ./usr/include/rdma/erdma-abi.h:15:2: error: unknown type name 'u64'
           u64 qbuf_va;
           ^
>> ./usr/include/rdma/erdma-abi.h:16:2: error: unknown type name 'u32'
           u32 qbuf_len;
           ^
   ./usr/include/rdma/erdma-abi.h:17:2: error: unknown type name 'u32'
           u32 rsvd0;
           ^
   ./usr/include/rdma/erdma-abi.h:21:2: error: unknown type name 'u32'
           u32 cq_id;
           ^
   ./usr/include/rdma/erdma-abi.h:22:2: error: unknown type name 'u32'
           u32 num_cqe;
           ^
   ./usr/include/rdma/erdma-abi.h:26:2: error: unknown type name 'u64'
           u64 db_record_va;
           ^
   ./usr/include/rdma/erdma-abi.h:27:2: error: unknown type name 'u64'
           u64 qbuf_va;
           ^
   ./usr/include/rdma/erdma-abi.h:28:2: error: unknown type name 'u32'
           u32 qbuf_len;
           ^
   ./usr/include/rdma/erdma-abi.h:29:2: error: unknown type name 'u32'
           u32 rsvd0;
           ^
   ./usr/include/rdma/erdma-abi.h:33:2: error: unknown type name 'u32'
           u32 qp_id;
           ^
   ./usr/include/rdma/erdma-abi.h:34:2: error: unknown type name 'u32'
           u32 num_sqe;
           ^
   ./usr/include/rdma/erdma-abi.h:35:2: error: unknown type name 'u32'
           u32 num_rqe;
           ^
   ./usr/include/rdma/erdma-abi.h:36:2: error: unknown type name 'u32'
           u32 rq_offset;
           ^
   ./usr/include/rdma/erdma-abi.h:40:2: error: unknown type name 'u32'
           u32 dev_id;
           ^
   ./usr/include/rdma/erdma-abi.h:41:2: error: unknown type name 'u32'
           u32 pad;
           ^
   ./usr/include/rdma/erdma-abi.h:42:2: error: unknown type name 'u32'
           u32 sdb_type;
           ^
   ./usr/include/rdma/erdma-abi.h:43:2: error: unknown type name 'u32'
           u32 sdb_offset;
           ^
   ./usr/include/rdma/erdma-abi.h:44:2: error: unknown type name 'u64'
           u64 sdb;
           ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Zhu Yanjun Dec. 23, 2021, 3:46 p.m. UTC | #3
在 2021/12/21 10:48, Cheng Xu 写道:
> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> ---
>   include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
>   create mode 100644 include/uapi/rdma/erdma-abi.h
> 
> diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
> new file mode 100644
> index 000000000000..6bcba10c1e41
> --- /dev/null
> +++ b/include/uapi/rdma/erdma-abi.h
> @@ -0,0 +1,49 @@
> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
> +/*
> + * Copyright (c) 2020-2021, Alibaba Group.
> + */
> +
> +#ifndef __ERDMA_USER_H__
> +#define __ERDMA_USER_H__
> +
> +#include <linux/types.h>
> +
> +#define ERDMA_ABI_VERSION       1

ERDMA_ABI_VERSION should be 2?

Zhu Yanjun
> +
> +struct erdma_ureq_create_cq {
> +	u64 db_record_va;
> +	u64 qbuf_va;
> +	u32 qbuf_len;
> +	u32 rsvd0;
> +};
> +
> +struct erdma_uresp_create_cq {
> +	u32 cq_id;
> +	u32 num_cqe;
> +};
> +
> +struct erdma_ureq_create_qp {
> +	u64 db_record_va;
> +	u64 qbuf_va;
> +	u32 qbuf_len;
> +	u32 rsvd0;
> +};
> +
> +struct erdma_uresp_create_qp {
> +	u32 qp_id;
> +	u32 num_sqe;
> +	u32 num_rqe;
> +	u32 rq_offset;
> +};
> +
> +struct erdma_uresp_alloc_ctx {
> +	u32 dev_id;
> +	u32 pad;
> +	u32 sdb_type;
> +	u32 sdb_offset;
> +	u64 sdb;
> +	u64 rdb;
> +	u64 cdb;
> +};
> +
> +#endif
Leon Romanovsky Dec. 23, 2021, 6:45 p.m. UTC | #4
On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
> 在 2021/12/21 10:48, Cheng Xu 写道:
> > Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> > ---
> >   include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
> >   1 file changed, 49 insertions(+)
> >   create mode 100644 include/uapi/rdma/erdma-abi.h
> > 
> > diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
> > new file mode 100644
> > index 000000000000..6bcba10c1e41
> > --- /dev/null
> > +++ b/include/uapi/rdma/erdma-abi.h
> > @@ -0,0 +1,49 @@
> > +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
> > +/*
> > + * Copyright (c) 2020-2021, Alibaba Group.
> > + */
> > +
> > +#ifndef __ERDMA_USER_H__
> > +#define __ERDMA_USER_H__
> > +
> > +#include <linux/types.h>
> > +
> > +#define ERDMA_ABI_VERSION       1
> 
> ERDMA_ABI_VERSION should be 2?

Why?

This field is for rdma-core and we don't have erdma provider in that
library yet. It always starts from 1 for new drivers.

Thanks
Zhu Yanjun Dec. 23, 2021, 10:55 p.m. UTC | #5
在 2021/12/24 2:45, Leon Romanovsky 写道:
> On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
>> 在 2021/12/21 10:48, Cheng Xu 写道:
>>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>>> ---
>>>    include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
>>>    1 file changed, 49 insertions(+)
>>>    create mode 100644 include/uapi/rdma/erdma-abi.h
>>>
>>> diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
>>> new file mode 100644
>>> index 000000000000..6bcba10c1e41
>>> --- /dev/null
>>> +++ b/include/uapi/rdma/erdma-abi.h
>>> @@ -0,0 +1,49 @@
>>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
>>> +/*
>>> + * Copyright (c) 2020-2021, Alibaba Group.
>>> + */
>>> +
>>> +#ifndef __ERDMA_USER_H__
>>> +#define __ERDMA_USER_H__
>>> +
>>> +#include <linux/types.h>
>>> +
>>> +#define ERDMA_ABI_VERSION       1
>>
>> ERDMA_ABI_VERSION should be 2?
> 
> Why?
> 
> This field is for rdma-core and we don't have erdma provider in that
> library yet. It always starts from 1 for new drivers.
Please check this link: 
http://mail.spinics.net/lists/linux-rdma/msg63012.html

Jason mentioned in this link:

"
/*
  * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
  * bit machines require ABI version 2 which guarentees the user and
  * kernel use the same ABI.
  */
"

Zhu Yanjun
> 
> Thanks
Leon Romanovsky Dec. 24, 2021, 6:04 a.m. UTC | #6
On Fri, Dec 24, 2021 at 06:55:41AM +0800, Yanjun Zhu wrote:
> 在 2021/12/24 2:45, Leon Romanovsky 写道:
> > On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
> > > 在 2021/12/21 10:48, Cheng Xu 写道:
> > > > Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> > > > ---
> > > >    include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
> > > >    1 file changed, 49 insertions(+)
> > > >    create mode 100644 include/uapi/rdma/erdma-abi.h
> > > > 
> > > > diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
> > > > new file mode 100644
> > > > index 000000000000..6bcba10c1e41
> > > > --- /dev/null
> > > > +++ b/include/uapi/rdma/erdma-abi.h
> > > > @@ -0,0 +1,49 @@
> > > > +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
> > > > +/*
> > > > + * Copyright (c) 2020-2021, Alibaba Group.
> > > > + */
> > > > +
> > > > +#ifndef __ERDMA_USER_H__
> > > > +#define __ERDMA_USER_H__
> > > > +
> > > > +#include <linux/types.h>
> > > > +
> > > > +#define ERDMA_ABI_VERSION       1
> > > 
> > > ERDMA_ABI_VERSION should be 2?
> > 
> > Why?
> > 
> > This field is for rdma-core and we don't have erdma provider in that
> > library yet. It always starts from 1 for new drivers.
> Please check this link:
> http://mail.spinics.net/lists/linux-rdma/msg63012.html

OK, I still don't understand why.

RXE case is different, because rdma-core already had broken RXE
implementation, so this is why the version was incremented.

> 
> Jason mentioned in this link:
> 
> "
> /*
>  * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
>  * bit machines require ABI version 2 which guarentees the user and
>  * kernel use the same ABI.
>  */
> "
> 
> Zhu Yanjun
> > 
> > Thanks
>
Cheng Xu Dec. 24, 2021, 7:12 a.m. UTC | #7
On 12/24/21 6:55 AM, Yanjun Zhu wrote:
> 在 2021/12/24 2:45, Leon Romanovsky 写道:
>> On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
>>> 在 2021/12/21 10:48, Cheng Xu 写道:
>>>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>>>> ---
>>>>    include/uapi/rdma/erdma-abi.h | 49 
>>>> +++++++++++++++++++++++++++++++++++
>>>>    1 file changed, 49 insertions(+)
>>>>    create mode 100644 include/uapi/rdma/erdma-abi.h
>>>>
>>>> diff --git a/include/uapi/rdma/erdma-abi.h 
>>>> b/include/uapi/rdma/erdma-abi.h
>>>> new file mode 100644
>>>> index 000000000000..6bcba10c1e41
>>>> --- /dev/null
>>>> +++ b/include/uapi/rdma/erdma-abi.h
>>>> @@ -0,0 +1,49 @@
>>>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR 
>>>> Linux-OpenIB) */
>>>> +/*
>>>> + * Copyright (c) 2020-2021, Alibaba Group.
>>>> + */
>>>> +
>>>> +#ifndef __ERDMA_USER_H__
>>>> +#define __ERDMA_USER_H__
>>>> +
>>>> +#include <linux/types.h>
>>>> +
>>>> +#define ERDMA_ABI_VERSION       1
>>>
>>> ERDMA_ABI_VERSION should be 2?
>>
>> Why?
>>
>> This field is for rdma-core and we don't have erdma provider in that
>> library yet. It always starts from 1 for new drivers.
> Please check this link: 
> http://mail.spinics.net/lists/linux-rdma/msg63012.html
> 
> Jason mentioned in this link:
> 
> "
> /*
>   * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
>   * bit machines require ABI version 2 which guarentees the user and
>   * kernel use the same ABI.
>   */
> "
> 
> Zhu Yanjun

Even though I do not understand the reason, but as mentioned above, I 
think ERDMA_ABI_VERSION = 1 is fine, because ERDMA can only work in 
64bit machines.

Thanks,
Cheng Xu
Zhu Yanjun Dec. 24, 2021, 7:54 a.m. UTC | #8
在 2021/12/24 14:04, Leon Romanovsky 写道:
> On Fri, Dec 24, 2021 at 06:55:41AM +0800, Yanjun Zhu wrote:
>> 在 2021/12/24 2:45, Leon Romanovsky 写道:
>>> On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
>>>> 在 2021/12/21 10:48, Cheng Xu 写道:
>>>>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>>>>> ---
>>>>>     include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
>>>>>     1 file changed, 49 insertions(+)
>>>>>     create mode 100644 include/uapi/rdma/erdma-abi.h
>>>>>
>>>>> diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
>>>>> new file mode 100644
>>>>> index 000000000000..6bcba10c1e41
>>>>> --- /dev/null
>>>>> +++ b/include/uapi/rdma/erdma-abi.h
>>>>> @@ -0,0 +1,49 @@
>>>>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
>>>>> +/*
>>>>> + * Copyright (c) 2020-2021, Alibaba Group.
>>>>> + */
>>>>> +
>>>>> +#ifndef __ERDMA_USER_H__
>>>>> +#define __ERDMA_USER_H__
>>>>> +
>>>>> +#include <linux/types.h>
>>>>> +
>>>>> +#define ERDMA_ABI_VERSION       1
>>>>
>>>> ERDMA_ABI_VERSION should be 2?
>>>
>>> Why?
>>>
>>> This field is for rdma-core and we don't have erdma provider in that
>>> library yet. It always starts from 1 for new drivers.
>> Please check this link:
>> http://mail.spinics.net/lists/linux-rdma/msg63012.html
> 
> OK, I still don't understand why.


Perhaps 32 bit machines require ABI version 2 which guarentees the user 
and kernel use the same ABI.

Zhu Yanjun

> 
> RXE case is different, because rdma-core already had broken RXE
> implementation, so this is why the version was incremented.
> 
>>
>> Jason mentioned in this link:
>>
>> "
>> /*
>>   * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
>>   * bit machines require ABI version 2 which guarentees the user and
>>   * kernel use the same ABI.
>>   */
>> "
>>
>> Zhu Yanjun
>>>
>>> Thanks
>>
Zhu Yanjun Dec. 24, 2021, 8:02 a.m. UTC | #9
在 2021/12/24 15:12, Cheng Xu 写道:
>
>
> On 12/24/21 6:55 AM, Yanjun Zhu wrote:
>> 在 2021/12/24 2:45, Leon Romanovsky 写道:
>>> On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
>>>> 在 2021/12/21 10:48, Cheng Xu 写道:
>>>>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>>>>> ---
>>>>>    include/uapi/rdma/erdma-abi.h | 49 
>>>>> +++++++++++++++++++++++++++++++++++
>>>>>    1 file changed, 49 insertions(+)
>>>>>    create mode 100644 include/uapi/rdma/erdma-abi.h
>>>>>
>>>>> diff --git a/include/uapi/rdma/erdma-abi.h 
>>>>> b/include/uapi/rdma/erdma-abi.h
>>>>> new file mode 100644
>>>>> index 000000000000..6bcba10c1e41
>>>>> --- /dev/null
>>>>> +++ b/include/uapi/rdma/erdma-abi.h
>>>>> @@ -0,0 +1,49 @@
>>>>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR 
>>>>> Linux-OpenIB) */
>>>>> +/*
>>>>> + * Copyright (c) 2020-2021, Alibaba Group.
>>>>> + */
>>>>> +
>>>>> +#ifndef __ERDMA_USER_H__
>>>>> +#define __ERDMA_USER_H__
>>>>> +
>>>>> +#include <linux/types.h>
>>>>> +
>>>>> +#define ERDMA_ABI_VERSION       1
>>>>
>>>> ERDMA_ABI_VERSION should be 2?
>>>
>>> Why?
>>>
>>> This field is for rdma-core and we don't have erdma provider in that
>>> library yet. It always starts from 1 for new drivers.
>> Please check this link: 
>> http://mail.spinics.net/lists/linux-rdma/msg63012.html
>>
>> Jason mentioned in this link:
>>
>> "
>> /*
>>   * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
>>   * bit machines require ABI version 2 which guarentees the user and
>>   * kernel use the same ABI.
>>   */
>> "
>>
>> Zhu Yanjun
>
> Even though I do not understand the reason, but as mentioned above, I 
> think ERDMA_ABI_VERSION = 1 is fine, because ERDMA can only work in 
> 64bit machines.


Sure. If ERDMA can only work in 64bit machines, ERDMA_ABI_VERSION = 1 is 
fine

Zhu Yanjun


>
> Thanks,
> Cheng Xu
>
>
>
Leon Romanovsky Dec. 24, 2021, 6:11 p.m. UTC | #10
On Fri, Dec 24, 2021 at 03:54:18PM +0800, Yanjun Zhu wrote:
> 在 2021/12/24 14:04, Leon Romanovsky 写道:
> > On Fri, Dec 24, 2021 at 06:55:41AM +0800, Yanjun Zhu wrote:
> > > 在 2021/12/24 2:45, Leon Romanovsky 写道:
> > > > On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
> > > > > 在 2021/12/21 10:48, Cheng Xu 写道:
> > > > > > Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> > > > > > ---
> > > > > >     include/uapi/rdma/erdma-abi.h | 49 +++++++++++++++++++++++++++++++++++
> > > > > >     1 file changed, 49 insertions(+)
> > > > > >     create mode 100644 include/uapi/rdma/erdma-abi.h
> > > > > > 
> > > > > > diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
> > > > > > new file mode 100644
> > > > > > index 000000000000..6bcba10c1e41
> > > > > > --- /dev/null
> > > > > > +++ b/include/uapi/rdma/erdma-abi.h
> > > > > > @@ -0,0 +1,49 @@
> > > > > > +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
> > > > > > +/*
> > > > > > + * Copyright (c) 2020-2021, Alibaba Group.
> > > > > > + */
> > > > > > +
> > > > > > +#ifndef __ERDMA_USER_H__
> > > > > > +#define __ERDMA_USER_H__
> > > > > > +
> > > > > > +#include <linux/types.h>
> > > > > > +
> > > > > > +#define ERDMA_ABI_VERSION       1
> > > > > 
> > > > > ERDMA_ABI_VERSION should be 2?
> > > > 
> > > > Why?
> > > > 
> > > > This field is for rdma-core and we don't have erdma provider in that
> > > > library yet. It always starts from 1 for new drivers.
> > > Please check this link:
> > > http://mail.spinics.net/lists/linux-rdma/msg63012.html
> > 
> > OK, I still don't understand why.
> 
> 
> Perhaps 32 bit machines require ABI version 2 which guarentees the user and
> kernel use the same ABI.

Nope, it is not.

> 
> Zhu Yanjun
> 
> > 
> > RXE case is different, because rdma-core already had broken RXE
> > implementation, so this is why the version was incremented.
> > 
> > > 
> > > Jason mentioned in this link:
> > > 
> > > "
> > > /*
> > >   * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
> > >   * bit machines require ABI version 2 which guarentees the user and
> > >   * kernel use the same ABI.
> > >   */
> > > "
> > > 
> > > Zhu Yanjun
> > > > 
> > > > Thanks
> > > 
>
Leon Romanovsky Dec. 24, 2021, 6:19 p.m. UTC | #11
On Fri, Dec 24, 2021 at 03:12:35PM +0800, Cheng Xu wrote:
> 
> 
> On 12/24/21 6:55 AM, Yanjun Zhu wrote:
> > 在 2021/12/24 2:45, Leon Romanovsky 写道:
> > > On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
> > > > 在 2021/12/21 10:48, Cheng Xu 写道:
> > > > > Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
> > > > > ---
> > > > >    include/uapi/rdma/erdma-abi.h | 49
> > > > > +++++++++++++++++++++++++++++++++++
> > > > >    1 file changed, 49 insertions(+)
> > > > >    create mode 100644 include/uapi/rdma/erdma-abi.h
> > > > > 
> > > > > diff --git a/include/uapi/rdma/erdma-abi.h
> > > > > b/include/uapi/rdma/erdma-abi.h
> > > > > new file mode 100644
> > > > > index 000000000000..6bcba10c1e41
> > > > > --- /dev/null
> > > > > +++ b/include/uapi/rdma/erdma-abi.h
> > > > > @@ -0,0 +1,49 @@
> > > > > +/* SPDX-License-Identifier: ((GPL-2.0 WITH
> > > > > Linux-syscall-note) OR Linux-OpenIB) */
> > > > > +/*
> > > > > + * Copyright (c) 2020-2021, Alibaba Group.
> > > > > + */
> > > > > +
> > > > > +#ifndef __ERDMA_USER_H__
> > > > > +#define __ERDMA_USER_H__
> > > > > +
> > > > > +#include <linux/types.h>
> > > > > +
> > > > > +#define ERDMA_ABI_VERSION       1
> > > > 
> > > > ERDMA_ABI_VERSION should be 2?
> > > 
> > > Why?
> > > 
> > > This field is for rdma-core and we don't have erdma provider in that
> > > library yet. It always starts from 1 for new drivers.
> > Please check this link:
> > http://mail.spinics.net/lists/linux-rdma/msg63012.html
> > 
> > Jason mentioned in this link:
> > 
> > "
> > /*
> >   * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
> >   * bit machines require ABI version 2 which guarentees the user and
> >   * kernel use the same ABI.
> >   */
> > "
> > 
> > Zhu Yanjun
> 
> Even though I do not understand the reason, but as mentioned above, I think
> ERDMA_ABI_VERSION = 1 is fine, because ERDMA can only work in 64bit
> machines.

Jason's comment came after we discovered that many of our API structures had
problematic layout and weren't aligned to 64bits. This caused to issues when
the 32bits software tried to use 64bit kernel.

So we didn't have many choices but bump ABI versions for broken drivers
and RXE was one of them.

You are proposing new driver, it should start from 1.

Thanks
Zhu Yanjun Dec. 25, 2021, 12:03 a.m. UTC | #12
在 2021/12/25 2:19, Leon Romanovsky 写道:
> On Fri, Dec 24, 2021 at 03:12:35PM +0800, Cheng Xu wrote:
>>
>> On 12/24/21 6:55 AM, Yanjun Zhu wrote:
>>> 在 2021/12/24 2:45, Leon Romanovsky 写道:
>>>> On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
>>>>> 在 2021/12/21 10:48, Cheng Xu 写道:
>>>>>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>>>>>> ---
>>>>>>     include/uapi/rdma/erdma-abi.h | 49
>>>>>> +++++++++++++++++++++++++++++++++++
>>>>>>     1 file changed, 49 insertions(+)
>>>>>>     create mode 100644 include/uapi/rdma/erdma-abi.h
>>>>>>
>>>>>> diff --git a/include/uapi/rdma/erdma-abi.h
>>>>>> b/include/uapi/rdma/erdma-abi.h
>>>>>> new file mode 100644
>>>>>> index 000000000000..6bcba10c1e41
>>>>>> --- /dev/null
>>>>>> +++ b/include/uapi/rdma/erdma-abi.h
>>>>>> @@ -0,0 +1,49 @@
>>>>>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH
>>>>>> Linux-syscall-note) OR Linux-OpenIB) */
>>>>>> +/*
>>>>>> + * Copyright (c) 2020-2021, Alibaba Group.
>>>>>> + */
>>>>>> +
>>>>>> +#ifndef __ERDMA_USER_H__
>>>>>> +#define __ERDMA_USER_H__
>>>>>> +
>>>>>> +#include <linux/types.h>
>>>>>> +
>>>>>> +#define ERDMA_ABI_VERSION       1
>>>>> ERDMA_ABI_VERSION should be 2?
>>>> Why?
>>>>
>>>> This field is for rdma-core and we don't have erdma provider in that
>>>> library yet. It always starts from 1 for new drivers.
>>> Please check this link:
>>> http://mail.spinics.net/lists/linux-rdma/msg63012.html
>>>
>>> Jason mentioned in this link:
>>>
>>> "
>>> /*
>>>    * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
>>>    * bit machines require ABI version 2 which guarentees the user and
>>>    * kernel use the same ABI.
>>>    */
>>> "
>>>
>>> Zhu Yanjun
>> Even though I do not understand the reason, but as mentioned above, I think
>> ERDMA_ABI_VERSION = 1 is fine, because ERDMA can only work in 64bit
>> machines.
> Jason's comment came after we discovered that many of our API structures had
> problematic layout and weren't aligned to 64bits. This caused to issues when
> the 32bits software tried to use 64bit kernel.

Got it. Thanks

Zhu Yanjun

>
> So we didn't have many choices but bump ABI versions for broken drivers
> and RXE was one of them.
>
> You are proposing new driver, it should start from 1.
>
> Thanks
Cheng Xu Dec. 25, 2021, 3:36 a.m. UTC | #13
On 12/25/21 2:19 AM, Leon Romanovsky wrote:
> On Fri, Dec 24, 2021 at 03:12:35PM +0800, Cheng Xu wrote:
>>
>>
>> On 12/24/21 6:55 AM, Yanjun Zhu wrote:
>>> 在 2021/12/24 2:45, Leon Romanovsky 写道:
>>>> On Thu, Dec 23, 2021 at 11:46:03PM +0800, Yanjun Zhu wrote:
>>>>> 在 2021/12/21 10:48, Cheng Xu 写道:
>>>>>> Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
>>>>>> ---
>>>>>>     include/uapi/rdma/erdma-abi.h | 49
>>>>>> +++++++++++++++++++++++++++++++++++
>>>>>>     1 file changed, 49 insertions(+)
>>>>>>     create mode 100644 include/uapi/rdma/erdma-abi.h
>>>>>>
>>>>>> diff --git a/include/uapi/rdma/erdma-abi.h
>>>>>> b/include/uapi/rdma/erdma-abi.h
>>>>>> new file mode 100644
>>>>>> index 000000000000..6bcba10c1e41
>>>>>> --- /dev/null
>>>>>> +++ b/include/uapi/rdma/erdma-abi.h
>>>>>> @@ -0,0 +1,49 @@
>>>>>> +/* SPDX-License-Identifier: ((GPL-2.0 WITH
>>>>>> Linux-syscall-note) OR Linux-OpenIB) */
>>>>>> +/*
>>>>>> + * Copyright (c) 2020-2021, Alibaba Group.
>>>>>> + */
>>>>>> +
>>>>>> +#ifndef __ERDMA_USER_H__
>>>>>> +#define __ERDMA_USER_H__
>>>>>> +
>>>>>> +#include <linux/types.h>
>>>>>> +
>>>>>> +#define ERDMA_ABI_VERSION       1
>>>>>
>>>>> ERDMA_ABI_VERSION should be 2?
>>>>
>>>> Why?
>>>>
>>>> This field is for rdma-core and we don't have erdma provider in that
>>>> library yet. It always starts from 1 for new drivers.
>>> Please check this link:
>>> http://mail.spinics.net/lists/linux-rdma/msg63012.html
>>>
>>> Jason mentioned in this link:
>>>
>>> "
>>> /*
>>>    * For 64 bit machines ABI version 1 and 2 are the same. Otherwise 32
>>>    * bit machines require ABI version 2 which guarentees the user and
>>>    * kernel use the same ABI.
>>>    */
>>> "
>>>
>>> Zhu Yanjun
>>
>> Even though I do not understand the reason, but as mentioned above, I think
>> ERDMA_ABI_VERSION = 1 is fine, because ERDMA can only work in 64bit
>> machines.
> 
> Jason's comment came after we discovered that many of our API structures had
> problematic layout and weren't aligned to 64bits. This caused to issues when
> the 32bits software tried to use 64bit kernel.
> 
> So we didn't have many choices but bump ABI versions for broken drivers
> and RXE was one of them.
> 
> You are proposing new driver, it should start from 1.

Thanks for your explanation.

Thanks,
Cheng Xu

> Thanks
diff mbox series

Patch

diff --git a/include/uapi/rdma/erdma-abi.h b/include/uapi/rdma/erdma-abi.h
new file mode 100644
index 000000000000..6bcba10c1e41
--- /dev/null
+++ b/include/uapi/rdma/erdma-abi.h
@@ -0,0 +1,49 @@ 
+/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
+/*
+ * Copyright (c) 2020-2021, Alibaba Group.
+ */
+
+#ifndef __ERDMA_USER_H__
+#define __ERDMA_USER_H__
+
+#include <linux/types.h>
+
+#define ERDMA_ABI_VERSION       1
+
+struct erdma_ureq_create_cq {
+	u64 db_record_va;
+	u64 qbuf_va;
+	u32 qbuf_len;
+	u32 rsvd0;
+};
+
+struct erdma_uresp_create_cq {
+	u32 cq_id;
+	u32 num_cqe;
+};
+
+struct erdma_ureq_create_qp {
+	u64 db_record_va;
+	u64 qbuf_va;
+	u32 qbuf_len;
+	u32 rsvd0;
+};
+
+struct erdma_uresp_create_qp {
+	u32 qp_id;
+	u32 num_sqe;
+	u32 num_rqe;
+	u32 rq_offset;
+};
+
+struct erdma_uresp_alloc_ctx {
+	u32 dev_id;
+	u32 pad;
+	u32 sdb_type;
+	u32 sdb_offset;
+	u64 sdb;
+	u64 rdb;
+	u64 cdb;
+};
+
+#endif