>attachment is the scripts,
>
># ./setup.sh
># ip netns exec ns1 ./team1.sh
># ./team0.sh
># ping 192.168.11.3
>
>the issue is team0 cannot switch to veth2, even if the veth0 has no carrier.
>
>> This should be definitelly fixed in user part.
>now it can disable/enable it in lw_ethtool_event_watch_port_changed()
>when receive event from kernel, but at the beginning, the first event from
>adding port will not going to team_port_en_option_set, as new_link_up
>== common_ppriv->link_up in lw_ethtool_event_watch_port_changed().
>
>maybe it should be fixed there ?
Yes please.
Hi, Jiri,
considering this issue only happens when adding ports,
I found two places to fix it:
lw_ethtool_port_added() and link_watch_event_watch_port_added()
I prefer in lw_ethtool_port_added(), as only when using ethtool link_watch it
has this issue.
--- a/teamd/teamd_lw_ethtool.c
+++ b/teamd/teamd_lw_ethtool.c
@@ -156,6 +156,9 @@ static int lw_ethtool_port_added(struct teamd_context *ctx,
teamd_log_err("Failed to register event watch.");
goto delay_callback_del;
}
+ if (!team_is_port_link_up(tdport->team_port))
+ team_set_port_enabled(ctx->th, tdport->ifindex, false);
+
return 0;
what do you think ?
I also noticed another issue (not related to this one), at the first time
port_changed event is triggered, right after port_added event, there
is always a err log:
veth2: Failed to find "enabled" option.
It's from:
lw_ethtool_event_watch_port_changed -> ...
teamd_port_check_enable -> teamd_port_enabled
it's because at that time, no 'enabled' option is set in userspace yet.
do you think it's also a bug ?