Repository navigation
UCT/IB: speed change event bug fix - #11710
Merged
Merged
Conversation
…e speed_change_event IBV_EVENT_DEVICE_SPEED_CHANGE event is popped from the UCT worker progress queue. ucp_worker_progress() does not acquire the worker async lock in SINGLE mode, while ucp_worker_iface_handle_port_speed_event() checks the lock to be held, which causes an assertion failure. This commit explicitly blocks the worker async context. Signed-off-by: Zhenlong Ma <mazhenlong321@gmail.com>
ZhenlongMa
marked this pull request as ready for review
July 31, 2026 12:37
UCX receives IBV_EVENT_PORT_SPEED_CHANGE event and adjust the speed accordingly, but rdma-core actually provides IBV_EVENT_DEVICE_SPEED_CHANGE event carrying port number zero, which cannot trigger the speed adjust logic of UCX. This commit adds support for IBV_EVENT_DEVICE_SPEED_CHANGE and keeps compatible with IBV_EVENT_PORT_SPEED_CHANGE. Signed-off-by: Zhenlong Ma <mazhenlong321@gmail.com>
ZhenlongMa
force-pushed
the
bug-fix/speed_change_event
branch
from
August 2, 2026 02:46
935c294 to
d76e886
Compare
Contributor
|
@iyastreb please review |
iyastreb
reviewed
Aug 3, 2026
| # define UCT_IB_SPEED_CHANGE_EVENT_DEVICE_SCOPE 1 | ||
| # define UCT_IB_SPEED_CHANGE_EVENT_NUM_RESOURCES(_n) 1 | ||
| # define UCT_IB_SPEED_CHANGE_EVENT_RESOURCE_ID(_port) 0 | ||
| #elif HAVE_DECL_IBV_EVENT_PORT_SPEED_CHANGE |
Contributor
There was a problem hiding this comment.
Does it make sense to still support PORT_SPEED_CHANGE?
IIUC rdma-core implemented support for device, so port speed change is obsolete?
I think this block can be greatly simplified if we keep only device
You can confirm with Or Har-Toov
ZhenlongMa
marked this pull request as draft
August 4, 2026 06:43
Signed-off-by: Zhenlong Ma <mazhenlong321@gmail.com>
…progress queue and don't raise assertion failure in case device change events arrive frequently. Signed-off-by: Zhenlong Ma <mazhenlong321@gmail.com>
…nger supported. Signed-off-by: Zhenlong Ma <mazhenlong321@gmail.com>
ZhenlongMa
marked this pull request as ready for review
August 7, 2026 11:06
iyastreb
reviewed
Aug 7, 2026
iyastreb
left a comment
Contributor
There was a problem hiding this comment.
LGTM apart from minor comments
Signed-off-by: Zhenlong Ma <mazhenlong321@gmail.com>
ZhenlongMa
force-pushed
the
bug-fix/speed_change_event
branch
from
August 7, 2026 13:46
04cf815 to
3e2917c
Compare
iyastreb
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Add support for IBV_EVENT_DEVICE_SPEED_CHANGE, the device-scoped speed change event emitted by rdma-core, and fix assertion failures triggered when the event is handled in SINGLE threading mode and when multiple events arrive quickly.
Why?
In #11056, UCX introduced an event IBV_EVENT_PORT_SPEED_CHANGE to detect link speed changes and adjust bandwidth accordingly. However, rdma-core actually emits IBV_EVENT_DEVICE_SPEED_CHANGE (a device-scoped event with port_num == 0) instead of the port-scoped variant. As a result, #11056 actually can't work.
Besides, in SINGLE threading mode, ucp_worker_progress() does not acquire the worker async lock, but ucp_worker_iface_handle_port_speed_event() asserts the lock is held, causing an assertion failure when the event is triggered.
When multiple events arrive quickly, such as link is down and recovered at once, the callback of the previous event has not been processed but the scheduler asserts the callback should be NULL when the latter event arrives and a failure is reported.
How?
Replace the macro IBV_EVENT_PORT_SPEED_CHANGE with IBV_EVENT_DEVICE_SPEED_CHANGE, and change the event's resource id to 0 instead of port num.
Wrap the ucp_worker_iface_handle_port_speed_event() call in UCS_ASYNC_BLOCK / UCS_ASYNC_UNBLOCK to explicitly hold the worker async context, satisfying the lock assertion regardless of the threading mode.
In the callback scheduler, if the callback is null, just return without assertion.