Message ID | 20210406211728.1362-3-tatyana.e.nikolova@intel.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Add irdma user space provider for Intel Ethernet RDMA | expand |
On Tue, Apr 06, 2021 at 04:17:25PM -0500, Tatyana Nikolova wrote: > Add Makefile and ABI definitions for irdma provider. > Add utility macros to rdma-core util.h which are used by irdma. > > Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> > providers/irdma/CMakeLists.txt | 8 ++++++++ > providers/irdma/abi.h | 39 +++++++++++++++++++++++++++++++++++++++ > util/util.h | 8 ++++++-- > 3 files changed, 53 insertions(+), 2 deletions(-) > create mode 100644 providers/irdma/CMakeLists.txt > create mode 100644 providers/irdma/abi.h > > diff --git a/providers/irdma/CMakeLists.txt b/providers/irdma/CMakeLists.txt > new file mode 100644 > index 0000000..1542482 > +++ b/providers/irdma/CMakeLists.txt > @@ -0,0 +1,8 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB) > +# Copyright (c) 2019, Intel Corporation. > + > +rdma_provider(irdma > + uk.c > + umain.c > + uverbs.c > +) > diff --git a/providers/irdma/abi.h b/providers/irdma/abi.h > new file mode 100644 > index 0000000..bacce40 > +++ b/providers/irdma/abi.h > @@ -0,0 +1,39 @@ > +/* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */ > +/* Copyright (C) 2019 - 2020 Intel Corporation */ > +#ifndef PROVIDER_IRDMA_ABI_H > +#define PROVIDER_IRDMA_ABI_H > + > +#include "irdma.h" > +#include <infiniband/kern-abi.h> > +#include <rdma/irdma-abi.h> > +#include <kernel-abi/irdma-abi.h> > + > +#define IRDMA_MIN_ABI_VERSION 0 > +#define IRDMA_MAX_ABI_VERSION 5 > + > +DECLARE_DRV_CMD(irdma_ualloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, > + empty, irdma_alloc_pd_resp); > +DECLARE_DRV_CMD(irdma_ucreate_cq, IB_USER_VERBS_CMD_CREATE_CQ, > + irdma_create_cq_req, irdma_create_cq_resp); > +DECLARE_DRV_CMD(irdma_ucreate_cq_ex, IB_USER_VERBS_EX_CMD_CREATE_CQ, > + irdma_create_cq_req, irdma_create_cq_resp); > +DECLARE_DRV_CMD(irdma_uresize_cq, IB_USER_VERBS_CMD_RESIZE_CQ, > + irdma_resize_cq_req, empty); > +DECLARE_DRV_CMD(irdma_ucreate_qp, IB_USER_VERBS_CMD_CREATE_QP, > + irdma_create_qp_req, irdma_create_qp_resp); > +DECLARE_DRV_CMD(irdma_umodify_qp, IB_USER_VERBS_EX_CMD_MODIFY_QP, > + empty, irdma_modify_qp_resp); > +DECLARE_DRV_CMD(irdma_get_context, IB_USER_VERBS_CMD_GET_CONTEXT, > + irdma_alloc_ucontext_req, irdma_alloc_ucontext_resp); > +DECLARE_DRV_CMD(irdma_ureg_mr, IB_USER_VERBS_CMD_REG_MR, > + irdma_mem_reg_req, empty); > +DECLARE_DRV_CMD(irdma_ucreate_ah, IB_USER_VERBS_CMD_CREATE_AH, > + empty, irdma_create_ah_resp); > + > +struct irdma_modify_qp_cmd { > + struct ibv_modify_qp_ex ibv_cmd; > + __u8 sq_flush; > + __u8 rq_flush; > + __u8 rsvd[6]; > +}; Huh? What is this? Why is it here? Jason
diff --git a/providers/irdma/CMakeLists.txt b/providers/irdma/CMakeLists.txt new file mode 100644 index 0000000..1542482 --- /dev/null +++ b/providers/irdma/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB) +# Copyright (c) 2019, Intel Corporation. + +rdma_provider(irdma + uk.c + umain.c + uverbs.c +) diff --git a/providers/irdma/abi.h b/providers/irdma/abi.h new file mode 100644 index 0000000..bacce40 --- /dev/null +++ b/providers/irdma/abi.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */ +/* Copyright (C) 2019 - 2020 Intel Corporation */ +#ifndef PROVIDER_IRDMA_ABI_H +#define PROVIDER_IRDMA_ABI_H + +#include "irdma.h" +#include <infiniband/kern-abi.h> +#include <rdma/irdma-abi.h> +#include <kernel-abi/irdma-abi.h> + +#define IRDMA_MIN_ABI_VERSION 0 +#define IRDMA_MAX_ABI_VERSION 5 + +DECLARE_DRV_CMD(irdma_ualloc_pd, IB_USER_VERBS_CMD_ALLOC_PD, + empty, irdma_alloc_pd_resp); +DECLARE_DRV_CMD(irdma_ucreate_cq, IB_USER_VERBS_CMD_CREATE_CQ, + irdma_create_cq_req, irdma_create_cq_resp); +DECLARE_DRV_CMD(irdma_ucreate_cq_ex, IB_USER_VERBS_EX_CMD_CREATE_CQ, + irdma_create_cq_req, irdma_create_cq_resp); +DECLARE_DRV_CMD(irdma_uresize_cq, IB_USER_VERBS_CMD_RESIZE_CQ, + irdma_resize_cq_req, empty); +DECLARE_DRV_CMD(irdma_ucreate_qp, IB_USER_VERBS_CMD_CREATE_QP, + irdma_create_qp_req, irdma_create_qp_resp); +DECLARE_DRV_CMD(irdma_umodify_qp, IB_USER_VERBS_EX_CMD_MODIFY_QP, + empty, irdma_modify_qp_resp); +DECLARE_DRV_CMD(irdma_get_context, IB_USER_VERBS_CMD_GET_CONTEXT, + irdma_alloc_ucontext_req, irdma_alloc_ucontext_resp); +DECLARE_DRV_CMD(irdma_ureg_mr, IB_USER_VERBS_CMD_REG_MR, + irdma_mem_reg_req, empty); +DECLARE_DRV_CMD(irdma_ucreate_ah, IB_USER_VERBS_CMD_CREATE_AH, + empty, irdma_create_ah_resp); + +struct irdma_modify_qp_cmd { + struct ibv_modify_qp_ex ibv_cmd; + __u8 sq_flush; + __u8 rq_flush; + __u8 rsvd[6]; +}; +#endif /* PROVIDER_IRDMA_ABI_H */ diff --git a/util/util.h b/util/util.h index 6db46b1..2c05631 100644 --- a/util/util.h +++ b/util/util.h @@ -26,12 +26,16 @@ static inline bool __good_snprintf(size_t len, int rc) #define offsetofend(_type, _member) \ (offsetof(_type, _member) + sizeof(((_type *)0)->_member)) -#define BITS_PER_LONG (8 * sizeof(long)) +#define BITS_PER_LONG (8 * sizeof(long)) +#define BITS_PER_LONG_LONG (8 * sizeof(long long)) #define GENMASK(h, l) \ (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) +#define GENMASK_ULL(h, l) \ + (((~0ULL) << (l)) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) -#define BIT(nr) (1UL << (nr)) +#define BIT(nr) (1UL << (nr)) +#define BIT_ULL(nr) (1ULL << (nr)) #define __bf_shf(x) (__builtin_ffsll(x) - 1)
Add Makefile and ABI definitions for irdma provider. Add utility macros to rdma-core util.h which are used by irdma. Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> --- providers/irdma/CMakeLists.txt | 8 ++++++++ providers/irdma/abi.h | 39 +++++++++++++++++++++++++++++++++++++++ util/util.h | 8 ++++++-- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 providers/irdma/CMakeLists.txt create mode 100644 providers/irdma/abi.h