Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RDMA support for Intel IPU E2000 (GEN 3) #1486

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
17 changes: 16 additions & 1 deletion kernel-headers/rdma/irdma-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ enum irdma_memreg_type {
IRDMA_MEMREG_TYPE_MEM = 0,
IRDMA_MEMREG_TYPE_QP = 1,
IRDMA_MEMREG_TYPE_CQ = 2,
IRDMA_MEMREG_TYPE_SRQ = 3,
};

enum {
IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0,
IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1,
IRDMA_ALLOC_UCTX_MAX_HW_SRQ_QUANTA = 1 << 2,
IRDMA_SUPPORT_WQE_FORMAT_V2 = 1 << 3,
IRDMA_SUPPORT_MAX_HW_PUSH_LEN = 1 << 4,
};

struct irdma_alloc_ucontext_req {
Expand Down Expand Up @@ -54,7 +58,8 @@ struct irdma_alloc_ucontext_resp {
__u8 rsvd2;
__aligned_u64 comp_mask;
__u16 min_hw_wq_size;
__u8 rsvd3[6];
__u32 max_hw_srq_quanta;
__u16 max_hw_push_len;
};

struct irdma_alloc_pd_resp {
Expand All @@ -71,6 +76,16 @@ struct irdma_create_cq_req {
__aligned_u64 user_shadow_area;
};

struct irdma_create_srq_req {
__aligned_u64 user_srq_buf;
__aligned_u64 user_shadow_area;
};

struct irdma_create_srq_resp {
__u32 srq_id;
__u32 srq_size;
};

struct irdma_create_qp_req {
__aligned_u64 user_wqe_bufs;
__aligned_u64 user_compl_ctx;
Expand Down
2 changes: 2 additions & 0 deletions providers/irdma/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ DECLARE_DRV_CMD(irdma_urereg_mr, IB_USER_VERBS_CMD_REREG_MR,
irdma_mem_reg_req, empty);
DECLARE_DRV_CMD(irdma_ucreate_ah, IB_USER_VERBS_CMD_CREATE_AH,
empty, irdma_create_ah_resp);
DECLARE_DRV_CMD(irdma_ucreate_srq, IB_USER_VERBS_CMD_CREATE_SRQ,
irdma_create_srq_req, irdma_create_srq_resp);

#endif /* PROVIDER_IRDMA_ABI_H */
16 changes: 12 additions & 4 deletions providers/irdma/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@
#define IRDMA_QP_WQE_MIN_SIZE 32
#define IRDMA_QP_WQE_MAX_SIZE 256
#define IRDMA_QP_WQE_MIN_QUANTA 1
#define IRDMA_DEFAULT_MAX_PUSH_LEN 8192
#define IRDMA_MAX_RQ_WQE_SHIFT_GEN1 2
#define IRDMA_MAX_RQ_WQE_SHIFT_GEN2 3

#define IRDMA_SQ_RSVD 258
#define IRDMA_RQ_RSVD 1

#define IRDMA_FEATURE_RTS_AE 1ULL
#define IRDMA_FEATURE_CQ_RESIZE 2ULL
#define IRDMA_FEATURE_RTS_AE BIT_ULL(0)
#define IRDMA_FEATURE_CQ_RESIZE BIT_ULL(1)
#define IRDMA_FEATURE_64_BYTE_CQE BIT_ULL(5)
#define IRDMA_FEATURE_ATOMIC_OPS BIT_ULL(6)
#define IRDMA_FEATURE_SRQ BIT_ULL(7)
#define IRDMA_FEATURE_CQE_TIMESTAMPING BIT_ULL(8)
#define IRDMAQP_OP_RDMA_WRITE 0x00
#define IRDMAQP_OP_RDMA_READ 0x01
#define IRDMAQP_OP_RDMA_SEND 0x03
Expand All @@ -38,6 +43,8 @@
#define IRDMAQP_OP_LOCAL_INVALIDATE 0x0a
#define IRDMAQP_OP_RDMA_READ_LOC_INV 0x0b
#define IRDMAQP_OP_NOP 0x0c
#define IRDMAQP_OP_ATOMIC_FETCH_ADD 0x0f
#define IRDMAQP_OP_ATOMIC_COMPARE_SWAP_ADD 0x11

#define IRDMA_CQPHC_QPCTX GENMASK_ULL(63, 0)
#define IRDMA_QP_DBSA_HW_SQ_TAIL GENMASK_ULL(14, 0)
Expand All @@ -58,6 +65,7 @@
#define IRDMA_CQ_ERROR BIT_ULL(55)
#define IRDMA_CQ_SQ BIT_ULL(62)

#define IRDMA_CQ_SRQ BIT_ULL(52)
#define IRDMA_CQ_VALID BIT_ULL(63)
#define IRDMA_CQ_IMMVALID BIT_ULL(62)
#define IRDMA_CQ_UDSMACVALID BIT_ULL(61)
Expand All @@ -70,7 +78,7 @@
#define IRDMA_CQ_IMMDATALOW32 GENMASK_ULL(31, 0)
#define IRDMA_CQ_IMMDATAUP32 GENMASK_ULL(63, 32)
#define IRDMACQ_PAYLDLEN GENMASK_ULL(31, 0)
#define IRDMACQ_TCPSEQNUMRTT GENMASK_ULL(63, 32)
#define IRDMACQ_TCPSQN_ROCEPSN_RTT_TS GENMASK_ULL(63, 32)
#define IRDMACQ_INVSTAG GENMASK_ULL(31, 0)
#define IRDMACQ_QPID GENMASK_ULL(55, 32)

Expand Down Expand Up @@ -129,7 +137,7 @@
#define IRDMAQPSQ_MWSTAG GENMASK_ULL(31, 0)

#define IRDMAQPSQ_BASEVA_TO_FBO IRDMA_CQPHC_QPCTX

#define IRDMAQPSQ_REMOTE_ATOMICS_EN BIT_ULL(55)
#define IRDMAQPSQ_LOCSTAG GENMASK_ULL(31, 0)

/* iwarp QP RQ WQE common fields */
Expand Down
9 changes: 6 additions & 3 deletions providers/irdma/irdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
#define IRDMA_WQEALLOC_WQE_DESC_INDEX GENMASK(31, 20)

enum irdma_vers {
IRDMA_GEN_RSVD,
IRDMA_GEN_1,
IRDMA_GEN_2,
IRDMA_GEN_RSVD = 0,
IRDMA_GEN_1 = 1,
IRDMA_GEN_2 = 2,
IRDMA_GEN_3 = 3,
};

struct irdma_uk_attrs {
Expand All @@ -20,6 +21,8 @@ struct irdma_uk_attrs {
__u32 max_hw_wq_quanta;
__u32 min_hw_cq_size;
__u32 max_hw_cq_size;
__u32 max_hw_srq_quanta;
__u16 max_hw_push_len;
__u16 max_hw_sq_chunk;
__u16 min_hw_wq_size;
__u8 hw_rev;
Expand Down
1 change: 1 addition & 0 deletions providers/irdma/osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <inttypes.h>
#include <pthread.h>
#include <endian.h>
#include <util/mmio.h>
#include <infiniband/verbs.h>

static inline void db_wr32(__u32 val, __u32 *wqe_word)
Expand Down
Loading