Please review and provide feedback on this patch

thank you


From: Meng Koon Lim <mengkoon@live.com>
Sent: Thursday, September 13, 2018 9:53 PM
To: libteam@lists.fedorahosted.org
Cc: jiri@resnulli.us
Subject: Re: [patch libteam] teamd/teamd_runner_lacp: lacp_port_set_state
 

Hi Jiri,


Appreciate if you can review this


thanks

Meng Koon Lim




From: Meng Koon Lim <mengkoon@live.com>
Sent: Tuesday, August 14, 2018 2:58 PM
To: libteam@lists.fedorahosted.org
Cc: jiri@resnulli.us
Subject: Re: [patch libteam] teamd/teamd_runner_lacp: lacp_port_set_state
 

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


From: MK Lim <mengkoon@live.com>
Sent: Wednesday, August 8, 2018 6:25 PM
To: libteam@lists.fedorahosted.org
Cc: jiri@resnulli.us; MK Lim
Subject: [patch libteam] teamd/teamd_runner_lacp: lacp_port_set_state
 
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(-)

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);
--
2.15.1 (Apple Git-101)