Skip to content

Commit 61efd6d

Browse files
lxinJiri Pirko
authored and
Jiri Pirko
committed
Revert "teamd: Disregard current state when considering port enablement"
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 <jiri@nvidia.com>
1 parent 3ee12c6 commit 61efd6d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

teamd/teamd_per_port.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,18 @@ int teamd_port_check_enable(struct teamd_context *ctx,
442442
bool should_enable, bool should_disable)
443443
{
444444
bool new_enabled_state;
445+
bool curr_enabled_state;
445446
int err;
446447

447448
if (!teamd_port_present(ctx, tdport))
448449
return 0;
450+
err = teamd_port_enabled(ctx, tdport, &curr_enabled_state);
451+
if (err)
452+
return err;
449453

450-
if (should_enable)
454+
if (!curr_enabled_state && should_enable)
451455
new_enabled_state = true;
452-
else if (should_disable)
456+
else if (curr_enabled_state && should_disable)
453457
new_enabled_state = false;
454458
else
455459
return 0;

0 commit comments

Comments
 (0)