From patchwork Wed Nov 7 13:09:15 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: 10672333 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 EE6D813AD for ; Wed, 7 Nov 2018 13:09:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB0AE2BAA8 for ; Wed, 7 Nov 2018 13:09:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC9642BAAE; Wed, 7 Nov 2018 13:09:35 +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=-5.5 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SUBJ_OBFU_PUNCT_FEW,SUBJ_OBFU_PUNCT_MANY 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 657D62BAA8 for ; Wed, 7 Nov 2018 13:09:35 +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 8CF2F63F6D3F; Wed, 7 Nov 2018 13:09:34 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org 8CF2F63F6D3F Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 8438E2569BB2B; Wed, 7 Nov 2018 13:09:34 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 43F282569BB2B; Wed, 7 Nov 2018 13:09:31 +0000 (UTC) Received: from smtp-mm-ib01.fedoraproject.org (smtp-mm-ib01.vpn.fedoraproject.org [192.168.1.83]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id D80C72569BB29 for ; Wed, 7 Nov 2018 13:09:30 +0000 (UTC) Received: from 8c8590b355e5.ant.amazon.com (unknown [118.200.90.214]) by smtp-mm-ib01.fedoraproject.org (Postfix) with ESMTP id 4AB3D605D2E1 for ; Wed, 7 Nov 2018 13:09:30 +0000 (UTC) Received: by 8c8590b355e5.ant.amazon.com (Postfix, from userid 587976549) id 3626C13F1CB9; Wed, 7 Nov 2018 21:09:17 +0800 (+08) From: Meng Koon Lim To: libteam@lists.fedorahosted.org Subject: [patch libteam] teamd_runner_lacp.c : send LACPDU when port state transitions from DEFAULT to CURRENT Date: Wed, 7 Nov 2018 21:09:15 +0800 Message-Id: <20181107130915.74516-1-mengkoon@live.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) Message-ID-Hash: XKYONPH7CP45GJVJZOJFMVQAUXLX6AW5 X-Message-ID-Hash: XKYONPH7CP45GJVJZOJFMVQAUXLX6AW5 X-MailFrom: menglim@8c8590b355e5.ant.amazon.com 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: Meng Koon 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 Currently, when local port state become DEFAULTED, its Partner_State field is set to 0x00 Bit 1 in Actor_State and Partner_State field is for LACP_Timeout. When set, it means LACP fast is used. If teamd_runner_lacp receives an LACPDU with Actor_State field bit 1 set, it transitions local port to CURRENT, and transmits LACPDU If teamd_runner_lacp receives an LACPDU without Actor_State field bit 1 set, it transitions local port to CURRENT, but does not transmit LACPDU The second scenario results in teamd starting data transmission when partner port remains in either Defaulted or Expired state, causing packets to be dropped by partner This is fixed by setting Partner_State field to 0x02 on the local port when local port state transitions to DEFAULTED Signed-off-by: Meng Koon 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);