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=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,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 B9699C10F06 for ; Sat, 6 Apr 2019 07:21:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E21520879 for ; Sat, 6 Apr 2019 07:21:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="JIyRhP/D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbfDFHVc (ORCPT ); Sat, 6 Apr 2019 03:21:32 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:50692 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfDFHVc (ORCPT ); Sat, 6 Apr 2019 03:21:32 -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 x365i0kD008664; Sat, 6 Apr 2019 07:21:22 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=6x2gRHJl2DLpZbCjadtYcJZdd+ZFPRaJrTFKZ0JLWpw=; b=JIyRhP/DUfrZuGlXI8MVoIyLsqi23j//V7u6Ea5kvusoWzKh8E296+DMe6ZNq0KxUm4I U3UmRoKBk1xdpou+w75AZVzldok1q5mXcBQuVSDFEBvgxtf/3Z2tvCv9m6uM/pdrce+B Xj4D/dO5G3rbPCZdM9JFoUe7Yrrlb+9ZV9Qw00W/spmzzHdwowg4dd/gtCsHdIOHLxTT i7O1iFlSVZChL0lrv/HDV5HV1nXrSdkHYk2gCOcldtpYpDKyjKsrZ7Epde8pFHW2nKHG e/nlVeFnCkFhKNKq2uufoj0jz/X9Q5d7Zwk3VV4YZcQwroQinfNS9miv7+BxIJJ0iI5W vw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2rpkhsg8ue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 06 Apr 2019 07:21:21 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x367JqUW062182; Sat, 6 Apr 2019 07:21:21 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2rpkeh2dgu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 06 Apr 2019 07:21:21 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x367LJp7020984; Sat, 6 Apr 2019 07:21:19 GMT Received: from [192.168.0.18] (/76.102.100.140) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 06 Apr 2019 00:21:19 -0700 Subject: Re: [PATCH net v6] failover: allow name change on IFF_UP slave interfaces To: Stephen Hemminger , "Michael S. Tsirkin" References: <1554267167-17561-1-git-send-email-si-wei.liu@oracle.com> <20190405172835-mutt-send-email-mst@kernel.org> <20190405144750.441e396f@shemminger-XPS-13-9360> Cc: sridhar.samudrala@intel.com, davem@davemloft.net, kubakici@wp.pl, alexander.duyck@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, liran.alon@oracle.com, boris.ostrovsky@oracle.com, vijay.balakrishna@oracle.com From: si-wei liu Organization: Oracle Corporation Message-ID: Date: Sat, 6 Apr 2019 00:21:09 -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: <20190405144750.441e396f@shemminger-XPS-13-9360> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9218 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904060036 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9218 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-1904060036 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 4/5/2019 2:47 PM, Stephen Hemminger wrote: > On Fri, 5 Apr 2019 17:28:55 -0400 > "Michael S. Tsirkin" wrote: > >> On Wed, Apr 03, 2019 at 12:52:47AM -0400, Si-Wei Liu wrote: >>> When a netdev appears through hot plug then gets enslaved by a failover >>> master that is already up and running, the slave will be opened >>> right away after getting enslaved. Today there's a race that userspace >>> (udev) may fail to rename the slave if the kernel (net_failover) >>> opens the slave earlier than when the userspace rename happens. >>> Unlike bond or team, the primary slave of failover can't be renamed by >>> userspace ahead of time, since the kernel initiated auto-enslavement is >>> unable to, or rather, is never meant to be synchronized with the rename >>> request from userspace. >>> >>> As the failover slave interfaces are not designed to be operated >>> directly by userspace apps: IP configuration, filter rules with >>> regard to network traffic passing and etc., should all be done on master >>> interface. In general, userspace apps only care about the >>> name of master interface, while slave names are less important as long >>> as admin users can see reliable names that may carry >>> other information describing the netdev. For e.g., they can infer that >>> "ens3nsby" is a standby slave of "ens3", while for a >>> name like "eth0" they can't tell which master it belongs to. >>> >>> Historically the name of IFF_UP interface can't be changed because >>> there might be admin script or management software that is already >>> relying on such behavior and assumes that the slave name can't be >>> changed once UP. But failover is special: with the in-kernel >>> auto-enslavement mechanism, the userspace expectation for device >>> enumeration and bring-up order is already broken. Previously initramfs >>> and various userspace config tools were modified to bypass failover >>> slaves because of auto-enslavement and duplicate MAC address. Similarly, >>> in case that users care about seeing reliable slave name, the new type >>> of failover slaves needs to be taken care of specifically in userspace >>> anyway. >>> >>> It's less risky to lift up the rename restriction on failover slave >>> which is already UP. Although it's possible this change may potentially >>> break userspace component (most likely configuration scripts or >>> management software) that assumes slave name can't be changed while >>> UP, it's relatively a limited and controllable set among all userspace >>> components, which can be fixed specifically to listen for the rename >>> and/or link down/up events on failover slaves. Userspace component >>> interacting with slaves is expected to be changed to operate on failover >>> master interface instead, as the failover slave is dynamic in nature >>> which may come and go at any point. The goal is to make the role of >>> failover slaves less relevant, and userspace components should only >>> deal with failover master in the long run. >>> >>> Fixes: 30c8bd5aa8b2 ("net: Introduce generic failover module") >>> Signed-off-by: Si-Wei Liu >>> Reviewed-by: Liran Alon >> Acked-by: Michael S. Tsirkin >> >> Stephen are you happy with this approach? > I think it is the best solution for what you want to do. Since you're asking specifically, I tried what you suggested below. > Did you test with some things like Free Range Routing, Although there might be spurious warning (which is a check for sanity more than an error) while slave interface is up, slave rename had been handled quite well there, no matter which state slave is at. https://github.com/FRRouting/frr/blob/master/zebra/if_netlink.c#L97 The FRR users are supposed to operate on failover master interface anyway. No one is expected to configure those passive interfaces for routing. > VPP Nothing particular was seen for this one. The netlink usage there doesn't seem related to my change: https://github.com/FDio/vpp/blob/master/src/vnet/devices/netlink.c > or other userspace > control planes that consume netlink? dhcpcd (https://github.com/kobolabs/dhcpcd/blob/kobo/if-linux.c#L761) was tested OK. In addition, the patch seems to play quite well with systemd-udev and dracut/initramfs-tools. No breakage, no weird error message was seen. What else do you suggest we should try/test with? Thanks, -Siwei