-
Notifications
You must be signed in to change notification settings - Fork 4k
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
allow IOBuf::append_user_data_with_meta to specify the lkey of rdma memory region #2005
Conversation
|
… rdma memory region
uint64_t meta) { | ||
if (size == 0) { | ||
LOG(WARNING) << "data_size should not be 0"; | ||
return -1; |
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.
Did size == 0
have any side effect? If not, can we return 0 here?
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.
This should be unexpected. return -1 is a better choice.
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.
@Tuvie Return 0 has been merged into master
https://github.com/apache/incubator-brpc/blob/b788325528d886639e66aa0d46c571c163ec959a/src/butil/iobuf.cpp#L1214-L1220
LGTM |
@wwbmmm is this PR qualified to be merged? It seems that the Travis often fails due to some irrelevant reason. |
Has resolved conflict. Any plan to merge? |
What problem does this PR solve?
Issue Number: 1995
Problem Summary: When using IOBuf::append_user_data, if the application specify a buffer with an offset over the base address registered with rdma::RegisterMemoryForRdma, brpc reports a failure for invalid memory region.
What is changed and the side effects?
Changed: Add a new function named append_user_data_with_meta in IOBuf. Allow application specifying the lkey as meta to explicitly inform brpc. This removes the necessity to lookup the lkey for the IOBuf Block in rpc processing.
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性): To store the meta/lkey in IOBuf Block, the portal_next field is reused when flags is non-0. It is acceptable because portal_next is only used for tls cache of IOBuf, which does not work for user defined Blocks.
Check List: