From f4cdaacead2e3b87c14938c172b925ffd282f2c9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 06 2020 14:24:26 +0000 Subject: import rdma-core-22.4-4.el7_8 --- diff --git a/SOURCES/0001-libibverbs-Fix-ABI_placeholder1-and-ABI_placeholder2.patch b/SOURCES/0001-libibverbs-Fix-ABI_placeholder1-and-ABI_placeholder2.patch new file mode 100644 index 0000000..c8377f7 --- /dev/null +++ b/SOURCES/0001-libibverbs-Fix-ABI_placeholder1-and-ABI_placeholder2.patch @@ -0,0 +1,80 @@ +From af898ec56092e273faa3abc7fe6d02c506e2f441 Mon Sep 17 00:00:00 2001 +From: Honggang Li +Date: Thu, 4 Jun 2020 14:33:38 +0800 +Subject: [PATCH] libibverbs: Fix ABI_placeholder1 and ABI_placeholder2 + assignment + +[ Upstream commit 88789b7ba618d55491026c74a9a31699805e5934 ] + +The assignment of ABI_placeholder1 and ABI_placeholder2 must be +after the provider populated context_ex->ibv_create_flow and +context_ex->ibv_destroy_flow. + +Applications, which compiled against old libibverbs released between +commit 501b53b30752 and 1111cf9895bb, will fail if they are linked +with libibverbs released after 1111cf9895bb and call ibv_create_flow. + +[1] 501b53b30752 ("Fix create/destroy flow API") + +Fixes: 1111cf9895bb ("verbs: Always allocate a verbs_context") +Signed-off-by: Honggang Li +Signed-off-by: Nicolas Morey-Chaisemartin +--- + libibverbs/device.c | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +diff --git a/libibverbs/device.c b/libibverbs/device.c +index d71051343b0b..04fc087d431d 100644 +--- a/libibverbs/device.c ++++ b/libibverbs/device.c +@@ -240,23 +240,6 @@ int verbs_init_context(struct verbs_context *context_ex, + context_ex->context.abi_compat = __VERBS_ABI_IS_EXTENDED; + context_ex->sz = sizeof(*context_ex); + +- /* +- * In order to maintain backward/forward binary compatibility +- * with apps compiled against libibverbs-1.1.8 that use the +- * flow steering addition, we need to set the two +- * ABI_placeholder entries to match the driver set flow +- * entries. This is because apps compiled against +- * libibverbs-1.1.8 use an inline ibv_create_flow and +- * ibv_destroy_flow function that looks in the placeholder +- * spots for the proper entry points. For apps compiled +- * against libibverbs-1.1.9 and later, the inline functions +- * will be looking in the right place. +- */ +- context_ex->ABI_placeholder1 = +- (void (*)(void))context_ex->ibv_create_flow; +- context_ex->ABI_placeholder2 = +- (void (*)(void))context_ex->ibv_destroy_flow; +- + context_ex->priv = calloc(1, sizeof(*context_ex->priv)); + if (!context_ex->priv) { + errno = ENOMEM; +@@ -314,6 +297,23 @@ static void set_lib_ops(struct verbs_context *vctx) + #undef ibv_query_port + vctx->context.ops._compat_query_port = ibv_query_port; + vctx->query_port = __lib_query_port; ++ ++ /* ++ * In order to maintain backward/forward binary compatibility ++ * with apps compiled against libibverbs-1.1.8 that use the ++ * flow steering addition, we need to set the two ++ * ABI_placeholder entries to match the driver set flow ++ * entries. This is because apps compiled against ++ * libibverbs-1.1.8 use an inline ibv_create_flow and ++ * ibv_destroy_flow function that looks in the placeholder ++ * spots for the proper entry points. For apps compiled ++ * against libibverbs-1.1.9 and later, the inline functions ++ * will be looking in the right place. ++ */ ++ vctx->ABI_placeholder1 = ++ (void (*)(void))vctx->ibv_create_flow; ++ vctx->ABI_placeholder2 = ++ (void (*)(void))vctx->ibv_destroy_flow; + } + + struct ibv_context *verbs_open_device(struct ibv_device *device, void *private_data) +-- +2.25.4 + diff --git a/SOURCES/0101-Update-kernel-headers.patch b/SOURCES/0101-Update-kernel-headers.patch new file mode 100644 index 0000000..9ac096b --- /dev/null +++ b/SOURCES/0101-Update-kernel-headers.patch @@ -0,0 +1,211 @@ +From 8779ea3cf3f1d80a29951b217f8c6a454f0a2c5a Mon Sep 17 00:00:00 2001 +From: Yishai Hadas +Date: Sun, 10 Feb 2019 10:43:12 +0200 +Subject: [PATCH rdma-core 1/2] Update kernel headers + +To commit 2c1619edef61 ("IB/cma: Define option to set ack timeout and +pack tos_set") + +Signed-off-by: Yishai Hadas +--- + kernel-headers/rdma/bnxt_re-abi.h | 11 ++++++ + kernel-headers/rdma/ib_user_verbs.h | 2 ++ + kernel-headers/rdma/rdma_netlink.h | 54 +++++++++++++++++++++-------- + kernel-headers/rdma/rdma_user_cm.h | 4 +++ + kernel-headers/rdma/rdma_user_rxe.h | 3 +- + 5 files changed, 58 insertions(+), 16 deletions(-) + +diff --git a/kernel-headers/rdma/bnxt_re-abi.h b/kernel-headers/rdma/bnxt_re-abi.h +index a7a6111e..dc52e3cf 100644 +--- a/kernel-headers/rdma/bnxt_re-abi.h ++++ b/kernel-headers/rdma/bnxt_re-abi.h +@@ -44,6 +44,14 @@ + + #define BNXT_RE_ABI_VERSION 1 + ++#define BNXT_RE_CHIP_ID0_CHIP_NUM_SFT 0x00 ++#define BNXT_RE_CHIP_ID0_CHIP_REV_SFT 0x10 ++#define BNXT_RE_CHIP_ID0_CHIP_MET_SFT 0x18 ++ ++enum { ++ BNXT_RE_UCNTX_CMASK_HAVE_CCTX = 0x1ULL ++}; ++ + struct bnxt_re_uctx_resp { + __u32 dev_id; + __u32 max_qp; +@@ -51,6 +59,9 @@ struct bnxt_re_uctx_resp { + __u32 cqe_sz; + __u32 max_cqd; + __u32 rsvd; ++ __aligned_u64 comp_mask; ++ __u32 chip_id0; ++ __u32 chip_id1; + }; + + /* +diff --git a/kernel-headers/rdma/ib_user_verbs.h b/kernel-headers/rdma/ib_user_verbs.h +index 480d9a60..0474c740 100644 +--- a/kernel-headers/rdma/ib_user_verbs.h ++++ b/kernel-headers/rdma/ib_user_verbs.h +@@ -270,6 +270,8 @@ struct ib_uverbs_ex_query_device_resp { + struct ib_uverbs_tm_caps tm_caps; + struct ib_uverbs_cq_moderation_caps cq_moderation_caps; + __aligned_u64 max_dm_size; ++ __u32 xrc_odp_caps; ++ __u32 reserved; + }; + + struct ib_uverbs_query_port { +diff --git a/kernel-headers/rdma/rdma_netlink.h b/kernel-headers/rdma/rdma_netlink.h +index 2e18b77a..3a9e681e 100644 +--- a/kernel-headers/rdma/rdma_netlink.h ++++ b/kernel-headers/rdma/rdma_netlink.h +@@ -5,8 +5,7 @@ + #include + + enum { +- RDMA_NL_RDMA_CM = 1, +- RDMA_NL_IWCM, ++ RDMA_NL_IWCM = 2, + RDMA_NL_RSVD, + RDMA_NL_LS, /* RDMA Local Services */ + RDMA_NL_NLDEV, /* RDMA device interface */ +@@ -14,8 +13,7 @@ enum { + }; + + enum { +- RDMA_NL_GROUP_CM = 1, +- RDMA_NL_GROUP_IWPM, ++ RDMA_NL_GROUP_IWPM = 2, + RDMA_NL_GROUP_LS, + RDMA_NL_NUM_GROUPS + }; +@@ -24,15 +22,17 @@ enum { + #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) + #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) + +-enum { +- RDMA_NL_RDMA_CM_ID_STATS = 0, +- RDMA_NL_RDMA_CM_NUM_OPS +-}; ++/* The minimum version that the iwpm kernel supports */ ++#define IWPM_UABI_VERSION_MIN 3 + ++/* The latest version that the iwpm kernel supports */ ++#define IWPM_UABI_VERSION 4 ++ ++/* iwarp port mapper message flags */ + enum { +- RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1, +- RDMA_NL_RDMA_CM_ATTR_DST_ADDR, +- RDMA_NL_RDMA_CM_NUM_ATTR, ++ ++ /* Do not map the port for this IWPM request */ ++ IWPM_FLAGS_NO_PORT_MAP = (1 << 0), + }; + + /* iwarp port mapper op-codes */ +@@ -45,6 +45,7 @@ enum { + RDMA_NL_IWPM_HANDLE_ERR, + RDMA_NL_IWPM_MAPINFO, + RDMA_NL_IWPM_MAPINFO_NUM, ++ RDMA_NL_IWPM_HELLO, + RDMA_NL_IWPM_NUM_OPS + }; + +@@ -83,20 +84,38 @@ enum { + IWPM_NLA_MANAGE_MAPPING_UNSPEC = 0, + IWPM_NLA_MANAGE_MAPPING_SEQ, + IWPM_NLA_MANAGE_ADDR, +- IWPM_NLA_MANAGE_MAPPED_LOC_ADDR, ++ IWPM_NLA_MANAGE_FLAGS, ++ IWPM_NLA_MANAGE_MAPPING_MAX ++}; ++ ++enum { ++ IWPM_NLA_RMANAGE_MAPPING_UNSPEC = 0, ++ IWPM_NLA_RMANAGE_MAPPING_SEQ, ++ IWPM_NLA_RMANAGE_ADDR, ++ IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR, ++ /* The following maintains bisectability of rdma-core */ ++ IWPM_NLA_MANAGE_MAPPED_LOC_ADDR = IWPM_NLA_RMANAGE_MAPPED_LOC_ADDR, + IWPM_NLA_RMANAGE_MAPPING_ERR, + IWPM_NLA_RMANAGE_MAPPING_MAX + }; + +-#define IWPM_NLA_MANAGE_MAPPING_MAX 3 +-#define IWPM_NLA_QUERY_MAPPING_MAX 4 + #define IWPM_NLA_MAPINFO_SEND_MAX 3 ++#define IWPM_NLA_REMOVE_MAPPING_MAX 3 + + enum { + IWPM_NLA_QUERY_MAPPING_UNSPEC = 0, + IWPM_NLA_QUERY_MAPPING_SEQ, + IWPM_NLA_QUERY_LOCAL_ADDR, + IWPM_NLA_QUERY_REMOTE_ADDR, ++ IWPM_NLA_QUERY_FLAGS, ++ IWPM_NLA_QUERY_MAPPING_MAX, ++}; ++ ++enum { ++ IWPM_NLA_RQUERY_MAPPING_UNSPEC = 0, ++ IWPM_NLA_RQUERY_MAPPING_SEQ, ++ IWPM_NLA_RQUERY_LOCAL_ADDR, ++ IWPM_NLA_RQUERY_REMOTE_ADDR, + IWPM_NLA_RQUERY_MAPPED_LOC_ADDR, + IWPM_NLA_RQUERY_MAPPED_REM_ADDR, + IWPM_NLA_RQUERY_MAPPING_ERR, +@@ -114,6 +133,7 @@ enum { + IWPM_NLA_MAPINFO_UNSPEC = 0, + IWPM_NLA_MAPINFO_LOCAL_ADDR, + IWPM_NLA_MAPINFO_MAPPED_ADDR, ++ IWPM_NLA_MAPINFO_FLAGS, + IWPM_NLA_MAPINFO_MAX + }; + +@@ -132,6 +152,12 @@ enum { + IWPM_NLA_ERR_MAX + }; + ++enum { ++ IWPM_NLA_HELLO_UNSPEC = 0, ++ IWPM_NLA_HELLO_ABI_VERSION, ++ IWPM_NLA_HELLO_MAX ++}; ++ + /* + * Local service operations: + * RESOLVE - The client requests the local service to resolve a path. +diff --git a/kernel-headers/rdma/rdma_user_cm.h b/kernel-headers/rdma/rdma_user_cm.h +index 0d1e78eb..e42940a2 100644 +--- a/kernel-headers/rdma/rdma_user_cm.h ++++ b/kernel-headers/rdma/rdma_user_cm.h +@@ -300,6 +300,10 @@ enum { + RDMA_OPTION_ID_TOS = 0, + RDMA_OPTION_ID_REUSEADDR = 1, + RDMA_OPTION_ID_AFONLY = 2, ++ RDMA_OPTION_ID_ACK_TIMEOUT = 3 ++}; ++ ++enum { + RDMA_OPTION_IB_PATH = 1 + }; + +diff --git a/kernel-headers/rdma/rdma_user_rxe.h b/kernel-headers/rdma/rdma_user_rxe.h +index 44ef6a3b..aae2e696 100644 +--- a/kernel-headers/rdma/rdma_user_rxe.h ++++ b/kernel-headers/rdma/rdma_user_rxe.h +@@ -58,8 +58,7 @@ struct rxe_global_route { + struct rxe_av { + __u8 port_num; + __u8 network_type; +- __u16 reserved1; +- __u32 reserved2; ++ __u8 dmac[6]; + struct rxe_global_route grh; + union { + struct sockaddr_in _sockaddr_in; +-- +2.20.1 + diff --git a/SOURCES/0102-bnxt_re-lib-Enable-Broadcom-s-57500-RoCE-adapter.patch b/SOURCES/0102-bnxt_re-lib-Enable-Broadcom-s-57500-RoCE-adapter.patch new file mode 100644 index 0000000..40a6257 --- /dev/null +++ b/SOURCES/0102-bnxt_re-lib-Enable-Broadcom-s-57500-RoCE-adapter.patch @@ -0,0 +1,287 @@ +From 7089c4caf0e2ffa37d6a663b9fc7d05624841bf0 Mon Sep 17 00:00:00 2001 +From: Devesh Sharma +Date: Sun, 13 Jan 2019 14:36:13 -0500 +Subject: [PATCH rdma-core 2/2] bnxt_re/lib: Enable Broadcom's 57500 RoCE + adapter + +This is to add Broadcom's 57500 series of adapters support +to RoCE from libbnxt_re. Listing below the significant changes +done as part of the patch. + + - Added the pci-id of the basic gen-p5 chip. + - Adjust psn search memory allocation to suite new search + psn structure. + - Added chip context structure to select the appropriate + execution flow in data-path and control path. + - Fill psn search area as per new or older chip execution + flow. + - removed duplicate declaration of BNXT_RE_ABI_VERSION macro + +Signed-off-by: Devesh Sharma +--- + providers/bnxt_re/bnxt_re-abi.h | 10 +++++-- + providers/bnxt_re/main.c | 14 +++++++++ + providers/bnxt_re/main.h | 15 +++++++++- + providers/bnxt_re/verbs.c | 50 +++++++++++++++++++++++---------- + 4 files changed, 71 insertions(+), 18 deletions(-) + +diff --git a/providers/bnxt_re/bnxt_re-abi.h b/providers/bnxt_re/bnxt_re-abi.h +index 65d048d3..c6998e85 100644 +--- a/providers/bnxt_re/bnxt_re-abi.h ++++ b/providers/bnxt_re/bnxt_re-abi.h +@@ -43,8 +43,6 @@ + #include + #include + +-#define BNXT_RE_ABI_VERSION 1 +- + #define BNXT_RE_FULL_FLAG_DELTA 0x80 + + DECLARE_DRV_CMD(ubnxt_re_pd, IB_USER_VERBS_CMD_ALLOC_PD, +@@ -246,6 +244,14 @@ struct bnxt_re_psns { + __le32 flg_npsn; + }; + ++struct bnxt_re_psns_ext { ++ __u32 opc_spsn; ++ __u32 flg_npsn; ++ __u16 st_slot_idx; ++ __u16 rsvd0; ++ __u32 rsvd1; ++}; ++ + struct bnxt_re_sge { + __le64 pa; + __le32 lkey; +diff --git a/providers/bnxt_re/main.c b/providers/bnxt_re/main.c +index 1cd4d880..d171748e 100644 +--- a/providers/bnxt_re/main.c ++++ b/providers/bnxt_re/main.c +@@ -74,6 +74,7 @@ static const struct verbs_match_ent cna_table[] = { + CNA(BROADCOM, 0x16EF), /* BCM57416 NPAR */ + CNA(BROADCOM, 0x16F0), /* BCM58730 */ + CNA(BROADCOM, 0x16F1), /* BCM57452 */ ++ CNA(BROADCOM, 0x1750), /* BCM57500 */ + CNA(BROADCOM, 0xD800), /* BCM880xx VF */ + CNA(BROADCOM, 0xD802), /* BCM58802 */ + CNA(BROADCOM, 0xD804), /* BCM8804 SR */ +@@ -108,6 +109,11 @@ static const struct verbs_context_ops bnxt_re_cntx_ops = { + .destroy_ah = bnxt_re_destroy_ah + }; + ++bool bnxt_re_is_chip_gen_p5(struct bnxt_re_chip_ctx *cctx) ++{ ++ return cctx->chip_num == CHIP_NUM_57500; ++} ++ + /* Context Init functions */ + static struct verbs_context *bnxt_re_alloc_context(struct ibv_device *vdev, + int cmd_fd, +@@ -133,6 +139,14 @@ static struct verbs_context *bnxt_re_alloc_context(struct ibv_device *vdev, + dev->pg_size = resp.pg_size; + dev->cqe_size = resp.cqe_sz; + dev->max_cq_depth = resp.max_cqd; ++ if (resp.comp_mask & BNXT_RE_UCNTX_CMASK_HAVE_CCTX) { ++ cntx->cctx.chip_num = resp.chip_id0 & 0xFFFF; ++ cntx->cctx.chip_rev = (resp.chip_id0 >> ++ BNXT_RE_CHIP_ID0_CHIP_REV_SFT) & 0xFF; ++ cntx->cctx.chip_metal = (resp.chip_id0 >> ++ BNXT_RE_CHIP_ID0_CHIP_MET_SFT) & ++ 0xFF; ++ } + pthread_spin_init(&cntx->fqlock, PTHREAD_PROCESS_PRIVATE); + /* mmap shared page. */ + cntx->shpg = mmap(NULL, dev->pg_size, PROT_READ | PROT_WRITE, +diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h +index 0b5c749f..be573496 100644 +--- a/providers/bnxt_re/main.h ++++ b/providers/bnxt_re/main.h +@@ -54,7 +54,14 @@ + + #define DEV "bnxt_re : " + +-#define BNXT_RE_UD_QP_HW_STALL 0x400000 ++#define BNXT_RE_UD_QP_HW_STALL 0x400000 ++ ++#define CHIP_NUM_57500 0x1750 ++struct bnxt_re_chip_ctx { ++ __u16 chip_num; ++ __u8 chip_rev; ++ __u8 chip_metal; ++}; + + struct bnxt_re_dpi { + __u32 dpindx; +@@ -81,6 +88,7 @@ struct bnxt_re_cq { + }; + + struct bnxt_re_wrid { ++ struct bnxt_re_psns_ext *psns_ext; + struct bnxt_re_psns *psns; + uint64_t wrid; + uint32_t bytes; +@@ -111,6 +119,7 @@ struct bnxt_re_srq { + + struct bnxt_re_qp { + struct ibv_qp ibvqp; ++ struct bnxt_re_chip_ctx *cctx; + struct bnxt_re_queue *sqq; + struct bnxt_re_wrid *swrid; + struct bnxt_re_queue *rqq; +@@ -155,6 +164,7 @@ struct bnxt_re_context { + struct verbs_context ibvctx; + uint32_t dev_id; + uint32_t max_qp; ++ struct bnxt_re_chip_ctx cctx; + uint32_t max_srq; + struct bnxt_re_dpi udpi; + void *shpg; +@@ -162,6 +172,9 @@ struct bnxt_re_context { + pthread_spinlock_t fqlock; + }; + ++/* Chip context related functions */ ++bool bnxt_re_is_chip_gen_p5(struct bnxt_re_chip_ctx *cctx); ++ + /* DB ring functions used internally*/ + void bnxt_re_ring_rq_db(struct bnxt_re_qp *qp); + void bnxt_re_ring_sq_db(struct bnxt_re_qp *qp); +diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c +index 7786d247..bec382b3 100644 +--- a/providers/bnxt_re/verbs.c ++++ b/providers/bnxt_re/verbs.c +@@ -844,9 +844,11 @@ static void bnxt_re_free_queues(struct bnxt_re_qp *qp) + static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp, + struct ibv_qp_init_attr *attr, + uint32_t pg_size) { ++ struct bnxt_re_psns_ext *psns_ext; + struct bnxt_re_queue *que; + struct bnxt_re_psns *psns; + uint32_t psn_depth; ++ uint32_t psn_size; + int ret, indx; + + que = qp->sqq; +@@ -857,11 +859,12 @@ static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp, + que->diff = que->depth - attr->cap.max_send_wr; + + /* psn_depth extra entries of size que->stride */ +- psn_depth = (que->depth * sizeof(struct bnxt_re_psns)) / +- que->stride; +- if ((que->depth * sizeof(struct bnxt_re_psns)) % que->stride) ++ psn_size = bnxt_re_is_chip_gen_p5(qp->cctx) ? ++ sizeof(struct bnxt_re_psns_ext) : ++ sizeof(struct bnxt_re_psns); ++ psn_depth = (que->depth * psn_size) / que->stride; ++ if ((que->depth * psn_size) % que->stride) + psn_depth++; +- + que->depth += psn_depth; + /* PSN-search memory is allocated without checking for + * QP-Type. Kenrel driver do not map this memory if it +@@ -875,6 +878,7 @@ static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp, + que->depth -= psn_depth; + /* start of spsn space sizeof(struct bnxt_re_psns) each. */ + psns = (que->va + que->stride * que->depth); ++ psns_ext = (struct bnxt_re_psns_ext *)psns; + pthread_spin_init(&que->qlock, PTHREAD_PROCESS_PRIVATE); + qp->swrid = calloc(que->depth, sizeof(struct bnxt_re_wrid)); + if (!qp->swrid) { +@@ -884,6 +888,13 @@ static int bnxt_re_alloc_queues(struct bnxt_re_qp *qp, + + for (indx = 0 ; indx < que->depth; indx++, psns++) + qp->swrid[indx].psns = psns; ++ if (bnxt_re_is_chip_gen_p5(qp->cctx)) { ++ for (indx = 0 ; indx < que->depth; indx++, psns_ext++) { ++ qp->swrid[indx].psns_ext = psns_ext; ++ qp->swrid[indx].psns = (struct bnxt_re_psns *)psns_ext; ++ } ++ } ++ + qp->cap.max_swr = que->depth; + + if (qp->rqq) { +@@ -931,6 +942,7 @@ struct ibv_qp *bnxt_re_create_qp(struct ibv_pd *ibvpd, + if (bnxt_re_alloc_queue_ptr(qp, attr)) + goto fail; + /* alloc queues */ ++ qp->cctx = &cntx->cctx; + if (bnxt_re_alloc_queues(qp, attr, dev->pg_size)) + goto failq; + /* Fill ibv_cmd */ +@@ -1094,26 +1106,36 @@ static int bnxt_re_build_sge(struct bnxt_re_sge *sge, struct ibv_sge *sg_list, + return length; + } + +-static void bnxt_re_fill_psns(struct bnxt_re_qp *qp, struct bnxt_re_psns *psns, ++static void bnxt_re_fill_psns(struct bnxt_re_qp *qp, struct bnxt_re_wrid *wrid, + uint8_t opcode, uint32_t len) + { +- uint32_t pkt_cnt = 0, nxt_psn; ++ uint32_t opc_spsn = 0, flg_npsn = 0; ++ struct bnxt_re_psns_ext *psns_ext; ++ uint32_t pkt_cnt = 0, nxt_psn = 0; ++ struct bnxt_re_psns *psns; ++ ++ psns = wrid->psns; ++ psns_ext = wrid->psns_ext; + +- memset(psns, 0, sizeof(*psns)); + if (qp->qptyp == IBV_QPT_RC) { +- psns->opc_spsn = htole32(qp->sq_psn & BNXT_RE_PSNS_SPSN_MASK); ++ opc_spsn = qp->sq_psn & BNXT_RE_PSNS_SPSN_MASK; + pkt_cnt = (len / qp->mtu); + if (len % qp->mtu) + pkt_cnt++; + if (len == 0) + pkt_cnt = 1; + nxt_psn = ((qp->sq_psn + pkt_cnt) & BNXT_RE_PSNS_NPSN_MASK); +- psns->flg_npsn = htole32(nxt_psn); ++ flg_npsn = nxt_psn; + qp->sq_psn = nxt_psn; + } + opcode = bnxt_re_ibv_wr_to_wc_opcd(opcode); +- psns->opc_spsn |= htole32(((opcode & BNXT_RE_PSNS_OPCD_MASK) << +- BNXT_RE_PSNS_OPCD_SHIFT)); ++ opc_spsn |= (((uint32_t)opcode & BNXT_RE_PSNS_OPCD_MASK) << ++ BNXT_RE_PSNS_OPCD_SHIFT); ++ memset(psns, 0, sizeof(*psns)); ++ psns->opc_spsn = htole32(opc_spsn); ++ psns->flg_npsn = htole32(flg_npsn); ++ if (bnxt_re_is_chip_gen_p5(qp->cctx)) ++ psns_ext->st_slot_idx = 0; + } + + static void bnxt_re_fill_wrid(struct bnxt_re_wrid *wrid, struct ibv_send_wr *wr, +@@ -1235,10 +1257,9 @@ int bnxt_re_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, + { + struct bnxt_re_qp *qp = to_bnxt_re_qp(ibvqp); + struct bnxt_re_queue *sq = qp->sqq; +- struct bnxt_re_bsqe *hdr; + struct bnxt_re_wrid *wrid; +- struct bnxt_re_psns *psns; + uint8_t is_inline = false; ++ struct bnxt_re_bsqe *hdr; + int ret = 0, bytes = 0; + bool ring_db = false; + void *sqe; +@@ -1268,7 +1289,6 @@ int bnxt_re_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, + + sqe = (void *)(sq->va + (sq->tail * sq->stride)); + wrid = &qp->swrid[sq->tail]; +- psns = wrid->psns; + + memset(sqe, 0, bnxt_re_get_sqe_sz()); + hdr = sqe; +@@ -1318,7 +1338,7 @@ int bnxt_re_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, + } + + bnxt_re_fill_wrid(wrid, wr, bytes, qp->cap.sqsig); +- bnxt_re_fill_psns(qp, psns, wr->opcode, bytes); ++ bnxt_re_fill_psns(qp, wrid, wr->opcode, bytes); + bnxt_re_incr_tail(sq); + qp->wqe_cnt++; + wr = wr->next; +-- +2.20.1 + diff --git a/SOURCES/0103-mlx5-Add-new-device-IDs.patch b/SOURCES/0103-mlx5-Add-new-device-IDs.patch new file mode 100644 index 0000000..a4a3470 --- /dev/null +++ b/SOURCES/0103-mlx5-Add-new-device-IDs.patch @@ -0,0 +1,31 @@ +From 63080234b4a9f992c5d990fd8fac0fdec0f45638 Mon Sep 17 00:00:00 2001 +From: Yishai Hadas +Date: Sun, 10 Mar 2019 12:03:58 +0200 +Subject: [PATCH rdma-core] mlx5: Add new device IDs + +Add ConnectX-6 DX HCA ID. + +In addition, add "ConnectX family mlx5Gen Virtual Function" device ID. +Every new HCA VF will be identified with this device ID. + +Signed-off-by: Yishai Hadas +--- + providers/mlx5/mlx5.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c +index 08edfd85..1faae919 100644 +--- a/providers/mlx5/mlx5.c ++++ b/providers/mlx5/mlx5.c +@@ -74,6 +74,8 @@ static const struct verbs_match_ent hca_table[] = { + HCA(MELLANOX, 0x101a), /* ConnectX-5 Ex VF */ + HCA(MELLANOX, 0x101b), /* ConnectX-6 */ + HCA(MELLANOX, 0x101c), /* ConnectX-6 VF */ ++ HCA(MELLANOX, 0x101d), /* ConnectX-6 DX */ ++ HCA(MELLANOX, 0x101e), /* ConnectX family mlx5Gen Virtual Function */ + HCA(MELLANOX, 0xa2d2), /* BlueField integrated ConnectX-5 network controller */ + HCA(MELLANOX, 0xa2d3), /* BlueField integrated ConnectX-5 network controller VF */ + {} +-- +2.20.1 + diff --git a/SPECS/rdma-core.spec b/SPECS/rdma-core.spec index ed5623f..8a9a673 100644 --- a/SPECS/rdma-core.spec +++ b/SPECS/rdma-core.spec @@ -1,11 +1,8 @@ Name: rdma-core Version: 22.4 -Release: 2%{?dist} +Release: 4%{?dist} Summary: RDMA core userspace libraries and daemons -%ifnarch %{arm} -%define dma_coherent 1 -%endif # Almost everything is licensed under the OFA dual GPLv2, 2 Clause BSD license # providers/ipathverbs/ Dual licensed using a BSD license with an extra patent clause # providers/rxe/ Incorporates code from ipathverbs and contains the patent clause @@ -22,6 +19,10 @@ Patch5: 0005-fix_mtu_limiting_for_ipoib.patch Patch6: 0006-srp_daemon-Remove-unsupported-systemd-configurations.patch Patch7: 0007-srp_daemon-srp_daemon.service-should-be-started-afte.patch Patch8: rdma-core-unclamp-ipoib-mtu.patch +# Additional upstream patches from branch v23 +Patch11: 0101-Update-kernel-headers.patch +Patch12: 0102-bnxt_re-lib-Enable-Broadcom-s-57500-RoCE-adapter.patch +Patch13: 0103-mlx5-Add-new-device-IDs.patch # Additional upstream patches from stable-vX/master branch Patch101: 0001-srp_daemon-fix-a-double-free-segment-fault-for-ibsrp.patch Patch102: 0002-cxgb4-free-appropriate-pointer-in-error-case.patch @@ -30,6 +31,7 @@ Patch103: 0003-man-Fix-return-value-for-ibv_reg_dm_mr.patch Patch104: 0004-Update-kernel-headers.patch Patch105: 0005-mlx5-Support-scatter-to-CQE-over-DCT-QP.patch Patch106: 0001-ibacm-Do-not-open-non-InfiniBand-device.patch +Patch107: 0001-libibverbs-Fix-ABI_placeholder1-and-ABI_placeholder2.patch # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} @@ -63,6 +65,8 @@ Obsoletes: libibcm < %{version}-%{release} # the ndd utility moved from infiniband-diags to rdma-core Conflicts: infiniband-diags <= 1.6.5 Requires: pciutils +# 32-bit arm is missing required arch-specific memory barriers, +ExcludeArch: %{arm} # Since we recommend developers use Ninja, so should packagers, for consistency. %define CMAKE_FLAGS %{nil} @@ -113,12 +117,10 @@ Provides: libhfi1-static = %{version}-%{release} Obsoletes: libhfi1-static < %{version}-%{release} Provides: libipathverbs-static = %{version}-%{release} Obsoletes: libipathverbs-static < %{version}-%{release} -%if 0%{?dma_coherent} Provides: libmlx4-static = %{version}-%{release} Obsoletes: libmlx4-static < %{version}-%{release} Provides: libmlx5-static = %{version}-%{release} Obsoletes: libmlx5-static < %{version}-%{release} -%endif Provides: libnes-static = %{version}-%{release} Obsoletes: libnes-static < %{version}-%{release} Provides: libocrdma-static = %{version}-%{release} @@ -148,14 +150,12 @@ Provides: libi40iw = %{version}-%{release} Obsoletes: libi40iw < %{version}-%{release} Provides: libipathverbs = %{version}-%{release} Obsoletes: libipathverbs < %{version}-%{release} -%if 0%{?dma_coherent} Provides: libmlx4 = %{version}-%{release} Obsoletes: libmlx4 < %{version}-%{release} %ifnarch s390 Provides: libmlx5 = %{version}-%{release} Obsoletes: libmlx5 < %{version}-%{release} %endif -%endif Provides: libmthca = %{version}-%{release} Obsoletes: libmthca < %{version}-%{release} Provides: libnes = %{version}-%{release} @@ -283,12 +283,16 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 +%patch107 -p1 %build @@ -339,22 +343,16 @@ mkdir -p %{buildroot}%{dracutlibdir}/modules.d/05rdma mkdir -p %{buildroot}%{sysmodprobedir} install -D -m0644 redhat/rdma.conf %{buildroot}/%{_sysconfdir}/rdma/rdma.conf install -D -m0644 redhat/rdma.sriov-vfs %{buildroot}/%{_sysconfdir}/rdma/sriov-vfs -%if 0%{?dma_coherent} install -D -m0644 redhat/rdma.mlx4.conf %{buildroot}/%{_sysconfdir}/rdma/mlx4.conf -%endif install -D -m0755 redhat/rdma.ifup-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifup-ib install -D -m0755 redhat/rdma.ifdown-ib %{buildroot}/%{_sysconfdir}/sysconfig/network-scripts/ifdown-ib install -D -m0644 redhat/rdma.service %{buildroot}%{_unitdir}/rdma.service install -D -m0755 redhat/rdma.modules-setup.sh %{buildroot}%{dracutlibdir}/modules.d/05rdma/module-setup.sh install -D -m0644 redhat/rdma.udev-rules %{buildroot}%{_udevrulesdir}/98-rdma.rules -%if 0%{?dma_coherent} install -D -m0644 redhat/rdma.mlx4.sys.modprobe %{buildroot}%{sysmodprobedir}/libmlx4.conf -%endif install -D -m0755 redhat/rdma.kernel-init %{buildroot}%{_libexecdir}/rdma-init-kernel install -D -m0755 redhat/rdma.sriov-init %{buildroot}%{_libexecdir}/rdma-set-sriov-vf -%if 0%{?dma_coherent} install -D -m0755 redhat/rdma.mlx4-setup.sh %{buildroot}%{_libexecdir}/mlx4-setup.sh -%endif # ibacm bin/ib_acme -D . -O @@ -403,11 +401,9 @@ rm -rf %{buildroot}/%{_initrddir}/ %doc %{_docdir}/%{name}-%{version}/udev.md %config(noreplace) %{_sysconfdir}/rdma/* %config(noreplace) %{_sysconfdir}/udev/rules.d/* -%if 0%{?dma_coherent} %ifnarch s390 %config(noreplace) %{_sysconfdir}/modprobe.d/mlx4.conf %endif -%endif %config(noreplace) %{_sysconfdir}/modprobe.d/truescale.conf %{_sysconfdir}/sysconfig/network-scripts/* %{_unitdir}/rdma-hw.target @@ -416,14 +412,10 @@ rm -rf %{buildroot}/%{_initrddir}/ %dir %{dracutlibdir}/modules.d/05rdma %{dracutlibdir}/modules.d/05rdma/module-setup.sh %{_udevrulesdir}/* -%if 0%{?dma_coherent} %{sysmodprobedir}/libmlx4.conf -%endif %{_libexecdir}/rdma-init-kernel %{_libexecdir}/rdma-set-sriov-vf -%if 0%{?dma_coherent} %{_libexecdir}/mlx4-setup.sh -%endif %{_libexecdir}/truescale-serdes.cmds %{_sbindir}/rdma-ndd %{_unitdir}/rdma-ndd.service @@ -445,13 +437,11 @@ rm -rf %{buildroot}/%{_initrddir}/ %{_mandir}/man3/rdma* %{_mandir}/man3/umad* %{_mandir}/man3/*_to_ibv_rate.* -%if 0%{?dma_coherent} %ifnarch s390 %{_mandir}/man3/mlx4dv* %{_mandir}/man3/mlx5dv* %{_mandir}/man7/mlx5dv* %endif -%endif %{_mandir}/man7/rdma_cm.* %files -n libibverbs @@ -459,24 +449,20 @@ rm -rf %{buildroot}/%{_initrddir}/ %dir %{_libdir}/libibverbs %{_libdir}/libibverbs*.so.* %{_libdir}/libibverbs/*.so -%if 0%{?dma_coherent} %ifnarch s390 %{_libdir}/libmlx4.so.* %{_libdir}/libmlx5.so.* %endif -%endif %config(noreplace) %{_sysconfdir}/libibverbs.d/*.driver %doc %{_docdir}/%{name}-%{version}/libibverbs.md %doc %{_docdir}/%{name}-%{version}/rxe.md %doc %{_docdir}/%{name}-%{version}/tag_matching.md %{_bindir}/rxe_cfg %{_mandir}/man7/rxe* -%if 0%{?dma_coherent} %ifnarch s390 %{_mandir}/man7/mlx4dv* %{_mandir}/man7/mlx5dv* %endif -%endif %{_mandir}/man8/rxe* %files -n libibverbs-utils @@ -558,6 +544,14 @@ rm -rf %{buildroot}/%{_initrddir}/ %doc %{_docdir}/%{name}-%{version}/ibsrpdm.md %changelog +* Wed Jun 10 2020 Honggang Li - 22.4-4.el7_8 +- libibverbs: Fix ABI_placeholder1 and ABI_placeholder2 assignment +- Resolves: rhbz#1845848 + +* Mon Mar 30 2020 Honggang Li - 22.4-3 +- Restore three patches +- Resolves: rhbz#1817412 + * Wed Feb 19 2020 Honggang Li - 22.4-2 - Fix ibacm segfault for dual port HCA support IB and Ethernet - Resolves: rhbz#1793585