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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 3832AC4320A for ; Sun, 8 Aug 2021 04:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 058A560F4C for ; Sun, 8 Aug 2021 04:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229802AbhHHEtr (ORCPT ); Sun, 8 Aug 2021 00:49:47 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:34744 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbhHHEto (ORCPT ); Sun, 8 Aug 2021 00:49:44 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 1784nCFK010240; Sun, 8 Aug 2021 06:49:12 +0200 Date: Sun, 8 Aug 2021 06:49:12 +0200 From: Willy Tarreau To: Jonathan Toppins Cc: Jay Vosburgh , "netdev@vger.kernel.org" , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Jakub Kicinski , LKML Subject: Re: bonding: link state question Message-ID: <20210808044912.GA10092@1wt.eu> References: <020577f3-763d-48fd-73ce-db38c3c7fdf9@redhat.com> <22626.1628376134@famine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 07, 2021 at 08:09:31PM -0400, Jonathan Toppins wrote: > setting miimon = 100 does appear to fix it. > > It is interesting that there is no link monitor on by default. For example > when I enslave enp0s31f6 to a new bond with miimon == 0, enp0s31f6 starts > admin down and will never de-assert NO-CARRIER the bond always results in an > operstate of up. It seems like miimon = 100 should be the default since some > modes cannot use arpmon. Historically when miimon was implemented, not all NICs nor drivers had support for link state checking at all! In addition, there are certain deployments where you could rely on many devices by having a bond device on top of a vlan or similar device, and where monitoring could cost a lot of resources and you'd prefer to rely on external monitoring to set all of them up or down at once. I do think however that there remains a case with a missing state transition in the driver: on my laptop I have a bond interface attached to eth0, and I noticed that if I suspend the laptop with the link up, when I wake it up with no interface connected, the bond will not turn down, regardless of miimon. I have not looked closer yet, but I suspect that we're relying too much on a state change between previous and current and that one historically impossible transition does not exist there and/or used to work because it was handled as part of another change. I'll eventually have a look. Willy