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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 CC2C7C43381 for ; Wed, 6 Mar 2019 07:23:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FC6820675 for ; Wed, 6 Mar 2019 07:23:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728911AbfCFHXg (ORCPT ); Wed, 6 Mar 2019 02:23:36 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43043 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbfCFHXg (ORCPT ); Wed, 6 Mar 2019 02:23:36 -0500 Received: by mail-qt1-f196.google.com with SMTP id y4so11784052qtc.10 for ; Tue, 05 Mar 2019 23:23:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jXhlGVagmiPXS52nL2KnZeshcK9ZQH6tKrxF4xqlAVE=; b=H6o3BW6Hv/xGLJf3DuRD/MCe2Hhr8EH3WTnm8xdYwOw4hy25dp8AyEtfZyni9c/Oq5 SUE3D4GxNh/VcGNB/jS0JAHrB19HrHqrQPuBBp6scSNc6QtLIkS4qjH7A+4Qumdfbovq QAuDuv0nAcdjEKPP7/EIJSF1OCOtbPRQTYNbjXYbjDGj0K1Waxu8ppbP7uXDO/Xv0/Lo wY69QmfOt1eEtxcWKt3WKuEluAIgUJJc6aLyF9XcmtgnCOOw2xetMsoo0MY3FuLvElwy QeWJ78AECu/ZNS+QvoUBSZFAZGE++t+/4e21iPCmKtci/pYWE0fNyDUWff6ezVRO9GDF ek8w== X-Gm-Message-State: APjAAAVzCyy23quOnUFtqHKukPUA50h8uxkoqqUMd0u3mK/o+5zOd3g+ va2m8L4ZvG9WTSa/lly0xpzZ9g== X-Google-Smtp-Source: APXvYqxA4Xy4AMHlu8GeDCTbIkJMtnnhBZlEwROfHU76mQ5WyB9OpRf6DOvCD6UUCxtKqQ0kUViPfw== X-Received: by 2002:ac8:17e7:: with SMTP id r36mr4527007qtk.104.1551857014909; Tue, 05 Mar 2019 23:23:34 -0800 (PST) Received: from redhat.com (pool-173-76-246-42.bstnma.fios.verizon.net. [173.76.246.42]) by smtp.gmail.com with ESMTPSA id e184sm915529qka.31.2019.03.05.23.23.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2019 23:23:33 -0800 (PST) Date: Wed, 6 Mar 2019 02:23:31 -0500 From: "Michael S. Tsirkin" To: si-wei liu Cc: Stephen Hemminger , Sridhar Samudrala , Jakub Kicinski , Jiri Pirko , David Miller , Netdev , virtualization@lists.linux-foundation.org, liran.alon@oracle.com, boris.ostrovsky@oracle.com, vijay.balakrishna@oracle.com Subject: Re: [RFC PATCH net-next] failover: allow name change on IFF_UP slave interfaces Message-ID: <20190306021801-mutt-send-email-mst@kernel.org> References: <20190304213032-mutt-send-email-mst@kernel.org> <20190305112427.1a23822e@shemminger-XPS-13-9360> <9448ae8f-c4e0-58a4-ff46-2f2951113d1e@oracle.com> <20190305190325-mutt-send-email-mst@kernel.org> <8737e985-f418-7002-c8b5-0023d1c4a453@oracle.com> <20190305193439-mutt-send-email-mst@kernel.org> <20190306013255-mutt-send-email-mst@kernel.org> <98243a73-a42a-6465-cf3c-a049c53b4d0c@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98243a73-a42a-6465-cf3c-a049c53b4d0c@oracle.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Mar 05, 2019 at 11:15:06PM -0800, si-wei liu wrote: > > > On 3/5/2019 10:43 PM, Michael S. Tsirkin wrote: > > On Tue, Mar 05, 2019 at 04:51:00PM -0800, si-wei liu wrote: > > > > > > On 3/5/2019 4:36 PM, Michael S. Tsirkin wrote: > > > > On Tue, Mar 05, 2019 at 04:20:50PM -0800, si-wei liu wrote: > > > > > On 3/5/2019 4:06 PM, Michael S. Tsirkin wrote: > > > > > > On Tue, Mar 05, 2019 at 11:35:50AM -0800, si-wei liu wrote: > > > > > > > On 3/5/2019 11:24 AM, Stephen Hemminger wrote: > > > > > > > > On Tue, 5 Mar 2019 11:19:32 -0800 > > > > > > > > si-wei liu wrote: > > > > > > > > > > > > > > > > > > I have a vague idea: would it work to *not* set > > > > > > > > > > IFF_UP on slave devices at all? > > > > > > > > > Hmm, I ever thought about this option, and it appears this solution is > > > > > > > > > more invasive than required to convert existing scripts, despite the > > > > > > > > > controversy of introducing internal netdev state to differentiate user > > > > > > > > > visible state. Either we disallow slave to be brought up by user, or to > > > > > > > > > not set IFF_UP flag but instead use the internal one, could end up with > > > > > > > > > substantial behavioral change that breaks scripts. Consider any admin > > > > > > > > > script that does `ip link set dev ... up' successfully just assumes the > > > > > > > > > link is up and subsequent operation can be done as usual. > > > > > > How would it work when carrier is off? > > > > > > > > > > > > > While it *may* > > > > > > > > > work for dracut (yet to be verified), I'm a bit concerned that there are > > > > > > > > > more scripts to be converted than those that don't follow volatile > > > > > > > > > failover slave names. It's technically doable, but may not worth the > > > > > > > > > effort (in terms of porting existing scripts/apps). > > > > > > > > > > > > > > > > > > Thanks > > > > > > > > > -Siwei > > > > > > > > Won't work for most devices. Many devices turn off PHY and link layer > > > > > > > > if not IFF_UP > > > > > > > True, that's what I said about introducing internal state for those driver > > > > > > > and other kernel component. Very invasive change indeed. > > > > > > > > > > > > > > -Siwei > > > > > > Well I did say it's vague. > > > > > > How about hiding IFF_UP from dev_get_flags (and probably > > > > > > __dev_change_flags)? > > > > > > > > > > > Any different? This has small footprint for the kernel change for sure, > > > > > while the discrepancy is still there. Anyone who writes code for IFF_UP will > > > > > not notice IFF_FAILOVER_SLAVE. > > > > > > > > > > Not to mention more userspace "fixup" work has to be done due to this > > > > > change. > > > > > > > > > > -Siwei > > > > > > > > > > > > > > Point is it's ok since most userspace should just ignore slaves > > > > - hopefully it will just ignore it since it already > > > > ignores interfaces that are down. > > > Admin script thought the interface could be bright up and do further > > > operations without checking the UP flag. > > These scripts then would be broken on any box with multiple interfaces > > since not all of these would have carrier. > Consider a script executing `ifconfig ... up' and once succeeds runs tcpdump > or some other command relying on UP interface. It's quite common that those > scripts don't check the UP flag but instead just rely on the well-known fact > that the command exits with 0 meaning the interface should be UP. This > change might well break scripts of that kind. I am sorry I don't get it. Could you give an example of a script that works now but would be broken? > > > > > > > It doesn't look to be a reliable > > > way of prohibit userspace from operating against slaves. > > > > > > -Siwei > > > > > > > > This does not mean we shouldn't make an effort to disable broken > > configurations. > > > > I am not arguing against your patch. Not at all. I see better > > hiding of slaves as a separate enhancement. > I understand, but my point is we should try to minimize unnecessary side > impact to the current usage for whatever "hiding" effort we can make. It's > hard to find a tradeoff sometimes. Yes if some userspace made an assumption and it worked, we should keep it working I think. I don't necessarily agree we should worry too much about theoretical issues. In half a year since the feature got merged it's unlikely there are millions of slightly different scripts using it. > > > > > > Acked-by: Michael S. Tsirkin > > > > > Thank you. > > -Siwei