From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 160D1C43603 for ; Sat, 7 Dec 2019 22:10:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DAA7124670 for ; Sat, 7 Dec 2019 22:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbfLGWJ6 convert rfc822-to-8bit (ORCPT ); Sat, 7 Dec 2019 17:09:58 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:55375 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726415AbfLGWJ6 (ORCPT ); Sat, 7 Dec 2019 17:09:58 -0500 Received: from 1.general.jvosburgh.us.vpn ([10.172.68.206] helo=famine.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1idiGw-0003FK-1o; Sat, 07 Dec 2019 22:09:54 +0000 Received: by famine.localdomain (Postfix, from userid 1000) id 674576C567; Sat, 7 Dec 2019 14:09:52 -0800 (PST) Received: from famine (localhost [127.0.0.1]) by famine.localdomain (Postfix) with ESMTP id 5F07CAC1CC; Sat, 7 Dec 2019 14:09:52 -0800 (PST) From: Jay Vosburgh To: Mahesh Bandewar cc: Andy Gospodarek , Veaceslav Falico , David Miller , Netdev , Mahesh Bandewar Subject: Re: [PATCH net] bonding: fix active-backup transition after link failure In-reply-to: <20191206234455.213159-1-maheshb@google.com> References: <20191206234455.213159-1-maheshb@google.com> Comments: In-reply-to Mahesh Bandewar message dated "Fri, 06 Dec 2019 15:44:55 -0800." X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 27.0.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10901.1575756592.1@famine> Content-Transfer-Encoding: 8BIT Date: Sat, 07 Dec 2019 14:09:52 -0800 Message-ID: <10902.1575756592@famine> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Mahesh Bandewar wrote: >After the recent fix 1899bb325149 ("bonding: fix state transition >issue in link monitoring"), the active-backup mode with miimon >initially come-up fine but after a link-failure, both members >transition into backup state. > >Following steps to reproduce the scenario (eth1 and eth2 are the >slaves of the bond): > > ip link set eth1 up > ip link set eth2 down > sleep 1 > ip link set eth2 up > ip link set eth1 down > cat /sys/class/net/eth1/bonding_slave/state > cat /sys/class/net/eth2/bonding_slave/state > >Fixes: 1899bb325149 ("bonding: fix state transition issue in link monitoring") >CC: Jay Vosburgh >Signed-off-by: Mahesh Bandewar >--- > drivers/net/bonding/bond_main.c | 3 --- > 1 file changed, 3 deletions(-) > >diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c >index fcb7c2f7f001..ad9906c102b4 100644 >--- a/drivers/net/bonding/bond_main.c >+++ b/drivers/net/bonding/bond_main.c >@@ -2272,9 +2272,6 @@ static void bond_miimon_commit(struct bonding *bond) > } else if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { > /* make it immediately active */ > bond_set_active_slave(slave); >- } else if (slave != primary) { >- /* prevent it from being the active one */ >- bond_set_backup_slave(slave); How does this fix things? Doesn't bond_select_active_slave() -> bond_change_active_slave() set the backup flag correctly via a call to bond_set_slave_active_flags() when it sets a slave to be the active slave? If this change resolves the problem, I'm not sure how this ever worked correctly, even prior to 1899bb325149. -J > } > > slave_info(bond->dev, slave->dev, "link status definitely up, %u Mbps %s duplex\n", >-- >2.24.0.393.g34dc348eaf-goog > --- -Jay Vosburgh, jay.vosburgh@canonical.com