Skip to content

Commit

Permalink
Revert "teamd: Disregard current state when considering port enablement"
Browse files Browse the repository at this point in the history
This reverts commit deadb5b.

As Patrick noticed, with that commit, teamd_port_check_enable()
would set the team port to the new state unconditionally, which
triggers another change message from kernel to userspace, then
teamd_port_check_enable() is called again to set the team port
to the new state.

This would go around and around to update the team port state,
and even cause teamd to consume 100% cpu.

As the issue caused by that commit is serious, it has to be
reverted. As for the issued fixed by that commit, I would
propose a new fix later.

Signed-off-by: Jiri Pirko <[email protected]>
  • Loading branch information
lxin authored and Jiri Pirko committed Sep 2, 2020
1 parent 3ee12c6 commit 61efd6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions teamd/teamd_per_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,18 @@ int teamd_port_check_enable(struct teamd_context *ctx,
bool should_enable, bool should_disable)
{
bool new_enabled_state;
bool curr_enabled_state;
int err;

if (!teamd_port_present(ctx, tdport))
return 0;
err = teamd_port_enabled(ctx, tdport, &curr_enabled_state);
if (err)
return err;

if (should_enable)
if (!curr_enabled_state && should_enable)
new_enabled_state = true;
else if (should_disable)
else if (curr_enabled_state && should_disable)
new_enabled_state = false;
else
return 0;
Expand Down

1 comment on commit 61efd6d

@ouxlwhu
Copy link

Choose a reason for hiding this comment

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

"As for the issued fixed by that commit, I would propose a new fix later."
--Hello, is there any new fix for issue that commit deadb5b try to fix

Please sign in to comment.