-
Notifications
You must be signed in to change notification settings - Fork 431
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
GTEST: Refactored protocol selection mock #10369
base: master
Are you sure you want to change the base?
Conversation
UCS_MOCK_ORIG_FUNC(m_self->m_mock, &m_self->m_tl->query_devices, md, | ||
tl_devices_p, num_tl_devices_p); | ||
if (*num_tl_devices_p == 0) { | ||
return UCS_OK; |
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.
return UCS_OK; | |
return UCS_ERR_NO_DEVICE; |
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.
It's a normal situation when query returns 0 devices, and original function returns UCS_OK in this case.
tmp = (uct_tl_device_resource_t *)ucs_malloc( | ||
sizeof(*tmp) * size,"mock_tl_devices"); |
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.
tmp = (uct_tl_device_resource_t *)ucs_malloc( | |
sizeof(*tmp) * size,"mock_tl_devices"); | |
auto tmp = (uct_tl_device_resource_t *)ucs_malloc( | |
sizeof(*tmp) * size, "mock_tl_devices"); |
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.
Ok, applied with some other changes to make compiler happy
sizeof(*tmp) * size,"mock_tl_devices"); | ||
ucs_sys_device_t sys_dev = 1; | ||
unsigned i = 0; | ||
for (auto & it : m_self->m_iface_attrs_funcs) { |
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.
for (auto & it : m_self->m_iface_attrs_funcs) { | |
for (const auto &it : m_self->m_iface_attrs_funcs) { |
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.
done
What?
This PR contains enhancements of the original protocol selection mock (#9989):
rc_mlx5/mock_0:1 50% on path0 and 50% on path1
)Finally all those changes are needed to reproduce real protocol selection issues (like https://redmine.mellanox.com/issues/4177809, https://redmine.mellanox.com/issues/4134043)