Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1599174pxt; Sat, 7 Aug 2021 17:15:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz6ksjWZn/8QorTZkCatKp7ef9oHr4aXNevN42vL8vaPcPFIWghM7iQePmaTLbkJ44IpQp X-Received: by 2002:a05:6402:510:: with SMTP id m16mr20919084edv.280.1628381750247; Sat, 07 Aug 2021 17:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628381750; cv=none; d=google.com; s=arc-20160816; b=socY/JLGNJ75wv3aGePgwgQDr9L+vOxZpc+B8lTCIWmYk6FOYgXvxS5TWQiR9jVur4 qmukSgwbMRwSZ6ypXYR6qSfTJZiaH1GUsyGXNlR42mgwqZ8TKdd2oroEMeun2qyB9soV ooMFtmi82FsJ8wWQ4HS1d/QsX67BJhUz/l/sQwhBfweuox/Q1BGAcFjQA+dx3utnNT7F YDdF34AY94g+f9ghdup7rjrONMiKqaKgexe2iAMHWcEAag8vHfryJn9YYQqExhCx2DZ9 OyVTbkoLRx1uKcnofUHnR1IWdq0/AFqaG1ilx6N0oWKvL36ehRJMu3VpSu5lZDJ9ZD9G vbrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Wzr6n8UYZ6q8bOB5ouUUhUM2nbUy/QZCXP20ifY7+EI=; b=MZH1JNK4f9sw9lBmPNqKidhlC76iZLsq1byAX2/ix/NY4WkTjQjS4C784eeQLGeKeo p9gP1Ed0KVVn8DzBHDO17fGZUTZarbT/Pln0jt5TYm3nWF/D6jpSklxuNXWKyFSgRVBD b7USPV4V3rfSjl/wNPX72hBGfwBxS8OI2NS0Qwz8ddNne7rfIDDZ1AvozAy8ua61hS4s 3bPgVLvo+p7cIMlQuAVU1/XfoDRiFXkkBvbpn/hNHBg6FB+VMxZOdSDEXSBSzXmr2Zyk dUQo2usTwSgE17tVbTXMb1lm6bwKHwaTCwP4oz3EJ0ZIjKTCRwaOh/GH/pAm+E9+Nu4Z C2lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P61Fjgqc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si12749144ejy.580.2021.08.07.17.15.26; Sat, 07 Aug 2021 17:15:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P61Fjgqc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbhHHAJy (ORCPT + 99 others); Sat, 7 Aug 2021 20:09:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31622 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbhHHAJx (ORCPT ); Sat, 7 Aug 2021 20:09:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628381375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wzr6n8UYZ6q8bOB5ouUUhUM2nbUy/QZCXP20ifY7+EI=; b=P61Fjgqcu1WXC3cbVe72SEinU3/g1WNp0l2JPKq7KKBCIudiWr59O8h51DVUkEHEtctnrD dxzkc/6x037fiKdVogPJdM8aNRWWbqK07Na5mX9oMITfrQoFODkmeeYCh+53AIUhyaPxDE MUv5vBusTcGmATxxFxoaOaI5HUaQa5g= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-iPB8geuqNpWPUe7c2uWF9g-1; Sat, 07 Aug 2021 20:09:34 -0400 X-MC-Unique: iPB8geuqNpWPUe7c2uWF9g-1 Received: by mail-qv1-f69.google.com with SMTP id cb3-20020ad456230000b02903319321d1e3so7824252qvb.14 for ; Sat, 07 Aug 2021 17:09:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Wzr6n8UYZ6q8bOB5ouUUhUM2nbUy/QZCXP20ifY7+EI=; b=BNkykNI8yQZS1rDgaG2lXEb//cGYA/WqRhStPRH+OVSfIn9XWGMMlOckRU/q5jmXJO joP4ByiNJ9A3TIJ51Yb3z08/Wm1tXtMA5EcjRAdaxbjGel33nihYwGVXvMuocV30/p+O Nh/WKk5iK8UjvtTtV+pOJftnLK0/xn4nLHeiBX5tjMZyd+qkw7+AEki36EUbMyrX/jfe +jy/6eZY1mTFp1gGFMrPiXsmFBIzDlN2Zugudw5Q7ynDn8QTh4SlngC2xj7fl5gIr8t8 ogBEIgrtBleWpl74KBhQTXSe4lb5v27bUs2G8YDZfc0t1/RMC2nCh5HQqFn1z4C/s3fd 0J/w== X-Gm-Message-State: AOAM531vFl0YF23U8s/9BdltS0cdvLWfMNMT4RTQIbRE2y8JGXSyS5gH a5vV5LtmX+HYfBKIZ5eSnft/Q/WUqZhmouliQDGZbOdTyAQQ6D0J0Aipc5O670oFZbFCbw0i6aD U+Jcwz8Ty3TmPcXenxutxj6Op8RPTp4F+kewGZjb7wM0VNyH1/bI8Jhmdt/9GzgNf5LQg9/nYnL om X-Received: by 2002:ac8:5a12:: with SMTP id n18mr14449088qta.173.1628381373767; Sat, 07 Aug 2021 17:09:33 -0700 (PDT) X-Received: by 2002:ac8:5a12:: with SMTP id n18mr14449070qta.173.1628381373465; Sat, 07 Aug 2021 17:09:33 -0700 (PDT) Received: from jtoppins.rdu.csb ([107.15.110.69]) by smtp.gmail.com with ESMTPSA id n189sm3383768qka.69.2021.08.07.17.09.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Aug 2021 17:09:33 -0700 (PDT) Subject: Re: bonding: link state question To: Jay Vosburgh Cc: "netdev@vger.kernel.org" , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Jakub Kicinski , LKML References: <020577f3-763d-48fd-73ce-db38c3c7fdf9@redhat.com> <22626.1628376134@famine> From: Jonathan Toppins Message-ID: Date: Sat, 7 Aug 2021 20:09:31 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <22626.1628376134@famine> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/21 6:42 PM, Jay Vosburgh wrote: > Jonathan Toppins wrote: > >> Is there any reason why bonding should have an operstate of up when none >> of its slaves are in an up state? In this particular scenario it seems >> like the bonding device should at least assert NO-CARRIER, thoughts? >> >> $ ip -o -d link show | grep "bond5" >> 2: enp0s31f6: mtu 1500 qdisc >> fq_codel master bond5 state DOWN mode DEFAULT group default qlen 1000\ >> link/ether 8c:8c:aa:f8:62:16 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 >> maxmtu 9000 \ bond_slave state ACTIVE mii_status UP link_failure_count >> 0 perm_hwaddr 8c:8c:aa:f8:62:16 queue_id 0 numtxqueues 1 numrxqueues 1 >> gso_max_size 65536 gso_max_segs 65535 >> 41: bond5: mtu 1500 qdisc noqueue >> state UP mode DEFAULT group default qlen 1000\ link/ether >> 8c:8c:aa:f8:62:16 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu >> 65535 \ bond mode balance-xor miimon 0 updelay 0 downdelay 0 >> peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_validate none > > I'm going to speculate that your problem is that miimon and > arp_interval are both 0, and the bond then doesn't have any active > mechanism to monitor the link state of its interfaces. There might be a > warning in dmesg to this effect. > > Do you see what you'd consider to be correct behavior if miimon > is set to 100? > 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. Thank you for the discussion, see below for the steps taken. $ sudo ip link set dev enp0s31f6 nomaster $ sudo ip link add dev bond6 type bond mode balance-xor $ sudo ip -o -d link set dev bond6 up $ ip -o -d link show dev bond6 62: bond6: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000\ link/ether 3e:12:01:8a:ed:b1 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 \ bond mode balance-xor miimon 0 updelay 0 downdelay 0 peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_validate none arp_all_targets any primary_reselect always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1 num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1 packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1 numtxqueues 16 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535 $ ip -o -d link show dev enp0s31f6 2: enp0s31f6: mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000\ link/ether 8c:8c:aa:f8:62:16 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 9000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 $ sudo ip -o -d link set dev enp0s31f6 master bond6 $ ip -o -d link show dev bond6 62: bond6: mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000\ link/ether 8c:8c:aa:f8:62:16 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 \ bond mode balance-xor miimon 0 updelay 0 downdelay 0 peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_validate none arp_all_targets any primary_reselect always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1 num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1 packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1 numtxqueues 16 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535 $ sudo ip link set dev enp0s31f6 nomaster $ ip -o -d link show dev bond6 62: bond6: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000\ link/ether ae:b8:6e:b3:ca:3f brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 \ bond mode balance-xor miimon 0 updelay 0 downdelay 0 peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_validate none arp_all_targets any primary_reselect always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1 num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1 packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1 numtxqueues 16 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535