Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp567102imu; Thu, 20 Dec 2018 01:30:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VVpjmP/GoXt+HU/uqm8X+M56IWElgU9FirQm3Rkaw9NACOz4yszMeLKOB93VADPWgFlfwI X-Received: by 2002:a17:902:6b09:: with SMTP id o9mr23384526plk.208.1545298218940; Thu, 20 Dec 2018 01:30:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545298218; cv=none; d=google.com; s=arc-20160816; b=RoWyAjQQqvHJUsJP/nDmOulwT5L+b09lz08XEpdM0R7kRnL5aJ7n4eIcL12PDMqTFx KOnzPL/Xk7M0m2ASSCwG52gsuoAqTDh0Tuy+EmZIfT8aNC4H+uU1wZOGMCtiwKDRfU8r yxNeotVa84CoQRExeegk6ZgjpT6Et3hMYG8spEoDzeJ+Sz2VDaIM4vUBYeUOpu4A7lL3 zc3WocFsWkSav2e1yXggBShcaCaqf1a7rWQcBUB0B1h2m8mrfzXP+Zh986qB0dcZZEDE I3usGayf/XQUBufP1A2EvF+4dbJCqfI9dx1nr1g56GRbPXMuHJmRqwm3/tn4tfGltDRT qSRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2LM+LDZXl3W45RzevB21pv65Xcc1iJvSIhoH3IAfWeM=; b=rX/q5kf1sCbUG3fsqigiPHIf9fyLN7fZwfOtwxz7LAx+eOrYzhBnCnxHIkRHdk2vhx 55eXq/aXpRi9ZqOYOu+80TvxFIzdBgX+pOZ0LCVlwa203oiPAdOMThAOfMsAsLrRgcJI 9FgmEEe6mGWX6zffHI+uLy1ELVx2H+l/UTVZUnWLMcHt6y2Z6jTZpIRelZGoFJKsosFv 9NrYwZ1N2mqmfrZMyHbkZT6FkKGsIBj0TsC0LQ+F6ZohCii1IO7fezoYpQFdvN2AcZhf v5jVwUnK80N+BCMcO0DXSo5Js6+snLAnzVM9kFn7nrDUWxdCfKab5pb/bL13/usN0XCh 8tbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A2FqnSIu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m64si19528501pfb.224.2018.12.20.01.30.03; Thu, 20 Dec 2018 01:30:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A2FqnSIu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732239AbeLTJ1K (ORCPT + 99 others); Thu, 20 Dec 2018 04:27:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:60998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732223AbeLTJ1D (ORCPT ); Thu, 20 Dec 2018 04:27:03 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8614A217D7; Thu, 20 Dec 2018 09:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545298023; bh=wdShKhi0sESLf6KgiJR1O45sZoKsDbfoYKGNIPHcN5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A2FqnSIuS0BpIYG4SqmQuxgKM/pRbA+14E3dw5X6D+3DcU716j4YZZWoXwSmwLjis Dyw7L1azSygKuU+54MpR4ufpKAqBbi70NqV0u10ZwaCTmKfO8WSEki19SeP+Wz0FzU imOslmkXa1VmzRd9iwH/MeKrKd/DVAHjQEjCQq+8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Toni Peltonen , Jay Vosburgh , Jonathan Toppins , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 43/72] bonding: fix 802.3ad state sent to partner when unbinding slave Date: Thu, 20 Dec 2018 10:18:42 +0100 Message-Id: <20181220085924.047881158@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085922.332225035@linuxfoundation.org> References: <20181220085922.332225035@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 3b5b3a3331d141e8f2a7aaae3a94dfa1e61ecbe4 ] Previously when unbinding a slave the 802.3ad implementation only told partner that the port is not suitable for aggregation by setting the port aggregation state from aggregatable to individual. This is not enough. If the physical layer still stays up and we only unbinded this port from the bond there is nothing in the aggregation status alone to prevent the partner from sending traffic towards us. To ensure that the partner doesn't consider this port at all anymore we should also disable collecting and distributing to signal that this actor is going away. Also clear AD_STATE_SYNCHRONIZATION to ensure partner exits collecting + distributing state. I have tested this behaviour againts Arista EOS switches with mlx5 cards (physical link stays up even when interface is down) and simulated the same situation virtually Linux <-> Linux with two network namespaces running two veth device pairs. In both cases setting aggregation to individual doesn't alone prevent traffic from being to sent towards this port given that the link stays up in partners end. Partner still keeps it's end in collecting + distributing state and continues until timeout is reached. In most cases this means we are losing the traffic partner sends towards our port while we wait for timeout. This is most visible with slow periodic time (LACP rate slow). Other open source implementations like Open VSwitch and libreswitch, and vendor implementations like Arista EOS, seem to disable collecting + distributing to when doing similar port disabling/detaching/removing change. With this patch kernel implementation would behave the same way and ensure partner doesn't consider our actor viable anymore. Signed-off-by: Toni Peltonen Signed-off-by: Jay Vosburgh Acked-by: Jonathan Toppins Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_3ad.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index f43fb2f958a5..93dfcef8afc4 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -2086,6 +2086,9 @@ void bond_3ad_unbind_slave(struct slave *slave) aggregator->aggregator_identifier); /* Tell the partner that this port is not suitable for aggregation */ + port->actor_oper_port_state &= ~AD_STATE_SYNCHRONIZATION; + port->actor_oper_port_state &= ~AD_STATE_COLLECTING; + port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; __update_lacpdu_from_port(port); ad_lacpdu_send(port); -- 2.19.1