-
Notifications
You must be signed in to change notification settings - Fork 725
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
libhns: Cleanup and Bugfixes #1579
base: master
Are you sure you want to change the base?
Conversation
Clean up mixed signed/unsigned type issues. Fix a wrong format character as well. Fixes: cf6d914 ("libhns: Introduce hns direct verbs") Signed-off-by: Junxian Huang <[email protected]>
When cap.max_inline_data is 0, it will be modified to 1 since roundup_pow_of_two(0) == 1, which violates users' expectations. Here fix it. Fixes: 2aff0d5 ("libhns: Fix the problem of sge nums") Signed-off-by: wenglianfa <[email protected]> Signed-off-by: Junxian Huang <[email protected]>
The spin_unlock order should be the reverse of spin_lock order. Fixes: 179f015 ("libhns: Add support for lock-free QP") Signed-off-by: Junxian Huang <[email protected]>
@@ -1307,9 +1317,7 @@ static void set_ext_sge_param(struct hns_roce_context *ctx, | |||
attr->cap.max_send_sge); | |||
|
|||
if (ctx->config & HNS_ROCE_RSP_EXSGE_FLAGS) { | |||
attr->cap.max_inline_data = min_t(uint32_t, roundup_pow_of_two( |
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.
Just use min3() instead.
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.
Just use min3() instead.
Sorry I don't get it. Only two values are compared 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.
min3(attr->cap.max_inline_data, roundup_pow_of_two(attr->cap.max_inline_data), ctx->max_inline_data)
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.
min3(attr->cap.max_inline_data, roundup_pow_of_two(attr->cap.max_inline_data), ctx->max_inline_data)
This is wrong when attr->cap.max_inline_data is not power of 2
This PR contains some recent cleanup and bugfixes for libhns.