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

fix huge rdma_recv_block_type no effect issue. #2326

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

legionxiong
Copy link
Contributor

@legionxiong legionxiong commented Jul 24, 2023

It has no effect for huge type of recv_block_size
which is as large as 2^21, because the block_size
variable is defined as type uint16_t, its maximum
value is 2^16. So, change the type of block_size
to uint32_t with relevant updates.

What problem does this PR solve?

Issue Number:

Problem Summary:

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

static const size_t HELLO_MSG_LEN_MAX = 4096;
static const size_t ACK_MSG_LEN = 4;
static uint16_t g_rdma_hello_msg_len = 38; // In Byte
static uint16_t g_rdma_hello_msg_len = 40; // In Byte
static uint16_t g_rdma_hello_version = 1;
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 modify the hello message format, we should change the hello version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@legionxiong legionxiong changed the title fix huge rdma_recv_block_type unavailable issue. fix huge rdma_recv_block_type no effect issue. Jul 28, 2023
@@ -203,7 +203,7 @@ TEST_F(RdmaTest, client_hello_msg_invalid_magic_str) {
Socket* s = GetSocketFromServer(0);
ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, s->_rdma_ep->_state);

uint8_t data[38];
uint8_t data[40];
Copy link
Contributor

Choose a reason for hiding this comment

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

use named constant instead of 40

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

It has no effect for `huge` type of recv_block_size
which is as large as 2^21, because the `block_size`
variable is defined as type `uint16_t`, its maximum
value is 2^16. So, change the type of `block_size`
to `uint32_t` with relevant updates.

Signed-off-by: Lijin Xiong <lijin.xiong@zstack.io>
@wwbmmm
Copy link
Contributor

wwbmmm commented Aug 30, 2023

LGTM

@wwbmmm wwbmmm merged commit d142274 into apache:master Oct 25, 2023
16 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