Skip to content

Commit

Permalink
prov/usnic: handle mr_cnt field.
Browse files Browse the repository at this point in the history
per ofiwg#3084.

Signed-off-by: Thananon Patinyasakdikul <apatinya@cisco.com>
  • Loading branch information
Thananon Patinyasakdikul committed Jul 20, 2017
1 parent 5f739da commit e4bbd89
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions prov/usnic/src/usdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions prov/usnic/src/usdf_dgram.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions prov/usnic/src/usdf_ep_dgram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/*******************************************************************************
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 8 additions & 0 deletions prov/usnic/src/usdf_ep_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 8 additions & 0 deletions prov/usnic/src/usdf_ep_rdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions prov/usnic/src/usdf_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions prov/usnic/src/usdf_rdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e4bbd89

Please sign in to comment.