Skip to content

Commit 765272e

Browse files
committed
prov/efa: Fix inccorect assertions in efa protocol
Allow user to pass in null buff/null descriptor for efa-protocol for read/write without hitting an assert. Signed-off-by: Seth Zegelstein <szegel@amazon.com>
1 parent c407ea4 commit 765272e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

prov/efa/src/rdm/efa_rdm_ope.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,11 @@ int efa_rdm_ope_post_read(struct efa_rdm_ope *ope)
13821382

13831383
ep = ope->ep;
13841384

1385-
assert(ope->iov_count > 0 && ope->iov_count <= efa_rdm_ep_domain(ep)->info->tx_attr->iov_limit);
1385+
/*
1386+
* Allow local iov count to be equal to 0 b/c bounce buffer's pre-registered buff/desc
1387+
* will be passed to rdma-core
1388+
*/
1389+
assert((ope->iov_count == 0 && ope->bytes_read_total_len == 0) || ope->iov_count <= efa_rdm_ep_domain(ep)->info->tx_attr->iov_limit);
13861390
assert(ope->rma_iov_count > 0 && ope->rma_iov_count <= efa_rdm_ep_domain(ep)->info->tx_attr->rma_iov_limit);
13871391

13881392
if (ope->bytes_read_total_len == 0) {
@@ -1527,7 +1531,11 @@ int efa_rdm_ope_post_remote_write(struct efa_rdm_ope *ope)
15271531

15281532
ep = ope->ep;
15291533

1530-
assert(ope->iov_count > 0 && ope->iov_count <= efa_rdm_ep_domain(ep)->info->tx_attr->iov_limit);
1534+
/*
1535+
* Allow local iov count to be equal to 0 b/c bounce buffer's pre-registered buff/desc
1536+
* will be passed to rdma-core
1537+
*/
1538+
assert((ope->iov_count == 0 && ope->bytes_write_total_len == 0) || ope->iov_count <= efa_rdm_ep_domain(ep)->info->tx_attr->iov_limit);
15311539
assert(ope->rma_iov_count > 0 && ope->rma_iov_count <= efa_rdm_ep_domain(ep)->info->tx_attr->rma_iov_limit);
15321540

15331541
if (ope->bytes_write_total_len == 0) {

0 commit comments

Comments
 (0)