On 31 July 2018 at 20:14, Jiri Pirko <jiri(a)resnulli.us> wrote:
Thu, Jul 19, 2018 at 04:04:48AM CEST, liuhangbin(a)gmail.com wrote:
>When multi interfaces up, there is a possibility that the link states
>notification came later after interface up, which cause the master_ifindex
>not update timely. Then the teamd_port_present() checking in
>ab_link_watch_handler() -> teamd_for_each_tdport() -> teamd_get_next_tdport()
>will failed and we will not set the active port.
I don't understand this para. Could you please re-phrase? It would help
me understand what is this about. Thanks!
If you configure two active-backup teams, one slave each, put them
down and up in a loop and test traffic each loop, eventually one of
the teams will not accept/transmit traffic as there is no active port.
Like this:
#!/bin/bash
WAIT=2
COUNT=0
while :; do
echo "-----------------------------------------------------------"
let "COUNT++"
echo "Loop $COUNT"
for ADDR in "10.0.1.1" "10.0.2.1"; do
if ! ping -q -W1 -c1 "$ADDR" >/dev/null 2>&1; then
echo "FAIL on $ADDR"
echo
for TEAM in team1 team2; do teamdctl "$TEAM" state dump |
egrep "active_port|\"pid\""; done
exit 1
else
echo "Pass on $ADDR"
fi
done
nmcli con down team1 &
nmcli con down team2 &
sleep "$WAIT"
nmcli con up team1 &
nmcli con up team2 &
sleep "$WAIT"
done
Failure as follows:
# teamdctl teamX state dump
"runner": {
"active_port": ""
},
This happens because teamd_port_present() fails in the codepath
Hangbin described above, so the teamd_for_each_tdport() for loop can
never run against the tdports bound to the ctx and a port is never set
active. The tdport is on the ctx port_obj_list at the time.
>Fix it by adding a new teamd_event_watch_ops
port_master_ifindex_changed for
>ab mode.
Other modes are not affected?
I could not reproduce with broadcast or roundrobin runners.
Jamie