-
Notifications
You must be signed in to change notification settings - Fork 444
prov/efa: Fail early in rma when > 1 iov is passed #11429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shijin-aws
wants to merge
1
commit into
ofiwg:main
Choose a base branch
from
shijin-aws:rdma_iov_limit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+109
−2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ static void test_efa_rma_prep(struct efa_resource *resource, fi_addr_t *addr) | |
base_ep = container_of(resource->ep, struct efa_base_ep, util_ep.ep_fid); | ||
/* Add rma caps explicitly to ep->info to allow local test */ | ||
base_ep->info->caps |= FI_RMA; | ||
/* Mock the max rdma sge to allow local test */ | ||
base_ep->domain->device->ibv_attr.max_sge_rd = EFA_DEVICE_MAX_RDMA_SGE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you really want to test your minimum you shuold put a larger value |
||
/* Set up the mock operations */ | ||
g_efa_unit_test_mocks.efa_qp_post_recv = &efa_mock_efa_qp_post_recv_return_mock; | ||
g_efa_unit_test_mocks.efa_qp_wr_complete = &efa_mock_efa_qp_wr_complete_no_op; | ||
|
@@ -299,3 +301,63 @@ void test_efa_rma_writemsg_with_inject(struct efa_resource **state) | |
|
||
efa_unit_test_buff_destruct(&local_buff); | ||
} | ||
|
||
void test_efa_rma_readv_multiple_iov_fail(struct efa_resource **state) | ||
{ | ||
struct efa_resource *resource = *state; | ||
struct efa_unit_test_buff local_buff1, local_buff2; | ||
struct iovec iov[2]; | ||
fi_addr_t src_addr; | ||
void *desc[2]; | ||
int ret; | ||
uint64_t remote_addr = 0x87654321; | ||
uint64_t remote_key = 123456; | ||
|
||
test_efa_rma_prep(resource, &src_addr); | ||
efa_unit_test_buff_construct(&local_buff1, resource, 2048); | ||
efa_unit_test_buff_construct(&local_buff2, resource, 2048); | ||
|
||
iov[0].iov_base = local_buff1.buff; | ||
iov[0].iov_len = local_buff1.size; | ||
iov[1].iov_base = local_buff2.buff; | ||
iov[1].iov_len = local_buff2.size; | ||
desc[0] = fi_mr_desc(local_buff1.mr); | ||
desc[1] = fi_mr_desc(local_buff2.mr); | ||
|
||
ret = fi_readv(resource->ep, iov, desc, 2, src_addr, remote_addr, | ||
remote_key, NULL); | ||
assert_int_equal(ret, -FI_EOPNOTSUPP); | ||
|
||
efa_unit_test_buff_destruct(&local_buff1); | ||
efa_unit_test_buff_destruct(&local_buff2); | ||
} | ||
|
||
void test_efa_rma_writev_multiple_iov_fail(struct efa_resource **state) | ||
{ | ||
struct efa_resource *resource = *state; | ||
struct efa_unit_test_buff local_buff1, local_buff2; | ||
struct iovec iov[2]; | ||
fi_addr_t dest_addr; | ||
void *desc[2]; | ||
int ret; | ||
uint64_t remote_addr = 0x87654321; | ||
uint64_t remote_key = 123456; | ||
|
||
test_efa_rma_prep(resource, &dest_addr); | ||
efa_unit_test_buff_construct(&local_buff1, resource, 2048); | ||
efa_unit_test_buff_construct(&local_buff2, resource, 2048); | ||
|
||
iov[0].iov_base = local_buff1.buff; | ||
iov[0].iov_len = local_buff1.size; | ||
iov[1].iov_base = local_buff2.buff; | ||
iov[1].iov_len = local_buff2.size; | ||
desc[0] = fi_mr_desc(local_buff1.mr); | ||
desc[1] = fi_mr_desc(local_buff2.mr); | ||
|
||
ret = fi_writev(resource->ep, iov, desc, 2, dest_addr, remote_addr, | ||
remote_key, NULL); | ||
assert_int_equal(ret, -FI_EOPNOTSUPP); | ||
|
||
efa_unit_test_buff_destruct(&local_buff1); | ||
efa_unit_test_buff_destruct(&local_buff2); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be called from
efa_data_path_direct_wr_set_sge_list
or adjacent to the calls to this function since 1) it's directly related to WQE format, 2) we should avoid enforcing Libfabric hardcoded limits when using rdma-core data path.