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 2A44BC43381 for ; Tue, 19 Mar 2019 23:06:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2F1C217F4 for ; Tue, 19 Mar 2019 23:06:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qRB2ij8g" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726933AbfCSXGO (ORCPT ); Tue, 19 Mar 2019 19:06:14 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:53104 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbfCSXGO (ORCPT ); Tue, 19 Mar 2019 19:06:14 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2JMxGb5135757; Tue, 19 Mar 2019 23:06:01 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=gqk0x3iNMLO+CEzRXCsG6NYr0732PvKNEZKI64LIY5U=; b=qRB2ij8genCzXCptW5bRKyR+1pOVSK+6yLnN5Wkj12mPmVff9cDJI8UpD+u6NFxdG6Em RMJlFafVVdcAQ9OYGSk6n18IUGyy5mvriaGelvTs2XwUNYkLeKgL3Tc12uKy30wbYEav 9PXIfcgWsu8thKRp5YpwdEkzuqQQ7b02CI9d2Sdlvoemo8D058sM7I7Cag/GP6/nYSb6 5e8fYMmJJoTm/hxR1q0pT0cQo8Vu8gvk2VBwCY8+jhwWn3HsnEANFL+0d+JOmh27pruO y0yzeQqPcsK/GfLz+7rx/OSddE1xGbsQIf+SWy1MS8Bom/EbxzOVJ0NFHsgeRxUlrqUk Yg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2r8pneqv4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 23:06:01 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2JN5xOW021102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 23:06:00 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2JN5wcO015444; Tue, 19 Mar 2019 23:05:58 GMT Received: from [192.168.14.112] (/109.67.245.189) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 16:05:57 -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: <20190319170445-mutt-send-email-mst@kernel.org> Date: Wed, 20 Mar 2019 01:05:51 +0200 Cc: Si-Wei Liu , Sridhar Samudrala , Alexander Duyck , Stephen Hemminger , 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: References: <20190317095052-mutt-send-email-mst@kernel.org> <54E7C3AF-C3C5-4AF2-86C9-AA50389F855F@oracle.com> <20190319170445-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=9200 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-1903190159 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > On 19 Mar 2019, at 23:06, Michael S. Tsirkin wrote: >=20 > On Tue, Mar 19, 2019 at 02:38:06PM +0200, Liran Alon wrote: >> Hi Michael, >>=20 >> Great blog-post which summarise everything very well! >>=20 >> Some comments I have: >=20 > Thanks! > I'll try to update everything in the post when I'm not so jet-lagged. >=20 >> 1) I think that when we are using the term =E2=80=9C1-netdev model=E2=80= =9D on community discussion, we tend to refer to what you have defined = in blog-post as "3-device model with hidden slaves=E2=80=9D. >> Therefore, I would suggest to just remove the =E2=80=9C1-netdev = model=E2=80=9D section and rename the "3-device model with hidden = slaves=E2=80=9D section to =E2=80=9C1-netdev model=E2=80=9D. >>=20 >> 2) The userspace issues result both from using =E2=80=9C2-netdev = model=E2=80=9D and =E2=80=9C3-netdev model=E2=80=9D. However, they are = described in blog-post as they only exist on =E2=80=9C3-netdev model=E2=80= =9D. >> The reason these issues are not seen in Azure environment is because = these issues were partially handled by Microsoft for their specific = 2-netdev model. >> Which leads me to the next comment. >>=20 >> 3) I suggest that blog-post will also elaborate on what exactly are = the userspace issues which results in models different than =E2=80=9C1-net= dev model=E2=80=9D. >> The issues that I=E2=80=99m aware of are (Please tell me if you are = aware of others!): >> (a) udev rename race-condition: When net-failover device is opened, = it also opens it's slaves. However, the order of events to udev on = KOBJ_ADD is first for the net-failover netdev and only then for the = virtio-net netdev. This means that if userspace will respond to first = event by open the net-failover, then any attempt of userspace to rename = virtio-net netdev as a response to the second event will fail because = the virtio-net netdev is already opened. Also note that this udev rename = rule is useful because we would like to add rules that renames = virtio-net netdev to clearly signal that it=E2=80=99s used as the = standby interface of another net-failover netdev. >> The way this problem was workaround by Microsoft in NetVSC is to = delay the open done on slave-VF from the open of the NetVSC netdev. = However, this is still a race and thus a hacky solution. It was accepted = by community only because it=E2=80=99s internal to the NetVSC driver. = However, similar solution was rejected by community for the net-failover = driver. >> The solution that we currently proposed to address this (Patch by = Si-Wei) was to change the rename kernel handling to allow a net-failover = slave to be renamed even if it is already opened. Patch is still not = accepted. >> (b) Issues caused because of various userspace components DHCP the = net-failover slaves: DHCP of course should only be done on the = net-failover netdev. Attempting to DHCP on net-failover slaves as-well = will cause networking issues. Therefore, userspace components should be = taught to avoid doing DHCP on the net-failover slaves. The various = userspace components include: >> b.1) dhclient: If run without parameters, it by default just enum all = netdevs and attempt to DHCP them all. >> (I don=E2=80=99t think Microsoft has handled this) >> b.2) initramfs / dracut: In order to mount the root file-system from = iSCSI, these components needs networking and therefore DHCP on all = netdevs. >> (Microsoft haven=E2=80=99t handled (b.2) because they don=E2=80=99t = have images which perform iSCSI boot in their Azure setup. Still an open = issue) >> b.3) cloud-init: If configured to perform network-configuration, it = attempts to configure all available netdevs. It should avoid however = doing so on net-failover slaves. >> (Microsoft has handled this by adding a mechanism in cloud-init to = blacklist a netdev from being configured in case it is owned by a = specific PCI driver. Specifically, they blacklist Mellanox VF driver. = However, this technique doesn=E2=80=99t work for the net-failover = mechanism because both the net-failover netdev and the virtio-net netdev = are owned by the virtio-net PCI driver). >> b.4) Various distros network-manager need to be updated to avoid DHCP = on net-failover slaves? (Not sure. Asking...) >>=20 >> 4) Another interesting use-case where the net-failover mechanism is = useful is for handling NIC firmware failures or NIC firmware = Live-Upgrade. >> In both cases, there is a need to perform a full PCIe reset of the = NIC. Which lose all the NIC eSwitch configuration of the various VFs. >=20 > In this setup, how does VF keep going? If it doesn't keep going, why = is > it helpful? Let me attempt to clarify. First, let=E2=80=99s analyse what can a cloud provider do when it wishes = to upgrade the NIC firmware when there are currently running guests = utilising SR-IOV. He can perform the following operations in order: 1) Hot-unplug all VFs from all running guests. 2) Upgrade NIC firmware. Will result in PCIe reset which will cause = momentary network down-time on PF but immediately afterwards PF will be = set up again and guests will have network connectivity. 3) Provision and hot-plug new VFs for all running guests. Guests again = have accelerated networking. Without the net-failover mechanism, host will have to hot-unplug all VFs = from all running guests and provision new VFs and hot-plug them anyway. = But in that case, the network down-time for guests is longer. Second, let=E2=80=99s analyse what will happen when health service = running on host notice that NIC firmware is in a bad state and therefore = NIC should be reset to recover. The health service can take exactly the same order of operations as = described above besides (2) which will just become a PCIe reset. Again, guests have shorter network down-time in this case as-well when = utilising the net-failover mechanism. >=20 >> To handle these cases gracefully, one could just hot-unplug all VFs = from guests running on host (which will make all guests now use the = virtio-net netdev which is backed by a netdev that eventually is on top = of PF). Therefore, networking will be restored to guests once the PCIe = reset is completed and the PF is functional again. To re-acceelrate the = guests network, hypervisor can just hot-plug new VFs to guests. >>=20 >> P.S: >> I would very appreciate all this forum help in closing on the pending = items written in (3). Which currently prevents using this net-failover = mechanism in real production use-cases. >>=20 >> Regards, >> -Liran >>=20 >>> On 17 Mar 2019, at 15:55, Michael S. Tsirkin wrote: >>>=20 >>> Hi all, >>> I've put up a blog post with a summary of where network >>> device failover stands and some open issues. >>> Not sure where best to host it, I just put it up on blogspot: >>> = https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__mstsirkin.blogspot.= com_2019_03_virtio-2Dnetwork-2Ddevice-2Dfailover-2Dsupport.html&d=3DDwIBAg= &c=3DRoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=3DJk6Q8nNzkQ6LJ6g42qARk= g6ryIDGQr-yKXPNGZbpTx0&m=3Djd0emHx6EkPSTvO0TytfYmG4rOMQ9htenhrgKprrh9E&s=3D= 5EJamlc_g1lZa0Ga7K30E6aWVg3jy8lizhw1aSguo3A&e=3D >>>=20 >>> Comments, corrections are welcome! >>>=20 >>> --=20 >>> MST