From patchwork Mon Apr 27 20:24:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shirshov X-Patchwork-Id: 11513283 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 9257A1392 for ; Mon, 27 Apr 2020 20:25:29 +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 60C16206E2 for ; Mon, 27 Apr 2020 20:25:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60C16206E2 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 CA371607783F; Mon, 27 Apr 2020 20:25:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org CA371607783F Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id B735B202A1C29; Mon, 27 Apr 2020 20:25:28 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 1928A202A1C25; Mon, 27 Apr 2020 20:25:25 +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,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=disabled version=3.4.0 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 52879202A1C27 for ; Mon, 27 Apr 2020 20:25:22 +0000 (UTC) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (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-ib01.fedoraproject.org (Postfix) with ESMTPS id E26DD6081518 for ; Mon, 27 Apr 2020 20:25:21 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id hi11so116691pjb.3 for ; Mon, 27 Apr 2020 13:25:21 -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=E3YVXZIkrSQQZPm6qSX0TN5R+r9T3ZubKUfNa2tyXz5ZA0yPDFts2XSRud5LPykM43 ycRCg3975qwtzNUBLoOOxiTA7TJOAAZ1jqovMAesEnDMqD3Cs9u8mpnF0GcSRCjxEbvx aj0JC2nhry/jvQLCXsmdJALNLx01OipopaUu2Un6T6afCkkAhtpstV3k5nb4QxxAsLZt BI13lKq34D0PtHWDFUnQREhWl+DgIxcvn5FiWlheKWODxv2Nd1N8XqqGXt8M1wXUB8LZ YRpjk1T0FtFKzTWk9FGDYNSOIEztLsnouzKCY7vJdmQnr2HrM2nxmZgYofp/KqCE6/LR lUsQ== X-Gm-Message-State: AGi0PuZcAf61n7BgEg8Ru6zdXbZU0VBDz7UYl7lvASTlrYZf4SrknWwM DpSADgsx3DZF2OyB+tUBAZqCHS8d X-Google-Smtp-Source: APiQypIYNVugOZOSlpeNJBgUM+UPzYmiwfGwF8dlrY/ZpHq21DBlJ0lGTViS/Ao8DPVdQpeFgSSucw== X-Received: by 2002:a17:90a:db91:: with SMTP id h17mr585840pjv.10.1588019120488; Mon, 27 Apr 2020 13:25:20 -0700 (PDT) Received: from localhost.localdomain (50-47-139-32.evrt.wa.frontiernet.net. [50.47.139.32]) by smtp.gmail.com with ESMTPSA id p16sm155313pjz.2.2020.04.27.13.25.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2020 13:25:20 -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, 27 Apr 2020 13:24:56 -0700 Message-Id: <1588019096-17758-1-git-send-email-pavel.contrib@gmail.com> X-Mailer: git-send-email 2.7.4 Message-ID-Hash: WBRBV3HGHWYWSBG24UCEL46SELBMDWKH X-Message-ID-Hash: WBRBV3HGHWYWSBG24UCEL46SELBMDWKH 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)