Skip to content

Commit

Permalink
prov/efa: Remove tx_iov_limit and rx_iov_limit from efa_rdm_ep
Browse files Browse the repository at this point in the history
tx_iov_limit is a duplication of info->tx_attr->iov_limit.
rx_iov_limit is a duplication of info->rx_attr->iov_limit.
Access tx_iov_limit and rx_iov_limit from fi_info to save the
memory of efa_rdm_ep struct.

Signed-off-by: Jessie Yang <jiaxiyan@amazon.com>
  • Loading branch information
jiaxiyan authored and shijin-aws committed Oct 1, 2024
1 parent 1b6f3ef commit 1ef91c8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion prov/efa/src/rdm/efa_rdm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ssize_t efa_rdm_atomic_generic_efa(struct efa_rdm_ep *efa_rdm_ep,
ssize_t err;
struct util_srx_ctx *srx_ctx;

assert(msg->iov_count <= efa_rdm_ep->tx_iov_limit);
assert(msg->iov_count <= efa_rdm_ep->base_ep.info->tx_attr->iov_limit);
efa_perfset_start(efa_rdm_ep, perf_efa_tx);

srx_ctx = efa_rdm_ep_get_peer_srx_ctx(efa_rdm_ep);
Expand Down
2 changes: 0 additions & 2 deletions prov/efa/src/rdm/efa_rdm_ep.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ struct efa_rdm_ep {
size_t rx_size;
size_t tx_size;
size_t mtu_size;
size_t rx_iov_limit;
size_t tx_iov_limit;
size_t inject_size;

/* Endpoint's capability to support zero-copy rx */
Expand Down
2 changes: 0 additions & 2 deletions prov/efa/src/rdm/efa_rdm_ep_fiops.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,6 @@ int efa_rdm_ep_open(struct fid_domain *domain, struct fi_info *info,

efa_rdm_ep->rx_size = info->rx_attr->size;
efa_rdm_ep->tx_size = info->tx_attr->size;
efa_rdm_ep->rx_iov_limit = info->rx_attr->iov_limit;
efa_rdm_ep->tx_iov_limit = info->tx_attr->iov_limit;
efa_rdm_ep->inject_size = info->tx_attr->inject_size;
efa_rdm_ep->efa_max_outstanding_tx_ops = efa_domain->device->rdm_info->tx_attr->size;
efa_rdm_ep->efa_max_outstanding_rx_ops = efa_domain->device->rdm_info->rx_attr->size;
Expand Down
2 changes: 1 addition & 1 deletion prov/efa/src/rdm/efa_rdm_ep_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ int efa_rdm_ep_post_user_recv_buf(struct efa_rdm_ep *ep, struct efa_rdm_ope *rxe
size_t rx_iov_offset = 0;
int err, rx_iov_index = 0;

assert(rxe->iov_count > 0 && rxe->iov_count <= ep->rx_iov_limit);
assert(rxe->iov_count > 0 && rxe->iov_count <= ep->base_ep.info->rx_attr->iov_limit);
assert(rxe->iov[0].iov_len >= ep->msg_prefix_size);
pkt_entry = efa_rdm_pke_alloc(ep, ep->user_rx_pkt_pool, EFA_RDM_PKE_FROM_USER_RX_POOL);
if (OFI_UNLIKELY(!pkt_entry)) {
Expand Down
4 changes: 2 additions & 2 deletions prov/efa/src/rdm/efa_rdm_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ssize_t efa_rdm_msg_generic_send(struct efa_rdm_ep *ep, struct efa_rdm_peer *pee

srx_ctx = efa_rdm_ep_get_peer_srx_ctx(ep);

assert(msg->iov_count <= ep->tx_iov_limit);
assert(msg->iov_count <= ep->base_ep.info->tx_attr->iov_limit);

efa_perfset_start(ep, perf_efa_tx);
ofi_genlock_lock(srx_ctx->lock);
Expand Down Expand Up @@ -893,7 +893,7 @@ ssize_t efa_rdm_msg_generic_recv(struct efa_rdm_ep *ep, const struct fi_msg *msg
struct efa_rdm_ope *rxe;
struct util_srx_ctx *srx_ctx;

assert(msg->iov_count <= ep->rx_iov_limit);
assert(msg->iov_count <= ep->base_ep.info->rx_attr->iov_limit);

efa_perfset_start(ep, perf_efa_recv);

Expand Down
4 changes: 2 additions & 2 deletions prov/efa/src/rdm/efa_rdm_rma.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ ssize_t efa_rdm_rma_readmsg(struct fid_ep *ep, const struct fi_msg_rma *msg, uin
if (err)
return err;

assert(msg->iov_count <= efa_rdm_ep->tx_iov_limit);
assert(msg->iov_count <= efa_rdm_ep->base_ep.info->tx_attr->iov_limit);

efa_perfset_start(efa_rdm_ep, perf_efa_tx);
ofi_genlock_lock(srx_ctx->lock);
Expand Down Expand Up @@ -480,7 +480,7 @@ ssize_t efa_rdm_rma_writemsg(struct fid_ep *ep,
if (err)
return err;

assert(msg->iov_count <= efa_rdm_ep->tx_iov_limit);
assert(msg->iov_count <= efa_rdm_ep->base_ep.info->tx_attr->iov_limit);

peer = efa_rdm_ep_get_peer(efa_rdm_ep, msg->addr);
assert(peer);
Expand Down

0 comments on commit 1ef91c8

Please sign in to comment.