Skip to content
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

prov/efa: Fix fi_sendmsg/fi_writemsg with FI_INJECT #10347

Merged
merged 2 commits into from
Aug 31, 2024

Conversation

jiaxiyan
Copy link
Contributor

Currently EFA provider doesn't handle the *msg call with FI_INJECT flags correctly. It allows user to pass in a buffer with valid MR while doing inject - outbound buffer should be reusable immediately after function returns.
That being said, without the inline HW support, EFA provider should do a copy from the user buffer to the internal bounce buffer even if application provides a valid MR for the buffer.
The inject rdma write path assumes the outbound buffer is always FI_HMEM_SYSTEM, but it doesn't have to.

prov/efa/src/rdm/efa_rdm_pke_utils.c Outdated Show resolved Hide resolved
prov/efa/src/rdm/efa_rdm_pke_utils.c Outdated Show resolved Hide resolved
@jiaxiyan jiaxiyan force-pushed the fi_inject branch 2 times, most recently from 0fbfa87 to c9c6b03 Compare August 28, 2024 20:50
Copy link
Contributor

@shijin-aws shijin-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some nits on the comments

* and we use 1st iov for header.
* 2. EFA can directly access the memory
* Note that FI_INJECT requires outbound buffer to be reusable
* immediately after function returns, so without the inline HW support,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rephrase the without the inline HW support, to unless using inline

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can we change EFA can directly access the memory to p2p is available or using inline here

@@ -61,34 +62,36 @@ ssize_t efa_rdm_pke_init_payload_from_ope(struct efa_rdm_pke *pke,
assert(tx_iov_index < ope->iov_count);
assert(tx_iov_offset < ope->iov[tx_iov_index].iov_len);
iov_mr = ope->desc[tx_iov_index];

p2p_available = false;
inline_send = false;
/* When using EFA device, EFA device can access memory that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are removing efa_can_access_memory, I think we can remove these comments, just explain how copy can be removed based on the p2p_available and inline_send status later.

Currently EFA provider doesn't handle the fi_sendmsg call with
FI_INJECT flags correctly. It allows user to pass in a buffer with
valid MR while doing inject - outbound buffer should be reusable
immediately after function returns.
That being said, without the inline HW support, EFA provider should
do a copy from the user buffer to the internal bounce buffer even
if application provides a valid MR for the buffer.

Signed-off-by: Jessie Yang <[email protected]>
fi_writemsg with FI_INJECT needs to copy from outbound buffer to
internal bounce buffer. The outbound buffer can be non-system.
Extract and call a helper function for device to host copy.

Signed-off-by: Jessie Yang <[email protected]>
@jiaxiyan
Copy link
Contributor Author

bot:aws:retest

1 similar comment
@shijin-aws
Copy link
Contributor

bot:aws:retest

@shijin-aws shijin-aws merged commit 1b3fb77 into ofiwg:main Aug 31, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants