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 4A116C43381 for ; Tue, 19 Mar 2019 21:55:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B0602146E for ; Tue, 19 Mar 2019 21:55:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Jwuojuoo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbfCSVz5 (ORCPT ); Tue, 19 Mar 2019 17:55:57 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:56510 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbfCSVz5 (ORCPT ); Tue, 19 Mar 2019 17:55:57 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2JLsYMV039946; Tue, 19 Mar 2019 21:55:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=6wUjZ4hejqGDhQXlfjLIMTLG/LxDi/JByMeu9FnyYwU=; b=Jwuojuooevw2uSSVjzdbYML2VwohAy6YYNW68T5kgy/EpnvorJjkX0y5jBceJWWc6rHX wKD1wym0dRaSE0dwrmFhlH82wo6fNB1lw0Wbawa1F1yf4sUD2V0RAMT3MGA5VomLqqQg wNNosm/6LGFaMfwOdj/ACFPn/tz8Su/YumHONd04NjXYBYBhBl7vdfEkYOZR5orI4RbN +qAtceoGTTW6wbtJVrC90w9wRaaKpeOmVzBGXOtbiSpnZGN/6Tc0DLAtUezY/D8ZfBJw a1qfm15zkrSD79xqXbRlki1HtfL8ckgfrCWbSTqPAE/xs5MQPLdGqkVXOxuFgYOORfSY RA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2r8rjuqfb0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 21:55:42 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2JLteQF030182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Mar 2019 21:55:41 GMT Received: from abhmp0022.oracle.com (abhmp0022.oracle.com [141.146.116.28]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2JLtd7T025712; Tue, 19 Mar 2019 21:55:39 GMT Received: from [10.159.134.250] (/10.159.134.250) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 14:55:39 -0700 Subject: Re: [summary] virtio network device failover writeup To: Liran Alon , "Michael S. Tsirkin" References: <20190317095052-mutt-send-email-mst@kernel.org> <54E7C3AF-C3C5-4AF2-86C9-AA50389F855F@oracle.com> Cc: 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 From: si-wei liu Organization: Oracle Corporation Message-ID: <106db6b4-1cce-2769-031b-2dae7c0f0e28@oracle.com> Date: Tue, 19 Mar 2019 14:55:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <54E7C3AF-C3C5-4AF2-86C9-AA50389F855F@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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=1011 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-1903190152 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 3/19/2019 5:38 AM, Liran Alon wrote: > Hi Michael, > > Great blog-post which summarise everything very well! > > Some comments I have: > > 1) I think that when we are using the term “1-netdev model” on community discussion, we tend to refer to what you have defined in blog-post as "3-device model with hidden slaves”. > Therefore, I would suggest to just remove the “1-netdev model” section and rename the "3-device model with hidden slaves” section to “1-netdev model”. > > 2) The userspace issues result both from using “2-netdev model” and “3-netdev model”. However, they are described in blog-post as they only exist on “3-netdev model”. > 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. > > 3) I suggest that blog-post will also elaborate on what exactly are the userspace issues which results in models different than “1-netdev model”. > The issues that I’m 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’s 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’s 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’t 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’t handled (b.2) because they don’t 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’t 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...) Add one additional issue that was just uncovered: b.5) netplan: 3-netdev confused Ubuntu's netplan tool which dynamically generates udev rules in /run/udev/rules.d on the fly that matches netdev by MAC address only. I will file an enhancement request on launchpad later. -Siwei > > 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. > 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. > > 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. > > Regards, > -Liran > >> On 17 Mar 2019, at 15:55, Michael S. Tsirkin wrote: >> >> 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=https-3A__mstsirkin.blogspot.com_2019_03_virtio-2Dnetwork-2Ddevice-2Dfailover-2Dsupport.html&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=Jk6Q8nNzkQ6LJ6g42qARkg6ryIDGQr-yKXPNGZbpTx0&m=jd0emHx6EkPSTvO0TytfYmG4rOMQ9htenhrgKprrh9E&s=5EJamlc_g1lZa0Ga7K30E6aWVg3jy8lizhw1aSguo3A&e= >> >> Comments, corrections are welcome! >> >> -- >> MST