No LACPDUs received when port is enabled
by Jonas Johansson
Hi,
I have configured teamd witch the lacp runner. When a port has state
disabled, all LACPDU frames are received in lacpdu_recv(), but when LACP
has reached an agreement (state "current") the port will become enabled and
LACPDU frames are no longer received by the port. After the LACP timeout
the state will be changed to "expired" and the port will be disabled and
LACPDUs can be received again.
In the kernel driver, team.c, the team_handle_frame() will return
RX_HANDLER_EXACT when a port is disabled and RX_HANDLER_ANOTHER for an
enabled LACP port. This means that the a enabled port will divert all
traffic to the team device, which teamd (using lacp) isn't listening to.
I made a kernel patch which seems to work. Thoughts?
===================================================================
--- linux-3.13.3.orig/drivers/net/team/team_mode_loadbalance.c
2014-02-20 15:06:05.526217543 +0100
+++ linux-3.13.3/drivers/net/team/team_mode_loadbalance.c 2014-02-20
15:06:53.406215408 +0100
@@ -226,6 +226,17 @@
return false;
}
+static rx_handler_result_t lb_receive(struct team *team, struct team_port
*port,
+ struct sk_buff *skb)
+{
+ struct ethhdr *eth = eth_hdr(skb);
+
+ if (unlikely(ntohs(eth->h_proto) == ETH_P_SLOW))
+ return RX_HANDLER_EXACT;
+
+ return RX_HANDLER_ANOTHER;
+}
+
static int lb_bpf_func_get(struct team *team, struct team_gsetter_ctx *ctx)
{
struct lb_priv *lb_priv = get_lb_priv(team);
@@ -649,6 +660,7 @@
.port_leave = lb_port_leave,
.port_disabled = lb_port_disabled,
.transmit = lb_transmit,
+ .receive = lb_receive,
};
static const struct team_mode lb_mode = {
===================================================================
Jonas Johansson
9 years, 7 months
[PATCH] teamd: fixed couple comments.
by Flavio Leitner
It should say 'disabled' instead.
Signed-off-by: Flavio Leitner <fbl(a)redhat.com>
---
teamd/teamd_runner_activebackup.c | 2 +-
teamd/teamd_runner_lacp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/teamd/teamd_runner_activebackup.c b/teamd/teamd_runner_activebackup.c
index 7ed860f..b81f5d0 100644
--- a/teamd/teamd_runner_activebackup.c
+++ b/teamd/teamd_runner_activebackup.c
@@ -440,7 +440,7 @@ static int ab_port_added(struct teamd_context *ctx,
teamd_log_err("Failed to load port config.");
return err;
}
- /* Newly added ports are enabled */
+ /* Newly added ports are disabled */
err = team_set_port_enabled(ctx->th, tdport->ifindex, false);
if (err) {
teamd_log_err("%s: Failed to disable port.", tdport->ifname);
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 14f9473..1d35b52 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -1221,7 +1221,7 @@ static int lacp_port_added(struct teamd_context *ctx,
goto periodic_callback_del;
}
- /* Newly added ports are enabled */
+ /* Newly added ports are disabled */
err = team_set_port_enabled(ctx->th, tdport->ifindex, false);
if (err) {
teamd_log_err("%s: Failed to disable port.", tdport->ifname);
--
1.8.5.3
9 years, 7 months
[PATCH] teamd: update hwaddr when changing team's macaddr
by Flavio Leitner
This patch updates hwaddr which is used by LACP runner
to set all ports macaddr.
Signed-off-by: Flavio Leitner <fbl(a)redhat.com>
---
teamd/teamd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd.c b/teamd/teamd.c
index da11f5f..d1e335b 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -875,7 +875,7 @@ static int teamd_add_ports(struct teamd_context *ctx)
static int teamd_hwaddr_check_change(struct teamd_context *ctx,
struct teamd_port *tdport)
{
- const char *hwaddr;
+ char *hwaddr;
unsigned char hwaddr_len;
int err;
@@ -893,6 +893,7 @@ static int teamd_hwaddr_check_change(struct teamd_context *ctx,
teamd_log_err("Failed to set team device hardware address.");
return err;
}
+ ctx->hwaddr = hwaddr;
return 0;
}
--
1.8.5.3
9 years, 7 months
[PATCH] redhat: fix boolean types in example 2
by Flavio Leitner
The man-page says runner.active and runner.fast_rate
are boolean types. So, change them from '1' to 'true'.
Signed-off-by: Flavio Leitner <fbl(a)redhat.com>
---
teamd/redhat/example_ifcfgs/2/ifcfg-team_test0 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/teamd/redhat/example_ifcfgs/2/ifcfg-team_test0 b/teamd/redhat/example_ifcfgs/2/ifcfg-team_test0
index 19b5e06..56e48da 100644
--- a/teamd/redhat/example_ifcfgs/2/ifcfg-team_test0
+++ b/teamd/redhat/example_ifcfgs/2/ifcfg-team_test0
@@ -4,4 +4,4 @@ ONBOOT="yes"
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.23.11
-TEAM_CONFIG='{"runner": {"name": "lacp", "active": 1, "fast_rate": 1, "tx_hash": ["eth", "ipv4", "ipv6"]},"link_watch": {"name": "ethtool"}}'
+TEAM_CONFIG='{"runner": {"name": "lacp", "active": true, "fast_rate": true, "tx_hash": ["eth", "ipv4", "ipv6"]},"link_watch": {"name": "ethtool"}}'
--
1.8.5.3
9 years, 7 months