Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6928220rwb; Tue, 22 Nov 2022 22:45:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf7VifYkJFQN+aoWCeXfwtbeOuP0+MJu2sjz20mc5TnizYHdQbrbxZsf0i/eEoJUxDF0ICx+ X-Received: by 2002:a17:906:2650:b0:7b2:c004:55fe with SMTP id i16-20020a170906265000b007b2c00455femr17536121ejc.742.1669185921549; Tue, 22 Nov 2022 22:45:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669185921; cv=none; d=google.com; s=arc-20160816; b=EgL4BVqv9F6/+0jqqWKY8NtmmRmLJy6m0xKtQm+FVPZJQC6DsdnkunREPbZvEQeP7q Ah+SR6gaL/iXoh/QkIy0goPIDoonPxRtQxHn492JTMv1uZkuYY+IzDg9JMWiGApWXS2e T7an1kqy+eeH6RVYybxCwkxy9SNyHruNeLvCbD29+r8HvsQoMkPJVklZAQe0aV32CMut 3T5+3wMVpNBOUyNpiONDtAvKMhOqgk75Tjtzo59/3PpEXfvhksG/6uYsfSzAMBHGJHcn mH53g6mc4htt7JJEA4mco2a9bK/B5XnEOYf8j28KT4WZ8kuFZSaLlO5lAN3RQF4sojmP s0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:comments:references:in-reply-to:subject:cc :to:from:dkim-signature; bh=PDl3MXmZUkgPXUvqF2eBNhOB/cXRKHs/BmNMouA44GY=; b=l+QVrxw1zn0iWEyI3mXtUcJvCAql0SmyMOmNHvJIN3ediameFpk1C4xk1u1ypyGNua hdkcuTWydtb2fpMXhd7BRTB0vh30Vap1j1Eg1nCtd3i9svO+YqRz5pgqsxyVMKC/CwzM qGq5fLEXLsORHsl36G2Bb2QSoMNdxySHO9wrzh8eG0uQ+ZvnXYlhM0AGRPgBKvtyhrsa 2dMeInGPA4wLHxG750tm5gPIG+zGUJBPZ4Ppov3NLG4GJ9bvFDoeq7momc5RfJplSAdp kCGVeeL1DQLWb0YrI6UfyQbJd5zdOXTcjDc8g1O5V0EhYvPWGY3sgQ/uMKbxu5XfcicT I2yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=bBwCbWYM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb13-20020a1709077e8d00b007ad9f041c3bsi2474015ejc.27.2022.11.22.22.44.58; Tue, 22 Nov 2022 22:45:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=bBwCbWYM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235818AbiKWGZf (ORCPT + 89 others); Wed, 23 Nov 2022 01:25:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbiKWGZa (ORCPT ); Wed, 23 Nov 2022 01:25:30 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFBC6E914E for ; Tue, 22 Nov 2022 22:25:29 -0800 (PST) Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 3494E3F47F for ; Wed, 23 Nov 2022 06:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669184724; bh=PDl3MXmZUkgPXUvqF2eBNhOB/cXRKHs/BmNMouA44GY=; h=From:To:cc:Subject:In-reply-to:References:MIME-Version: Content-Type:Date:Message-ID; b=bBwCbWYMriwRRGDfg0waukZ/gyxHqlnhsuVvNcM3+zc2cL/RwsixmSQnDH26OOCxt DuqYtJicxVk3QfHlTZEn6znDVBS0/GgrOaVRuneEfbvCtNpJmrikb5+tlYupRXB/kh IilkvvPJnTwWN0E1D+vHWe1Vr/P4xCCOPaz6bFJ2CM1pfLPdmGzHMKQTRtBW0S+94H Bj5bbbjLdYTA0yPqSPkI4XVZnxAB6IE/4wJFu+5OBcndvrz3JfYuNF9pQ/pMO1eTA0 k6p58whPLoyievr320naQxCi3SY8R+08biBoXKzSK2KOBChmCZrD5Tmt8gFyjVqOVh dH338vZltm5Pg== Received: by mail-pf1-f197.google.com with SMTP id z19-20020a056a001d9300b0056df4b6f421so10485515pfw.4 for ; Tue, 22 Nov 2022 22:25:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PDl3MXmZUkgPXUvqF2eBNhOB/cXRKHs/BmNMouA44GY=; b=z6A/wXONEs5GKbYd7WuiIAQqvrW2rm26Knn1sob7QeaKSkwHL5K2tQVFTn8FVRw0aN zz+ElMN07ilTVYvvnSEPeWBB6wrj+DcTboZmdbFWxgvXN0spKPqKXvWhSoJ/qZFMpILZ 7mpXmyGZEYG9d3EaB5cqoC75HelFowWUlSDpI3Llgw1OuWP/H1zrLMH9zL7HuYCr6LOl zqQVCc1tQRBcueQiyLgOZDt6P0jY2sVboo70h/1y0DXKc4P2NvVbeTSebNoTHo2aoM3m WagViB/heHgGT/CgbTBtr+cCws0MA8b1+5DWzXJTjFpvso4ZziV4nOifOLExPKFgUafh aZ2g== X-Gm-Message-State: ANoB5pky6alYCzHd/+yKWEnEdQ4k450qVwfcLagloiyrJKxBdELnVmIr bbF2UrJSuYAaNoSriEjHGZf5heJ8N5DwdaP0ghpSxlQqINAFyjbjaV7r3X/Om+RRpZzorzApPVr t8IWdzeaO+1ldHLkV9e7zX3Cbv828pp11Fl0GLtOj/Q== X-Received: by 2002:a63:2361:0:b0:45f:f8df:108e with SMTP id u33-20020a632361000000b0045ff8df108emr6317135pgm.127.1669184722357; Tue, 22 Nov 2022 22:25:22 -0800 (PST) X-Received: by 2002:a63:2361:0:b0:45f:f8df:108e with SMTP id u33-20020a632361000000b0045ff8df108emr6317122pgm.127.1669184722060; Tue, 22 Nov 2022 22:25:22 -0800 (PST) Received: from famine.localdomain ([50.125.80.157]) by smtp.gmail.com with ESMTPSA id t3-20020a625f03000000b0056c3d3f5a8dsm11736698pfb.56.2022.11.22.22.25.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2022 22:25:21 -0800 (PST) Received: by famine.localdomain (Postfix, from userid 1000) id 601845FF10; Tue, 22 Nov 2022 22:25:20 -0800 (PST) Received: from famine (localhost [127.0.0.1]) by famine.localdomain (Postfix) with ESMTP id 58168A02BA; Tue, 22 Nov 2022 22:25:20 -0800 (PST) From: Jay Vosburgh To: Jonathan Toppins cc: "netdev @ vger . kernel . org" , pabeni@redhat.com, Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 2/2] bonding: fix link recovery in mode 2 when updelay is nonzero In-reply-to: References: Comments: In-reply-to Jonathan Toppins message dated "Tue, 22 Nov 2022 16:24:29 -0500." X-Mailer: MH-E 8.6+git; nmh 1.6; Emacs 29.0.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15929.1669184720.1@famine> Content-Transfer-Encoding: quoted-printable Date: Tue, 22 Nov 2022 22:25:20 -0800 Message-ID: <15930.1669184720@famine> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jonathan Toppins wrote: >Before this change when a bond in mode 2 lost link, all of its slaves >lost link, the bonding device would never recover even after the >expiration of updelay. This change removes the updelay when the bond >currently has no usable links. Conforming to bonding.txt section 13.1 >paragraph 4. > >Fixes: 41f891004063 ("bonding: ignore updelay param when there is no acti= ve slave") >Signed-off-by: Jonathan Toppins This looks correct, although I suspect it would affect more than just balance-xor ("mode 2"); if memory serves, balance-rr mode operates similarly. Acked-by: Jay Vosburgh -J >--- > >Notes: > v2: > * added fixes tag and reposted to net tree > > drivers/net/bonding/bond_main.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_m= ain.c >index f298b9b3eb77..f747bd60d399 100644 >--- a/drivers/net/bonding/bond_main.c >+++ b/drivers/net/bonding/bond_main.c >@@ -2536,7 +2536,16 @@ static int bond_miimon_inspect(struct bonding *bon= d) > struct slave *slave; > bool ignore_updelay; > = >- ignore_updelay =3D !rcu_dereference(bond->curr_active_slave); >+ if (BOND_MODE(bond) =3D=3D BOND_MODE_ACTIVEBACKUP) { >+ ignore_updelay =3D !rcu_dereference(bond->curr_active_slave); >+ } else { >+ struct bond_up_slave *usable_slaves; >+ >+ usable_slaves =3D rcu_dereference(bond->usable_slaves); >+ >+ if (usable_slaves && usable_slaves->count =3D=3D 0) >+ ignore_updelay =3D true; >+ } > = > bond_for_each_slave_rcu(bond, slave, iter) { > bond_propose_link_state(slave, BOND_LINK_NOCHANGE); >-- = >2.31.1 >