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

libhns: Cleanup and Bugfixes #1579

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

hginjgerx
Copy link

This PR contains some recent cleanup and bugfixes for libhns.

Junxian Huang and others added 3 commits March 13, 2025 19:03
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(
Copy link
Member

Choose a reason for hiding this comment

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

Just use min3() instead.

Copy link
Author

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

Copy link
Member

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)

Copy link
Author

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

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.

2 participants