From patchwork Mon May 11 20:06:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shirshov X-Patchwork-Id: 11541641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9EAE92A for ; Mon, 11 May 2020 20:07:21 +0000 (UTC) Received: from bastion.fedoraproject.org (bastion01.fedoraproject.org [209.132.181.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A77A2206F5 for ; Mon, 11 May 2020 20:07:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A77A2206F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=libteam-bounces@lists.fedorahosted.org Received: from mailman01.phx2.fedoraproject.org (mailman01.phx2.fedoraproject.org [10.5.126.36]) by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id C0B0660D5B87; Mon, 11 May 2020 20:07:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org C0B0660D5B87 Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id B89845DCB3019; Mon, 11 May 2020 20:07:20 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 308BB5DCB3018; Mon, 11 May 2020 20:07:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mailman01.phx2.fedoraproject.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=disabled version=3.4.0 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 A7A925DCB300B for ; Mon, 11 May 2020 20:07:14 +0000 (UTC) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by smtp-mm-osuosl01.fedoraproject.org (Postfix) with ESMTPS id 6BF8298059 for ; Mon, 11 May 2020 20:07:14 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id d184so5239957pfd.4 for ; Mon, 11 May 2020 13:07:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=U8FS74uq2PE5mRA0JJTFiZII0aGCFuLo9h9x8tF+JBg=; b=YGfhu0WQX94gPuue/B8o2dbNBJuhIhmgsAh00DdZRbCiE/cz/NiQYXoGZGQ77TD/h7 0xS07oIkGeEB4nUw0KUWmoQRDWeN1AAdcX5kGZzZvA+cdXwllrhX5FiEpdOdble54tf7 QV8w3G5b7JaYILmiwNHB3OgDi5mNhK07cc8DQQkDNYZKumgMPBOHqi51+7mt7VJpM5o7 OmTXdAQcoUaCPH7ZB1mdTpJ2hEqy7JupiPrzBr87CAYi7I+I27GkFqzEkFgk1c8Ts25G Whzef88dVib0d9HrX0gLjKHeHg414Ieb3GeBJoPnYsQt9IA6EctB+qEFCg6eYflXYU/m Zd4A== X-Gm-Message-State: AGi0PuYrXTgmFtGUicBttsoTVjdssDz9ZpuY1xQIQwiY0oRv79F6W8gH CcawV82zAMV6Ti8l8WWenYIq9l6C X-Google-Smtp-Source: APiQypJRXpf2tco1Ocgam0oxAhrYeu5kPI91/QwWyo+6qcHqh0Ud0Oqac4JNa4kXzeSlrdLJdo6REA== X-Received: by 2002:a63:b649:: with SMTP id v9mr14627388pgt.402.1589227633449; Mon, 11 May 2020 13:07:13 -0700 (PDT) Received: from localhost.localdomain ([50.35.23.78]) by smtp.gmail.com with ESMTPSA id z15sm10844124pjt.20.2020.05.11.13.07.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 13:07:13 -0700 (PDT) From: Pavel Shirshov To: libteam@lists.fedorahosted.org Subject: [PATCH] Send LACP PDU right after the Actor state has been changed Date: Mon, 11 May 2020 13:06:50 -0700 Message-Id: <1589227610-27357-1-git-send-email-pavel.contrib@gmail.com> X-Mailer: git-send-email 2.7.4 Message-ID-Hash: SJPEZT7T3WCJLQBDSM36RJEVMT4Y3NGG X-Message-ID-Hash: SJPEZT7T3WCJLQBDSM36RJEVMT4Y3NGG X-MailFrom: pavel.contrib@gmail.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: 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 According to the LACP standard "LACP daemon must send LACP PDU packets with updates when the Actor's state changes or when it is apparent from the Partner's LACPDUs that the Partner does not know the Actor's current state." The current libteam implementation sends periodic updates only, so in LACP slow rate mode the update will be transmitted within 30 seconds which doesn't follow the LACP standard. To fix the issue: 1. Revert the patch: b2de61b39696 ("Fix sending duplicate LACP frames at the start of establishing a logical channel.") 2. Recalculate LACP actor state before the comparison what the LACP Partner thinks about the LACP Actor state. Signed-off-by: Pavel Shirshov --- teamd/teamd_runner_lacp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c index ec01237..11d02f1 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -996,8 +996,7 @@ static int lacp_port_set_state(struct lacp_port *lacp_port, return err; lacp_port_actor_update(lacp_port); - if (lacp_port->periodic_on) - return 0; + return lacpdu_send(lacp_port); } @@ -1110,9 +1109,10 @@ static int lacpdu_recv(struct lacp_port *lacp_port) if (err) return err; + lacp_port_actor_update(lacp_port); + /* Check if the other side has correct info about us */ - if (!lacp_port->periodic_on && - memcmp(&lacpdu.partner, &lacp_port->actor, + if (memcmp(&lacpdu.partner, &lacp_port->actor, sizeof(struct lacpdu_info))) { err = lacpdu_send(lacp_port); if (err)