This issue can be seen with the following test script. It creates 2 net namespaces connected via a veth pair and then creates team over the veth interface in each namespace. tcpdump is run in background to collect the lacp frames. The trace shows 11 lacp frames exchanged with multiple duplicates within the first second.
================================================================================ #!/bin/bash
set -x set -e
# create 2 network namespaces: ns1 & ns2 ip netns add ns1 ip netns add ns2
# create veth pair (veth-ns1 and veth-ns2) ip link add veth-ns1 type veth peer name veth-ns2
# move veth-ns1 to ns1 ip link set veth-ns1 netns ns1
# move veth-ns2 to ns2 ip link set veth-ns2 netns ns2
# create and configure team-veth-ns1 in ns1 ip netns exec ns1 ./teamd -d -c '{"device": "team-veth-ns1", "hwaddr": "00:55:BB:BB:BB:01", "runner": {"name": "lacp", "active": true, "fast_rate": true}, "ports": {"veth-ns1": {}}}'
# capture lacp frames in ns1 ip netns exec ns1 tcpdump -w lacp.pcap -c 20 -n -i veth-ns1 -e ether proto 0x8809 &
# create and configure team-veth-ns2 ns2 ip netns exec ns2 ./teamd -d -c '{"device": "team-veth-ns2", "hwaddr": "00:55:BB:BB:BB:02", "runner": {"name": "lacp", "active": true, "fast_rate": true}, "ports": {"veth-ns2": {}}}'
sleep 10 ================================================================================
With this patch only 3 lacp frames are exchanged in the first second with no duplicates.
Signed-off-by: Sridhar Samudrala sridhar.samudrala@intel.com --- teamd/teamd_runner_lacp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c index b35e427..b34f057 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -903,6 +903,10 @@ static int lacp_port_actor_update(struct lacp_port *lacp_port) teamd_log_dbg("%s: lacp info state: 0x%02X.", lacp_port->tdport->ifname, state); lacp_port->actor.state = state; + + if (lacp_port->periodic_on) + return 0; + return lacpdu_send(lacp_port); }
@@ -1056,7 +1060,8 @@ static int lacpdu_recv(struct lacp_port *lacp_port) return err;
/* Check if the other side has correct info about us */ - if (memcmp(&lacpdu.partner, &lacp_port->actor, + if (!lacp_port->periodic_on && + memcmp(&lacpdu.partner, &lacp_port->actor, sizeof(struct lacpdu_info))) { err = lacpdu_send(lacp_port); if (err)
Fri, Jul 24, 2015 at 12:49:33AM CEST, sridhar.samudrala@intel.com wrote:
This issue can be seen with the following test script. It creates 2 net namespaces connected via a veth pair and then creates team over the veth interface in each namespace. tcpdump is run in background to collect the lacp frames. The trace shows 11 lacp frames exchanged with multiple duplicates within the first second.
================================================================================ #!/bin/bash
set -x set -e
# create 2 network namespaces: ns1 & ns2 ip netns add ns1 ip netns add ns2
# create veth pair (veth-ns1 and veth-ns2) ip link add veth-ns1 type veth peer name veth-ns2
# move veth-ns1 to ns1 ip link set veth-ns1 netns ns1
# move veth-ns2 to ns2 ip link set veth-ns2 netns ns2
# create and configure team-veth-ns1 in ns1 ip netns exec ns1 ./teamd -d -c '{"device": "team-veth-ns1", "hwaddr": "00:55:BB:BB:BB:01", "runner": {"name": "lacp", "active": true, "fast_rate": true}, "ports": {"veth-ns1": {}}}'
# capture lacp frames in ns1 ip netns exec ns1 tcpdump -w lacp.pcap -c 20 -n -i veth-ns1 -e ether proto 0x8809 &
# create and configure team-veth-ns2 ns2 ip netns exec ns2 ./teamd -d -c '{"device": "team-veth-ns2", "hwaddr": "00:55:BB:BB:BB:02", "runner": {"name": "lacp", "active": true, "fast_rate": true}, "ports": {"veth-ns2": {}}}'
sleep 10
With this patch only 3 lacp frames are exchanged in the first second with no duplicates.
Signed-off-by: Sridhar Samudrala sridhar.samudrala@intel.com
applied, thanks!
libteam@lists.fedorahosted.org