[action] [PR:14084] Fix issue: wrong teamd link watch state after warm reboot#14575
Merged
mssonicbld merged 1 commit intosonic-net:202211from Apr 8, 2023
Merged
Conversation
…14084) #### Why I did it Fix issue: wrong teamd link watch state after warm reboot due to TEAM_ATTR_PORT_CHANGED lost The flag TEAM_ATTR_PORT_CHANGED is maintained by kernel team driver: - a flag "changed" is maintained in struct team_port struct - the flag is set by __team_port_change_send once relevant information is updated, including port linkup (together with speed, duplex), adding or removing - the flag is cleared by team_nl_fill_one_port_get once the updated information has been notified to user space via RTNL In the userspace, the change flag is maintained by libteam in struct team_port. The team daemon calls port_priv_change_handler_func on receiving port change event. The logic in port_priv_change_handler_func 1. creates the port if it did not exist, which triggers port add event and eventually calls lacp_port_added callback. 2. triggers port change event if team_port->changed is true, which eventually calls lw_ethtool_event_watch_port_changed to update port state for link watch ethtool. 3. removes the port if team_port->removed is removed In lacp_port_added, it calls team_refresh to refresh ifinfo, port info, and option info from the kernel via RTNL. In this step, port_priv_change_handler_func is called recursively. - In the inner call, it won't get TEAM_ATTR_PORT_CHANGED flag because kernel has already notified that. - As a result, team_port->changed flag is cleared in the libteam. - The port change event won't be triggered from either inner or outer call of port_priv_change_handler_func. If the port has been up when the port is being added to the team device, the "port up" information is carried in the outer call but will be lost. In case the flag TEAM_ATTR_PORT_CHANGED is set only in the inner call, function port_priv_change_handler_func can be called in the inner call. However, it will fail to fetch "enable" options because option_list_init has not be called. Signed-off-by: Stephen Sun <[email protected]> #### How I did it Fix: Do not call check_call_change_handlers when parsing RTNL function is called from another check_call_change_handlers recursively. #### How to verify it - Manually test - Regression test - warm reboot - warm reboot sad lag - warm reboot sad lag member - warm reboot sad (partial)
8 tasks
Collaborator
Author
|
Original PR: #14084 |
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.
No description provided.