In loadbalance runner, when a port with no carrier is added, the port's 'enabled' option should have been set false, so that it can change to other ports to send the packet.
This patch is to fix it by checking it in lb's watch_ops .port_added().
Signed-off-by: Xin Long lucien.xin@gmail.com --- teamd/teamd_runner_loadbalance.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/teamd/teamd_runner_loadbalance.c b/teamd/teamd_runner_loadbalance.c index 43b07af..a1e2130 100644 --- a/teamd/teamd_runner_loadbalance.c +++ b/teamd/teamd_runner_loadbalance.c @@ -40,6 +40,15 @@ static int lb_event_watch_port_added(struct teamd_context *ctx, tdport->ifname); return err; } + + if (!team_is_port_link_up(tdport->team_port)) { + err = team_set_port_enabled(ctx->th, tdport->ifindex, false); + if (err) { + teamd_log_err("%s: Failed to disable port.", + tdport->ifname); + return TEAMD_ENOENT(err) ? 0 : err; + } + } return teamd_balancer_port_added(lb->tb, tdport); }
Sun, Feb 26, 2017 at 04:17:12PM CET, lucien.xin@gmail.com wrote:
In loadbalance runner, when a port with no carrier is added, the port's 'enabled' option should have been set false, so that it can change to other ports to send the packet.
This patch is to fix it by checking it in lb's watch_ops .port_added().
Signed-off-by: Xin Long lucien.xin@gmail.com
Looking good. Since there is no port priv for loadbalance, makes sense to put this directly inside the even.
Applied.
Thanks!
libteam@lists.fedorahosted.org