Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5220544ybl; Tue, 27 Aug 2019 01:01:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/LExq6w40nnQdlhyztwr3K4IobxcfcGnDCHhq0citL9SpvzGFkhQ3FWNP+EV8OrdqqZGh X-Received: by 2002:a17:902:ac86:: with SMTP id h6mr2436280plr.79.1566892913252; Tue, 27 Aug 2019 01:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566892913; cv=none; d=google.com; s=arc-20160816; b=Ivub2uwwsHkH6KgEUqVIjbUSUQjSuree7g0r1XQJryk8iV/haWwGT0qzCiqiqze6Xs ffM09bY4RuoBoQA0hPKInPwn6VqgbrRY9N9ACjVIjsOs+mFp1uiI2nB9XyudGfRMFdO5 TXfNYoAIxeR9zN3fsXGyBfy3FaGjaD4pj8mfpPxY+oSmYmPhf0lZFiOCkLc+yoyPc2XD Vurw1E8NHr0JJmIq3102PL710KLN1mVaJHyZfuh7WAe85NTisik8k+Kkl0FPzHdB9P2K 9hSQuXq7IWCeaHz21q12rz8jEvbQ7HMFJMuX1y3kKCmo1GZVugSuAOXvfVkZnduNP9BB YLzg== 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=La9jC83mN/KQuQ35cZ7qcou4vINOGayFdQAIi823IC0=; b=jpWZW9H600ImNU4wPkIKaUxvGlWowbcbzUXtx3CUG24uArb5ouedTzTJn0ydoRPZgn N3dbUsmzGh4gABDGf+dv3ATQYprbh8n0zF6BMrbhKsbreO6G5i4VhCIvWWEoGt38smSP cg5RMiEyKC2EizciDkxayinYPEhgkeirQA4xayleeGsYBsOUjMci256Y8Xc/ZFWG7zCE UYGUVxGsrJXb6Pp0MNXJYchGnUsYdb1xZzldJB/e5dZRo87/75NwsYalPvUCR/hidFmt 61kSvx2VulPs1KdIrODKQjoaZ6HKDGZH2t0V2hV3VF8zbEmhuJjz94O3g3E2ywB3cBbP 0peQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FbnAA0xi; 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 f8si12496227pfn.43.2019.08.27.01.01.38; Tue, 27 Aug 2019 01:01:53 -0700 (PDT) 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=FbnAA0xi; 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 S1731456AbfH0IAX (ORCPT + 99 others); Tue, 27 Aug 2019 04:00:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:55140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731449AbfH0IAV (ORCPT ); Tue, 27 Aug 2019 04:00:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 80F8123405; Tue, 27 Aug 2019 08:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892820; bh=CyQiZCHrxKPp35lufizinN8SC1zCuJm7rkjhjD/lPqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FbnAA0xiTmi3YdXJxeSvuhhqjeNvfOWqK0K7/rWdlfXp1fWK+vffkbAEiCatnvDl0 IOfDVEQXFvg1zVDLwVyBNvlcl9OZXkzY08wZF/1xqi6AFUThohpF268uGEG9e9ub4R k+YNlMGi2NjwcFHx96pMNT4CZoEMJjjZ+A0QwEvI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jarod Wilson , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Thomas Falcon , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 026/162] bonding: Force slave speed check after link state recovery for 802.3ad Date: Tue, 27 Aug 2019 09:49:14 +0200 Message-Id: <20190827072739.215758687@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072738.093683223@linuxfoundation.org> References: <20190827072738.093683223@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 12185dfe44360f814ac4ead9d22ad2af7511b2e9 ] The following scenario was encountered during testing of logical partition mobility on pseries partitions with bonded ibmvnic adapters in LACP mode. 1. Driver receives a signal that the device has been swapped, and it needs to reset to initialize the new device. 2. Driver reports loss of carrier and begins initialization. 3. Bonding driver receives NETDEV_CHANGE notifier and checks the slave's current speed and duplex settings. Because these are unknown at the time, the bond sets its link state to BOND_LINK_FAIL and handles the speed update, clearing AD_PORT_LACP_ENABLE. 4. Driver finishes recovery and reports that the carrier is on. 5. Bond receives a new notification and checks the speed again. The speeds are valid but miimon has not altered the link state yet. AD_PORT_LACP_ENABLE remains off. Because the slave's link state is still BOND_LINK_FAIL, no further port checks are made when it recovers. Though the slave devices are operational and have valid speed and duplex settings, the bond will not send LACPDU's. The simplest fix I can see is to force another speed check in bond_miimon_commit. This way the bond will update AD_PORT_LACP_ENABLE if needed when transitioning from BOND_LINK_FAIL to BOND_LINK_UP. CC: Jarod Wilson CC: Jay Vosburgh CC: Veaceslav Falico CC: Andy Gospodarek Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f183cadd14e3d..e8f48f3cdf948 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2205,6 +2205,15 @@ static void bond_miimon_commit(struct bonding *bond) bond_for_each_slave(bond, slave, iter) { switch (slave->new_link) { case BOND_LINK_NOCHANGE: + /* For 802.3ad mode, check current slave speed and + * duplex again in case its port was disabled after + * invalid speed/duplex reporting but recovered before + * link monitoring could make a decision on the actual + * link status + */ + if (BOND_MODE(bond) == BOND_MODE_8023AD && + slave->link == BOND_LINK_UP) + bond_3ad_adapter_speed_duplex_changed(slave); continue; case BOND_LINK_UP: -- 2.20.1