diff --git a/prov/usnic/src/usdf.h b/prov/usnic/src/usdf.h index 1daa1ff1665..841fe522ee8 100644 --- a/prov/usnic/src/usdf.h +++ b/prov/usnic/src/usdf.h @@ -81,6 +81,7 @@ extern struct fi_provider usdf_ops; #define USDF_MR_IOV_LIMIT 1 #define USDF_ADDR_STR_LEN (INET6_ADDRSTRLEN+8) +#define USDF_MR_CNT (65535) /* * TAILQ stuff that should exist diff --git a/prov/usnic/src/usdf_dgram.h b/prov/usnic/src/usdf_dgram.h index 61728a537f9..66bb6aea3be 100644 --- a/prov/usnic/src/usdf_dgram.h +++ b/prov/usnic/src/usdf_dgram.h @@ -53,6 +53,7 @@ #define USDF_DGRAM_RMA_IOV_LIMIT 0 #define USDF_DGRAM_CNTR_CNT 0 #define USDF_DGRAM_MR_IOV_LIMIT (USDF_MR_IOV_LIMIT) +#define USDF_DGRAM_MR_CNT (USDF_MR_CNT) int usdf_dgram_fill_rx_attr(struct fi_info *hints, diff --git a/prov/usnic/src/usdf_ep_dgram.c b/prov/usnic/src/usdf_ep_dgram.c index 0173709ea12..30bb6e20cfb 100644 --- a/prov/usnic/src/usdf_ep_dgram.c +++ b/prov/usnic/src/usdf_ep_dgram.c @@ -438,6 +438,7 @@ static const struct fi_domain_attr dgram_dflt_domain_attr = { .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL, .cntr_cnt = USDF_DGRAM_CNTR_CNT, .mr_iov_limit = USDF_DGRAM_MR_IOV_LIMIT, + .mr_cnt = USDF_DGRAM_MR_CNT, }; /******************************************************************************* @@ -580,6 +581,13 @@ int usdf_dgram_fill_dom_attr(uint32_t version, struct fi_info *hints, defaults.mr_mode = hints->domain_attr->mr_mode; } + if (hints->domain_attr->mr_cnt <= USDF_DGRAM_MR_CNT) { + defaults.mr_cnt = hints->domain_attr->mr_cnt; + } else { + USDF_DBG_SYS(DOMAIN, "mr_count exceeded provider limit\n"); + return -FI_ENODATA; + } + out: *fi->domain_attr = defaults; diff --git a/prov/usnic/src/usdf_ep_msg.c b/prov/usnic/src/usdf_ep_msg.c index 7a219dcdc8b..f634379a01b 100644 --- a/prov/usnic/src/usdf_ep_msg.c +++ b/prov/usnic/src/usdf_ep_msg.c @@ -120,6 +120,7 @@ static const struct fi_domain_attr msg_dflt_domain_attr = { .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL, .cntr_cnt = USDF_MSG_CNTR_CNT, .mr_iov_limit = USDF_MSG_MR_IOV_LIMIT, + .mr_cnt = USDF_MSG_MR_CNT, }; static struct fi_ops_atomic usdf_msg_atomic_ops = { @@ -261,6 +262,13 @@ int usdf_msg_fill_dom_attr(uint32_t version, struct fi_info *hints, defaults.mr_mode = hints->domain_attr->mr_mode; } + if (hints->domain_attr->mr_cnt <= USDF_MSG_MR_CNT) { + defaults.mr_cnt = hints->domain_attr->mr_cnt; + } else { + USDF_DBG_SYS(DOMAIN, "mr_count exceeded provider limit\n"); + return -FI_ENODATA; + } + out: *fi->domain_attr = defaults; diff --git a/prov/usnic/src/usdf_ep_rdm.c b/prov/usnic/src/usdf_ep_rdm.c index b6e2183e44d..fbc5581ec35 100644 --- a/prov/usnic/src/usdf_ep_rdm.c +++ b/prov/usnic/src/usdf_ep_rdm.c @@ -123,6 +123,7 @@ static const struct fi_domain_attr rdm_dflt_domain_attr = { .mr_mode = OFI_MR_BASIC_MAP | FI_MR_LOCAL, .cntr_cnt = USDF_RDM_CNTR_CNT, .mr_iov_limit = USDF_RDM_MR_IOV_LIMIT, + .mr_cnt = USDF_RDM_MR_CNT, }; static struct fi_ops_atomic usdf_rdm_atomic_ops = { @@ -264,6 +265,13 @@ int usdf_rdm_fill_dom_attr(uint32_t version, struct fi_info *hints, defaults.mr_mode = hints->domain_attr->mr_mode; } + if (hints->domain_attr->mr_cnt <= USDF_RDM_MR_CNT) { + defaults.mr_cnt = hints->domain_attr->mr_cnt; + } else { + USDF_DBG_SYS(DOMAIN, "mr_count exceeded provider limit\n"); + return -FI_ENODATA; + } + out: *fi->domain_attr = defaults; diff --git a/prov/usnic/src/usdf_msg.h b/prov/usnic/src/usdf_msg.h index 690a0f58546..307e068c934 100644 --- a/prov/usnic/src/usdf_msg.h +++ b/prov/usnic/src/usdf_msg.h @@ -56,6 +56,7 @@ #define USDF_MSG_IOV_LIMIT (USDF_MSG_DFLT_SGE) #define USDF_MSG_RMA_IOV_LIMIT 0 #define USDF_MSG_MR_IOV_LIMIT (USDF_MR_IOV_LIMIT) +#define USDF_MSG_MR_CNT (USDF_MR_CNT) #define USDF_MSG_CNTR_CNT 0 diff --git a/prov/usnic/src/usdf_rdm.h b/prov/usnic/src/usdf_rdm.h index 19bb897e53b..6509e4a32db 100644 --- a/prov/usnic/src/usdf_rdm.h +++ b/prov/usnic/src/usdf_rdm.h @@ -56,6 +56,7 @@ #define USDF_RDM_IOV_LIMIT (USDF_RDM_DFLT_SGE) #define USDF_RDM_RMA_IOV_LIMIT 0 #define USDF_RDM_MR_IOV_LIMIT (USDF_MR_IOV_LIMIT) +#define USDF_RDM_MR_CNT (USDF_MR_CNT) #define USDF_RDM_CNTR_CNT 0