Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp423574imu; Wed, 12 Dec 2018 20:30:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XcLnH22XEEs5Cq8O2Yf/ldlUN1cFSkInTipMCLTekOXtMvwt6TCSjQb8JF0nMSHnld+wGu X-Received: by 2002:a62:26c7:: with SMTP id m190mr23121732pfm.79.1544675446050; Wed, 12 Dec 2018 20:30:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544675446; cv=none; d=google.com; s=arc-20160816; b=GlzJqICSy0l2jVfvSCOycYc1ZTlI8c2KGmaNAXfp+jgQNL4nAJfo5bd8gvsJCTkfbj HH0LPogp6clCIdjEeHgcpXfTWavKLptyzuB0ks00BO+bTuFQ5jilqHMaAJQ0JyoLKOht +VXqSIxWxP+Y6850p+rB3QwYSqF8ESHysTjsyvJMU3kE0Z5OoS49VQjVCc02jyPdpBPa 1F+2gosLLCqf4MUJrJI3uQLLAjMQJZQb6OgdI0YkQV5KzfVHM33hyzBSMUZ3zBSHx6n1 60j1ajoisCUos3GuCxSBsA0fNu0ArnmMjeom3uVzOF7vuXHQPVUg8D7hpDsbm4QWBkRo PRoA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=setYjf0/XcNWFKONAZiYCXq4RtsP4/vl/HLjY1BzZfo=; b=vMrIOxkvv+rq8vGnJMHhC7iKuIOAsK1sFXEpQ391QSKKx49cQqGA+594jie3KLToMu ACjJJVxneaGqMbUAWq+EB0+q1dsjC3mH2rqHxjM/qL9BJ6jxOyDwovhLMujOLkrWqfWR 5ndWdguzPQ9NVF955Rbgm/GgNk77XT5SM6F8JWCa/UlbFOa10FbUMT46vE5SIa+X0SLk 2ewSTNqnjl18gaZYzhr+wd7zYeFlA5+3UK3/Ik8hAYKZmFceuPMr6TtO4Sd9FVoBTOe1 ZlFy9MkRKbG/EPq7jhwCFJJd7sqjkt+pz98dzZTBriI/WqZ2zETcA+6ZOOVH0h/KTmBi GSJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RRwb7IYL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si615016pgj.208.2018.12.12.20.30.30; Wed, 12 Dec 2018 20:30:46 -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=RRwb7IYL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727565AbeLME3T (ORCPT + 99 others); Wed, 12 Dec 2018 23:29:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:42286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbeLME3Q (ORCPT ); Wed, 12 Dec 2018 23:29:16 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCC5220879; Thu, 13 Dec 2018 04:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544675355; bh=K4Nd+DNk/v2Yu2qANXi5+0vxjxKlZ/sIEM2YS9i9gvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RRwb7IYLPq1VanyhjRuNa4enlHshJ0zbDo+WYZ0yEhfas6sz+ziclyB2Fgi+ddbh8 Y+dWNamvQQVT/5ics1jk13ZPQtJ9/X92BR+TPjKAZmHrWkmz4+HKA1YfkGm0FVwIlm 668HCmFbawWrhih36bSx00npeV5MLTTfeOk4XwQY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Toni Peltonen , Jay Vosburgh , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 22/73] bonding: fix 802.3ad state sent to partner when unbinding slave Date: Wed, 12 Dec 2018 23:27:47 -0500 Message-Id: <20181213042838.75160-22-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181213042838.75160-1-sashal@kernel.org> References: <20181213042838.75160-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Toni Peltonen [ 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