From patchwork Wed Aug 8 10:25:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Koon Lim X-Patchwork-Id: 10559725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6EAA514E5 for ; Wed, 8 Aug 2018 10:25:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C8F62AA09 for ; Wed, 8 Aug 2018 10:25:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50C842AA1D; Wed, 8 Aug 2018 10:25:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from bastion.fedoraproject.org (bastion01.fedoraproject.org [209.132.181.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3AFA2AA09 for ; Wed, 8 Aug 2018 10:25:50 +0000 (UTC) Received: from mailman01.phx2.fedoraproject.org (mailman01.phx2.fedoraproject.org [10.5.126.36]) by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id 6A7E262B8332; Wed, 8 Aug 2018 10:25:48 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org 6A7E262B8332 Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 6052022113F38; Wed, 8 Aug 2018 10:25:48 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 2853022113F38; Wed, 8 Aug 2018 10:25:45 +0000 (UTC) Received: from smtp-mm-osuosl01.fedoraproject.org (smtp-mm-osuosl01.vpn.fedoraproject.org [192.168.1.23]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id B767822113F37 for ; Wed, 8 Aug 2018 10:25:44 +0000 (UTC) Received: from reireis-MBP.localdomain (unknown [118.200.90.214]) by smtp-mm-osuosl01.fedoraproject.org (Postfix) with ESMTP id 363D298069 for ; Wed, 8 Aug 2018 10:25:44 +0000 (UTC) Received: by reireis-MBP.localdomain (Postfix, from userid 501) id 6A9753567D1; Wed, 8 Aug 2018 18:25:38 +0800 (+08) From: MK Lim To: libteam@lists.fedorahosted.org Subject: [patch libteam] teamd/teamd_runner_lacp: lacp_port_set_state Date: Wed, 8 Aug 2018 18:25:33 +0800 Message-Id: <20180808102533.2886-1-mengkoon@live.com> X-Mailer: git-send-email 2.15.1 (Apple Git-101) Message-ID-Hash: XZZ4JRBNY5V77BOQS6TFSCIYMT7ZK4LQ X-Message-ID-Hash: XZZ4JRBNY5V77BOQS6TFSCIYMT7ZK4LQ X-MailFrom: reirei@reireis-MBP.localdomain X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: MK Lim , jiri@resnulli.us X-Mailman-Version: 3.1.1 Precedence: list List-Id: Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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" Signed-off-by: MK Lim --- 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);