diff mbox series

teamd/teamd_runner_lacp: lacp_port_set_state

Message ID 20180808102533.2886-1-mengkoon@live.com (mailing list archive)
State New
Headers show
Series teamd/teamd_runner_lacp: lacp_port_set_state | expand

Commit Message

Meng Koon Lim Aug. 8, 2018, 10:25 a.m. UTC
if new state is PORT_STATE_DEFAULTED, set lacp_port->partner.state
to 0x02

This ensures LACPDU is sent to update the far side when local
local port transitions from default to current

Currently, local port moves from default to current without
sending LACPDU until 30sec later. This causes traffic disruption
because far side has not completed negotiation

Using 0x02 also cause LACPDU to be sent every 1 sec as long as
port remains in defaulted state and LACP mode used is "active"
---
 teamd/teamd_runner_lacp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Meng Koon Lim Aug. 14, 2018, 6:58 a.m. UTC | #1
Hi Jiri,


Can review if this patch is suitable or suggest alternative patch?


To clarify, this issue happens when the remote side is configured with LACP slow, which causes no immediate LACPDU sent by teamd when it transits a port from "defaulted" to "current"

thanks
Meng Koon Lim
Meng Koon Lim Sept. 13, 2018, 1:53 p.m. UTC | #2
Hi Jiri,


Appreciate if you can review this


thanks

Meng Koon Lim
Meng Koon Lim Nov. 5, 2018, 6:44 a.m. UTC | #3
Please review and provide feedback on this patch

thank you
Jiri Pirko Nov. 5, 2018, 3:51 p.m. UTC | #4
Wed, Aug 08, 2018 at 12:25:33PM CEST, mengkoon@live.com wrote:
>if new state is PORT_STATE_DEFAULTED, set lacp_port->partner.state
>to 0x02
>
>This ensures LACPDU is sent to update the far side when local
>local port transitions from default to current
>
>Currently, local port moves from default to current without
>sending LACPDU until 30sec later. This causes traffic disruption
>because far side has not completed negotiation
>
>Using 0x02 also cause LACPDU to be sent every 1 sec as long as
>port remains in defaulted state and LACP mode used is "active"

Sorry for delay. This patch looks nice. Please re-send with signed off
tag, like:
Signed-off-by: MK Lim <mengkoon@live.com>

Thanks!
diff mbox series

Patch

diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index 7b8f0a7..555aa06 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -965,7 +965,12 @@  static int lacp_port_set_state(struct lacp_port *lacp_port,
 	case PORT_STATE_DEFAULTED:
 		teamd_loop_callback_disable(lacp_port->ctx,
 					    LACP_TIMEOUT_CB_NAME, lacp_port);
-		/* fall through */
+		memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
+		lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT;
+		err = lacp_port_partner_update(lacp_port);
+		if (err)
+			return err;
+		break;
 	case PORT_STATE_DISABLED:
 		memset(&lacp_port->partner, 0, sizeof(lacp_port->partner));
 		err = lacp_port_partner_update(lacp_port);