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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 4B912C43381 for ; Thu, 21 Mar 2019 13:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB69B2083D for ; Thu, 21 Mar 2019 13:25:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="m7vmt3NG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728266AbfCUNZJ (ORCPT ); Thu, 21 Mar 2019 09:25:09 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:38736 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbfCUNZJ (ORCPT ); Thu, 21 Mar 2019 09:25:09 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2LDNkUH127949; Thu, 21 Mar 2019 13:24:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=4FXac5xlLIdNCbSeV+SaBRQpwsSxRYhwuGg7CJ0kTeQ=; b=m7vmt3NGjrKc52sBT5KvCSI6i3RHc4jEGNG6CCCAJULI6SYHVuUJAhh00JDaK/p5vnRV M+As5w3/JKDt6xsjmtxj9ByyR4/j1PgZS/Fn5U/uBfQaYvB3CAS6/ym++WuYu6P8zwUE 3oI/46pPavjxeb52sksQApvbkwE/HVIERsCD+U8rIFEunntYM3lXWzru9J59vs4m4xx9 kjw91Ed/Nc+XPyv5XfnpQ4Lw8GG/d8QplP8XZOn3vjADzXTiMelyHGcSKoVaF4bKGwnh dfgwD7VU4rkXlrhQYLguRWau7M6Yed0SxdoPLEjhU+GJ6pFgenZhtWNEssNxt56KSmwW 3Q== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2r8ssrr8b6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Mar 2019 13:24:53 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2LDOl0Z022270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Mar 2019 13:24:47 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2LDOjtl031389; Thu, 21 Mar 2019 13:24:45 GMT Received: from [10.30.3.18] (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Mar 2019 06:24:45 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: [summary] virtio network device failover writeup From: Liran Alon In-Reply-To: <20190321090619-mutt-send-email-mst@kernel.org> Date: Thu, 21 Mar 2019 15:24:39 +0200 Cc: Stephen Hemminger , Si-Wei Liu , Sridhar Samudrala , Alexander Duyck , Jakub Kicinski , Jiri Pirko , David Miller , Netdev , virtualization@lists.linux-foundation.org, boris.ostrovsky@oracle.com, vijay.balakrishna@oracle.com, jfreimann@redhat.com, ogerlitz@mellanox.com, vuhuong@mellanox.com Content-Transfer-Encoding: quoted-printable Message-Id: <1B52153B-B968-4E5B-8959-E7E83CE7FEAF@oracle.com> References: <20190320100747-mutt-send-email-mst@kernel.org> <36772E22-7A8F-4C42-A731-398E3204B418@oracle.com> <20190320180641-mutt-send-email-mst@kernel.org> <20190321044920-mutt-send-email-mst@kernel.org> <20190321082532-mutt-send-email-mst@kernel.org> <20190321085159-mutt-send-email-mst@kernel.org> <2939FB15-720A-4C9E-92B7-2DBA139DDE0F@oracle.com> <20190321090619-mutt-send-email-mst@kernel.org> To: "Michael S. Tsirkin" X-Mailer: Apple Mail (2.3445.4.7) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9201 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903210096 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > On 21 Mar 2019, at 15:12, Michael S. Tsirkin wrote: >=20 > On Thu, Mar 21, 2019 at 03:04:37PM +0200, Liran Alon wrote: >>=20 >>=20 >>> On 21 Mar 2019, at 14:57, Michael S. Tsirkin wrote: >>>=20 >>> On Thu, Mar 21, 2019 at 02:47:50PM +0200, Liran Alon wrote: >>>>=20 >>>>=20 >>>>> On 21 Mar 2019, at 14:37, Michael S. Tsirkin = wrote: >>>>>=20 >>>>> On Thu, Mar 21, 2019 at 12:07:57PM +0200, Liran Alon wrote: >>>>>>>>>> 2) It brings non-intuitive customer experience. For example, = a customer may attempt to analyse connectivity issue by checking the = connectivity >>>>>>>>>> on a net-failover slave (e.g. the VF) but will see no = connectivity when in-fact checking the connectivity on the net-failover = master netdev shows correct connectivity. >>>>>>>>>>=20 >>>>>>>>>> The set of changes I vision to fix our issues are: >>>>>>>>>> 1) Hide net-failover slaves in a different netns created and = managed by the kernel. But that user can enter to it and manage the = netdevs there if wishes to do so explicitly. >>>>>>>>>> (E.g. Configure the net-failover VF slave in some special = way). >>>>>>>>>> 2) Match the virtio-net and the VF based on a PV attribute = instead of MAC. (Similar to as done in NetVSC). E.g. Provide a = virtio-net interface to get PCI slot where the matching VF will be = hot-plugged by hypervisor. >>>>>>>>>> 3) Have an explicit virtio-net control message to command = hypervisor to switch data-path from virtio-net to VF and vice-versa. = Instead of relying on intercepting the PCI master enable-bit >>>>>>>>>> as an indicator on when VF is about to be set up. (Similar to = as done in NetVSC). >>>>>>>>>>=20 >>>>>>>>>> Is there any clear issue we see regarding the above = suggestion? >>>>>>>>>>=20 >>>>>>>>>> -Liran >>>>>>>>>=20 >>>>>>>>> The issue would be this: how do we avoid conflicting with = namespaces >>>>>>>>> created by users? >>>>>>>>=20 >>>>>>>> This is kinda controversial, but maybe separate netns names = into 2 groups: hidden and normal. >>>>>>>> To reference a hidden netns, you need to do it explicitly.=20 >>>>>>>> Hidden and normal netns names can collide as they will be = maintained in different namespaces (Yes I=E2=80=99m overloading the term = namespace here=E2=80=A6). >>>>>>>=20 >>>>>>> Maybe it's an unnamed namespace. Hidden until userspace gives it = a name? >>>>>>=20 >>>>>> This is also a good idea that will solve the issue. Yes. >>>>>>=20 >>>>>>>=20 >>>>>>>> Does this seems reasonable? >>>>>>>>=20 >>>>>>>> -Liran >>>>>>>=20 >>>>>>> Reasonable I'd say yes, easy to implement probably no. But maybe = I >>>>>>> missed a trick or two. >>>>>>=20 >>>>>> BTW, from a practical point of view, I think that even until we = figure out a solution on how to implement this, >>>>>> it was better to create an kernel auto-generated name (e.g. = =E2=80=9Ckernel_net_failover_slaves") >>>>>> that will break only userspace workloads that by a very = rare-chance have a netns that collides with this then >>>>>> the breakage we have today for the various userspace components. >>>>>>=20 >>>>>> -Liran >>>>>=20 >>>>> It seems quite easy to supply that as a module parameter. Do we = need two >>>>> namespaces though? Won't some userspace still be confused by the = two >>>>> slaves sharing the MAC address? >>>>=20 >>>> That=E2=80=99s one reasonable option. >>>> Another one is that we will indeed change the mechanism by which we = determine a VF should be bonded with a virtio-net device. >>>> i.e. Expose a new virtio-net property that specify the PCI slot of = the VF to be bonded with. >>>>=20 >>>> The second seems cleaner but I don=E2=80=99t have a strong opinion = on this. Both seem reasonable to me and your suggestion is faster to = implement from current state of things. >>>>=20 >>>> -Liran >>>=20 >>> OK. Now what happens if master is moved to another namespace? Do we = need >>> to move the slaves too? >>=20 >> No. Why would we move the slaves? >=20 >=20 > The reason we have 3 device model at all is so users can fine tune the > slaves. I Agree. > I don't see why this applies to the root namespace but not > a container. If it has access to failover it should have access > to slaves. Oh now I see your point. I haven=E2=80=99t thought about the containers = usage. My thinking was that customer can always just enter to the =E2=80=9Chidden= =E2=80=9D netns and configure there whatever he wants. Do you have a suggestion how to handle this? One option can be that every "visible" netns on system will have a = =E2=80=9Chidden=E2=80=9D unnamed netns where the net-failover slaves = reside in. If customer wishes to be able to enter to that netns and manage the = net-failover slaves explicitly, it will need to have an updated iproute2 that knows how to enter to that hidden netns. For most customers, they = won=E2=80=99t need to ever enter that netns and thus it is ok they = don=E2=80=99t have this updated iproute2. >=20 >> The whole point is to make most customer ignore the net-failover = slaves and remain them =E2=80=9Chidden=E2=80=9D in their dedicated = netns. >=20 > So that makes the common case easy. That is good. My worry is it might > make some uncommon cases impossible. >=20 >> We won=E2=80=99t prevent customer from explicitly moving the = net-failover slaves out of this netns, but we will not move them out of = there automatically. >>=20 >>>=20 >>> Also siwei's patch is then kind of extraneous right? >>> Attempts to rename a slave will now fail as it's in a namespace=E2=80=A6= >>=20 >> I=E2=80=99m not sure actually. Isn't udev/systemd netns-aware? >> I would expect it to be able to provide names also to netdevs in = netns different than default netns. >=20 > I think most people move devices after they are renamed. So? Si-Wei patch handles the issue that resolves from the fact the = net-failover master will be opened before the rename on the net-failover = slaves occur. This should happen (to my understanding) regardless of network = namespaces. -Liran >=20 >> If that=E2=80=99s the case, Si-Wei patch to be able to rename a = net-failover slave when it is already open is still required. As the = race-condition still exists. >>=20 >> -Liran >>=20 >>>=20 >>>>>=20 >>>>> --=20 >>>>> MST