Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp645964ybe; Thu, 19 Sep 2019 01:15:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDKRIRoV6n2OF4ppFX+VuO/kHdqPV2mtNdtKTXLqx4ym+l/O3XSityPc2yf3nGAva53FS2 X-Received: by 2002:a17:906:c79a:: with SMTP id cw26mr12852711ejb.265.1568880903232; Thu, 19 Sep 2019 01:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568880903; cv=none; d=google.com; s=arc-20160816; b=hvXIq0iH14Q+GImlP9tvAIxYqhpyCbkPltzZbRB/1pZAxsMFBOH19XqWL2+EhwMJUp qcEoOtE9yRszCmvGKl5PMy4AHdk/56Y29MOLs3tLrev4Kjh5YeU9x8bY7xJSN6S+FNiZ lQyG9miqxdUZNavu2Lus9VPE6jclGxxruYSrM88svgg4WHS4opzRQ3XTPr9FXa6lp7Mk fo9SYJq9yrkhWYxeQRt7ozAxQkctysnxUcv/rqrQem9hzNzw1+9wQiDUhVXU56TQPzWh TWjvNmL6UMqHyzoqVr3duy28v3zm8Jyo/IQP7ZyCFsOwdn8hsDq952daeJ4Ga3owjcP9 X0Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :mime-version:comments:references:in-reply-to:subject:cc:to:from; bh=j2g6dfiXZvm0KrTjEy9cKKXXNvKKHQENPcdLd2P1IQg=; b=OQPQrRhlTwXtNGgSmk32f6VOSMRNH/6Zc2Fu9glzuSZf+nqFH4Ukf6Y/yKH13VGekz pgX4sIN2pEkUzxfNBAGCn5lmbcIGX2Q6vD3P1QV3IXC50NkNHzVktz2GUAEPtj5NxUCC HhOiZkvqfK/oaUgB2OdAmza4BWwaB1n6jsXLm5PTUL4B+Hk0X9wzrX3UNPtR1kmX/XeO MvBE6M/OIUUZZR4w1KH/FOl+kW9jWWvrZuC5/BX/9GfYxtZJUpqE04thf0uIs1Tgx+mb 1XYNmaeCZIbmipiZySdsYNZtBF06BUcaq+manpRriaEWwL7R61vWMUlBDS2Ed7mGS7+w W2hA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qn24si856613ejb.200.2019.09.19.01.14.40; Thu, 19 Sep 2019 01:15:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731873AbfISIL7 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 19 Sep 2019 04:11:59 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:51304 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727033AbfISIL6 (ORCPT ); Thu, 19 Sep 2019 04:11:58 -0400 Received: from static-dcd-cqq-121001.business.bouyguestelecom.com ([212.194.121.1] helo=nyx.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iArXb-00025e-IU; Thu, 19 Sep 2019 08:11:51 +0000 Received: by nyx.localdomain (Postfix, from userid 1000) id 7E1A12402EB; Thu, 19 Sep 2019 10:11:51 +0200 (CEST) Received: from nyx (localhost [127.0.0.1]) by nyx.localdomain (Postfix) with ESMTP id 756FE289C50; Thu, 19 Sep 2019 10:11:51 +0200 (CEST) From: Jay Vosburgh To: "zhangsha \(A\)" cc: "vfalico@gmail.com" , "andy@greyhouse.net" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , yuehaibing , hunongda , "Chenzhendong (alex)" Subject: Re: [PATCH v3] bonding: force enable lacp port after link state recovery for 802.3ad In-reply-to: References: <20190918130620.8556-1-zhangsha.zhang@huawei.com> Comments: In-reply-to "zhangsha (A)" message dated "Wed, 18 Sep 2019 13:35:40 -0000." X-Mailer: MH-E 8.5+bzr; nmh 1.7.1-RC3; GNU Emacs 27.0.50 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Date: Thu, 19 Sep 2019 10:11:51 +0200 Message-ID: <10098.1568880711@nyx> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org zhangsha (A) wrote: >> -----Original Message----- >> From: zhangsha (A) >> Sent: 2019年9月18日 21:06 >> To: jay.vosburgh@canonical.com; vfalico@gmail.com; andy@greyhouse.net; >> davem@davemloft.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; >> yuehaibing ; hunongda ; >> Chenzhendong (alex) ; zhangsha (A) >> >> Subject: [PATCH v3] bonding: force enable lacp port after link state recovery for >> 802.3ad >> >> From: Sha Zhang >> >> After the commit 334031219a84 ("bonding/802.3ad: fix slave link initialization >> transition states") merged, the slave's link status will be changed to >> BOND_LINK_FAIL from BOND_LINK_DOWN in the following scenario: >> - Driver reports loss of carrier and >> bonding driver receives NETDEV_DOWN notifier >> - slave's duplex and speed is zerod and >> its port->is_enabled is cleard to 'false'; >> - Driver reports link recovery and >> bonding driver receives NETDEV_UP notifier; >> - If speed/duplex getting failed here, the link status >> will be changed to BOND_LINK_FAIL; >> - The MII monotor later recover the slave's speed/duplex >> and set link status to BOND_LINK_UP, but remains >> the 'port->is_enabled' to 'false'. >> >> In this scenario, the lacp port will not be enabled even its speed and duplex are >> valid. The bond will not send LACPDU's, and its state is 'AD_STATE_DEFAULTED' >> forever. The simplest fix I think is to call bond_3ad_handle_link_change() in >> bond_miimon_commit, this function can enable lacp after port slave speed >> check. >> As enabled, the lacp port can run its state machine normally after link recovery. >> >> Signed-off-by: Sha Zhang >> --- >> drivers/net/bonding/bond_main.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/net/bonding/bond_main.c >> b/drivers/net/bonding/bond_main.c index 931d9d9..76324a5 100644 >> --- a/drivers/net/bonding/bond_main.c >> +++ b/drivers/net/bonding/bond_main.c >> @@ -2206,7 +2206,8 @@ static void bond_miimon_commit(struct bonding >> *bond) >> */ >> if (BOND_MODE(bond) == BOND_MODE_8023AD && >> slave->link == BOND_LINK_UP) >> - >> bond_3ad_adapter_speed_duplex_changed(slave); >> + bond_3ad_handle_link_change(slave, >> + BOND_LINK_UP); >> continue; >> >> case BOND_LINK_UP: > >Hi, David, >I have replied your email for a while, I guess you may miss my email, so I resend it. >The following link address is the last email, please review the new one again, thank you. >https://patchwork.ozlabs.org/patch/1151915/ > >Last time, you doubted this is a driver specific problem, >I prefer to believe it's not because I find the commit 4d2c0cda, >its log says " Some NIC drivers don't have correct speed/duplex >settings at the time they send NETDEV_UP notification ...". > >Anyway, I think the lacp status should be fixed correctly, >since link-monitoring (miimon) set SPEED/DUPLEX right here. I suspect this is going to be related to the concurrent discussion with Aleksei, and would like to see the instrumentation results from his tests before adding another change to attempt to resolve this. Also, what device are you using for your testing, and are you able to run the instrumentation patch that I provided to Aleksei and provide its results? -J --- -Jay Vosburgh, jay.vosburgh@canonical.com