diff --git a/net/libfabric/Makefile b/net/libfabric/Makefile index 5dc71c377423..e91c9773efd7 100644 --- a/net/libfabric/Makefile +++ b/net/libfabric/Makefile @@ -1,61 +1,62 @@ PORTNAME= libfabric DISTVERSION= 1.15.1 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= https://github.com/ofiwg/${PORTNAME}/releases/download/v${DISTVERSION}/ MAINTAINER= yuri@FreeBSD.org COMMENT= Open Fabric Interfaces WWW= https://ofiwg.github.io/libfabric/ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= bash:shells/bash LIB_DEPENDS= libepoll-shim.so:devel/libepoll-shim USES= gmake libtool pkgconfig tar:bz2 USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-static CONFIGURE_SHELL= ${LOCALBASE}/bin/bash # workaround for https://github.com/ofiwg/libfabric/issues/7901 CFLAGS+= -I${LOCALBASE}/include/libepoll-shim LDFLAGS+= -L${LOCALBASE}/lib -lepoll-shim INSTALL_TARGET= install-strip OPTIONS_MULTI= PROVIDERS OPTIONS_MULTI_PROVIDERS= RXD RXM SOCKETS TCP UDP OPTIONS_DEFAULT= ${OPTIONS_MULTI_PROVIDERS} OPTIONS_SUB= yes PROVIDERS_DESC= Providers to build: OPTIONS_MULTI_PROVIDERS+= VERBS VERBS_PLIST_FILES= man/man7/fi_verbs.7.gz .for p in ${OPTIONS_MULTI_PROVIDERS} ${p}_DESC= '${p:tl}' provider ${p}_CONFIGURE_ENABLE= ${p:tl} .endfor SED_WRAP_CLOSE= { \ i\\\n \ \#ifdef SHIM_SYS_SHIM_HELPERS\\\n \ \#undef close\\\n \ \#endif\n \ a\\\n \ \#ifdef SHIM_SYS_SHIM_HELPERS\\\n \ \#define close epoll_shim_close\\\n \ \#endif\n \ } post-patch: @${FIND} ${WRKSRC} -name "*.[ch]" -and -exec ${GREP} -q '' {} \; -print | ${XARGS} ${REINPLACE_CMD} 's|||' @${FIND} ${WRKSRC} -name "*.[ch]" -and -exec ${GREP} -q '' {} \; -print | ${XARGS} ${REINPLACE_CMD} 's|||' @${FIND} ${WRKSRC} -name "*.[ch]" -and -exec ${GREP} -q '' {} \; -print | ${XARGS} ${REINPLACE_CMD} 's|||' @${GREP} -Flr --include='*.c' '.close' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} $$'/\\.close/${SED_WRAP_CLOSE}' @${REINPLACE_CMD} $$'/fi_ops.*close/${SED_WRAP_CLOSE}' ${WRKSRC}/src/fabric.c @${REINPLACE_CMD} $$'/[*>]close/${SED_WRAP_CLOSE}' ${WRKSRC}/include/rdma/fabric.h .include diff --git a/net/libfabric/files/patch-include_ofi__hook.h b/net/libfabric/files/patch-include_ofi__hook.h new file mode 100644 index 000000000000..bdc7ca538df7 --- /dev/null +++ b/net/libfabric/files/patch-include_ofi__hook.h @@ -0,0 +1,11 @@ +--- include/ofi_hook.h.orig 2022-04-30 21:46:31 UTC ++++ include/ofi_hook.h +@@ -163,7 +163,7 @@ struct hook_domain { + struct fid_domain *hdomain; + struct hook_fabric *fabric; + struct ofi_ops_flow_ctrl *base_ops_flow_ctrl; +- ssize_t (*base_credit_handler)(struct fid_ep *ep_fid, size_t credits); ++ ssize_t (*base_credit_handler)(struct fid_ep *ep_fid, uint64_t credits); + }; + + int hook_domain_init(struct fid_fabric *fabric, struct fi_info *info, diff --git a/net/libfabric/files/patch-prov_hook_src_hook__domain.c b/net/libfabric/files/patch-prov_hook_src_hook__domain.c new file mode 100644 index 000000000000..513036779fdc --- /dev/null +++ b/net/libfabric/files/patch-prov_hook_src_hook__domain.c @@ -0,0 +1,29 @@ +--- prov/hook/src/hook_domain.c.orig 2022-04-30 21:46:31 UTC ++++ prov/hook/src/hook_domain.c +@@ -102,7 +102,7 @@ static struct fi_ops_mr hook_mr_ops = { + .regattr = hook_mr_regattr, + }; + +-static ssize_t hook_credit_handler(struct fid_ep *ep_fid, size_t credits) ++static ssize_t hook_credit_handler(struct fid_ep *ep_fid, uint64_t credits) + { + /* + * called from the base provider, ep_fid is the base ep, and +@@ -114,7 +114,7 @@ static void hook_set_send_handler(struct fid_domain *d + } + + static void hook_set_send_handler(struct fid_domain *domain_fid, +- ssize_t (*credit_handler)(struct fid_ep *ep, size_t credits)) ++ ssize_t (*credit_handler)(struct fid_ep *ep, uint64_t credits)) + { + struct hook_domain *domain = container_of(domain_fid, + struct hook_domain, domain); +@@ -131,7 +131,7 @@ static int hook_enable_ep_flow_ctrl(struct fid_ep *ep_ + return ep->domain->base_ops_flow_ctrl->enable(ep->hep, threshold); + } + +-static void hook_add_credits(struct fid_ep *ep_fid, size_t credits) ++static void hook_add_credits(struct fid_ep *ep_fid, uint64_t credits) + { + struct hook_ep *ep = container_of(ep_fid, struct hook_ep, ep); + diff --git a/net/libfabric/files/patch-prov_rxm_src_rxm__domain.c b/net/libfabric/files/patch-prov_rxm_src_rxm__domain.c new file mode 100644 index 000000000000..f631f8233700 --- /dev/null +++ b/net/libfabric/files/patch-prov_rxm_src_rxm__domain.c @@ -0,0 +1,25 @@ +--- prov/rxm/src/rxm_domain.c.orig 2022-04-30 21:46:32 UTC ++++ prov/rxm/src/rxm_domain.c +@@ -567,7 +621,7 @@ static struct fi_ops_mr rxm_domain_mr_thru_ops = { + .regattr = rxm_mr_regattr_thru, + }; + +-static ssize_t rxm_send_credits(struct fid_ep *ep, size_t credits) ++static ssize_t rxm_send_credits(struct fid_ep *ep, uint64_t credits) + { + struct rxm_conn *rxm_conn = ep->fid.context; + struct rxm_ep *rxm_ep = rxm_conn->ep; +@@ -620,11 +674,11 @@ defer: + return FI_SUCCESS; + } + +-static void rxm_no_add_credits(struct fid_ep *ep_fid, size_t credits) ++static void rxm_no_add_credits(struct fid_ep *ep_fid, uint64_t credits) + { } + + static void rxm_no_credit_handler(struct fid_domain *domain_fid, +- ssize_t (*credit_handler)(struct fid_ep *ep, size_t credits)) ++ ssize_t (*credit_handler)(struct fid_ep *ep, uint64_t credits)) + { } + + static int rxm_no_enable_flow_ctrl(struct fid_ep *ep_fid, uint64_t threshold) diff --git a/net/libfabric/files/patch-prov_verbs_src_fi__verbs.h b/net/libfabric/files/patch-prov_verbs_src_fi__verbs.h new file mode 100644 index 000000000000..fe556dda9df8 --- /dev/null +++ b/net/libfabric/files/patch-prov_verbs_src_fi__verbs.h @@ -0,0 +1,11 @@ +--- prov/verbs/src/fi_verbs.h.orig 2022-05-13 15:08:17 UTC ++++ prov/verbs/src/fi_verbs.h +@@ -943,7 +943,7 @@ ssize_t vrb_send_iov(struct vrb_ep *ep, struct ibv_sen + const struct iovec *iov, void **desc, int count, + uint64_t flags); + +-void vrb_add_credits(struct fid_ep *ep, size_t credits); ++void vrb_add_credits(struct fid_ep *ep, uint64_t credits); + + int vrb_get_rai_id(const char *node, const char *service, uint64_t flags, + const struct fi_info *hints, struct rdma_addrinfo **rai, diff --git a/net/libfabric/files/patch-prov_verbs_src_verbs__domain.c b/net/libfabric/files/patch-prov_verbs_src_verbs__domain.c new file mode 100644 index 000000000000..6a6314b03481 --- /dev/null +++ b/net/libfabric/files/patch-prov_verbs_src_verbs__domain.c @@ -0,0 +1,16 @@ +--- prov/verbs/src/verbs_domain.c.orig 2022-04-30 21:46:32 UTC ++++ prov/verbs/src/verbs_domain.c +@@ -36,11 +36,11 @@ + #include "ofi_iov.h" + + #include "fi_verbs.h" +-#include ++#include + + + static void vrb_set_credit_handler(struct fid_domain *domain_fid, +- ssize_t (*credit_handler)(struct fid_ep *ep, size_t credits)) ++ ssize_t (*credit_handler)(struct fid_ep *ep, uint64_t credits)) + { + struct vrb_domain *domain; + diff --git a/net/libfabric/files/patch-prov_verbs_src_verbs__ep.c b/net/libfabric/files/patch-prov_verbs_src_verbs__ep.c new file mode 100644 index 000000000000..3b0a7ec88d24 --- /dev/null +++ b/net/libfabric/files/patch-prov_verbs_src_verbs__ep.c @@ -0,0 +1,11 @@ +--- prov/verbs/src/verbs_ep.c.orig 2022-05-10 03:27:55 UTC ++++ prov/verbs/src/verbs_ep.c +@@ -38,7 +38,7 @@ static struct fi_ops_msg vrb_srq_msg_ops; + static struct fi_ops_msg vrb_srq_msg_ops; + + +-void vrb_add_credits(struct fid_ep *ep_fid, size_t credits) ++void vrb_add_credits(struct fid_ep *ep_fid, uint64_t credits) + { + struct vrb_ep *ep; + struct util_cq *cq;