aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSridhar Samudrala <sridhar.samudrala@intel.com>2015-07-23 15:49:33 -0700
committerJiri Pirko <jiri@resnulli.us>2015-07-24 10:23:19 +0200
commitb2de61b39696c9158e725a691aee5a6f16a64137 (patch)
treef93b3f4b4ca0d2df27d4db4152d0493d3114b793
parent5e445200f1441e0f217952fd308a3a714c20b65c (diff)
downloadlibteam-b2de61b39696c9158e725a691aee5a6f16a64137.tar.gz
Fix sending duplicate LACP frames at the start of establishing a logical channel.
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> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-rw-r--r--teamd/teamd_runner_lacp.c7
1 files changed, 6 insertions, 1 deletions
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)