Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2702655rdb; Wed, 15 Nov 2023 08:14:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFk9Z6NLAdiGREkrY5iaWI1zDK0EiEYSXcUqFNED0K211xeLbL4QarNdiGz9I0NcUd4B3pY X-Received: by 2002:a05:6a21:999a:b0:186:1332:a930 with SMTP id ve26-20020a056a21999a00b001861332a930mr12374622pzb.38.1700064854448; Wed, 15 Nov 2023 08:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700064854; cv=none; d=google.com; s=arc-20160816; b=vM721+7vVDjv0IQivolm8nVcqlGI3uV08aO8wyUxv/Z7tPLUaCoZDoeJwmolvCfJ+e VI3c0B/ZYF4G+sWZGFjt+yp9bdzWi4RHP1lKTTSlK4Fdw+GnB5MUqJPNOlHaRVCZB3Nb AnHeX+/Z4ASoIhQGbwuDUmnyKQG1znMFfoRQBTy9ff5aEFozpqAhE+R8QEMK71WbEydx Hj9KMJRXApvmy0R6hlDiSlzGv4i7SPLyF2vR8s+o+LpYQ6mQS17JfFystGQJoKQFmDY/ RRAqe482cCuT1s/jKacrdeloSOtaVYZQOOdnlfWUgaICNAjiGHhqQWAwW/P6BLyejT/u T7Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JTCjyeTH3cX9fhqDGQ0kYumqDVFAGEVz5sOZJI6Fmmc=; fh=QuaJjHWNTWYKUKIFOfZ7N7FGR7P0cZIQVMIZf6fvbgM=; b=Hc0Sx8jJINUJq13BDOCtB1Wmeo+YYi4GDIMsjStGrPwNfoNxKwD6daX7//HtdU9rcq nGsfKJ+knN5Kr9HCNzD/E4Wzx9WoIZyfV1Z0oqLmcLEYD3rCCsClqye3I+7RN2xdKvyL VF8sE8+6D9mk6fmc+maGurCsQ0PYIRF2CcBNCQMnh3PUhwdsrKhHahtHo57jcpODLihf SmR8546aGmSyOsPQY0Kb9jsLhjhDzCPbGJ41a7Qhh2MyVnSa7TwMzg91IsV+SM63XEqK YqpeQAdJjxg8OPDDbQEuoUx5jKgfZnhX3p0TIMwhI8i+jkHc8bRTXzaBoqrgC3NJyZ/J VsAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=p633r7Bx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bv4-20020a056a00414400b006c12323c3desi10468733pfb.350.2023.11.15.08.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 08:14:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20230601.gappssmtp.com header.s=20230601 header.b=p633r7Bx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=networkplumber.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 32EAD820E523; Wed, 15 Nov 2023 08:14:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbjKOQON (ORCPT + 99 others); Wed, 15 Nov 2023 11:14:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjKOQOM (ORCPT ); Wed, 15 Nov 2023 11:14:12 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03615AD for ; Wed, 15 Nov 2023 08:14:09 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cc3bb4c307so55348615ad.0 for ; Wed, 15 Nov 2023 08:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1700064848; x=1700669648; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=JTCjyeTH3cX9fhqDGQ0kYumqDVFAGEVz5sOZJI6Fmmc=; b=p633r7BxseyXEyYD4g+qS7QQi0R67eFeUmiOAu0p7BZ9CzVKvgz8sO+tWhpEHPWZAn 5kMcz+oDzhi+/oFiBQxk53GEaPwqpOERWVk/eRaQWOX3X6CRdtujVJUXS1SzyB+XzTUz TP/7KhhPG7ln2CJoFtgc6stjvCoQ+TNgWhI3IxHHjlCZHEYLTvcIgGxoh2oPqc61cqi6 24yrBHlFd4mj36eRzDAPzqUfGbd6t7hlxHvnNMYRsbOLzbG3DX9uz9rYJ9BUdHQOK1Pm ceodcXIu3+lFetPgGnb/HXpUcOnLPpKmYlgVel9lj0N/5gHSmoCE3w0f7/7ewVgp3N9s iqVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700064848; x=1700669648; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JTCjyeTH3cX9fhqDGQ0kYumqDVFAGEVz5sOZJI6Fmmc=; b=SDJznAROH3JIphteDqRRt4MhDYcgAr/9Nsl4qSPyrDj+cxH/ahF7TV7o0vhTsXgmxO soB+ohv6OfoY+ysQiJVLQ5WzoQJkt0we+DAgxZTTbWTFQO0FmGu3pG519nDEV2lfHnWl WEH4BdP9Zig431hA7xeGIED90GSD3J/0UaqPcCrCR6R5ylI6wiq7Inshp2Jk6/YCWXeN XLZflAhoJBjA1MWgMfqGcW6jpqd5FtrU+cwcQNGPv0Ck2UIuoM9H9XThQD9Hp1CvGxTK RGzFJFXX+BWzEgEwOsqvwhz67FoZeatsCbkBPM+bYokUknOV/5oFhR20MkcKmAMmN++C UUlA== X-Gm-Message-State: AOJu0YwCa7CU0FXuwzTLjF2CG3SwDu3qzdZ5jELom4BhUGOpVBI3hOpw 2dipJV7XWO7p3tqp3OEuSJtiRA== X-Received: by 2002:a17:902:8c96:b0:1cc:47d5:b761 with SMTP id t22-20020a1709028c9600b001cc47d5b761mr5496398plo.35.1700064848428; Wed, 15 Nov 2023 08:14:08 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id j9-20020a170903024900b001b8b1f6619asm7600557plh.75.2023.11.15.08.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 08:14:08 -0800 (PST) Date: Wed, 15 Nov 2023 08:14:06 -0800 From: Stephen Hemminger To: Jakub Kicinski Cc: Long Li , "longli@linuxonhyperv.com" , KY Srinivasan , Haiyang Zhang , Wei Liu , Dexuan Cui , "David S. Miller" , Eric Dumazet , Paolo Abeni , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next v4] hv_netvsc: Mark VF as slave before exposing it to user-mode Message-ID: <20231115081406.1bd9a4ed@hermes.local> In-Reply-To: <20231110120513.45ed505c@kernel.org> References: <1699484212-24079-1-git-send-email-longli@linuxonhyperv.com> <20231108181318.5360af18@kernel.org> <20231110120513.45ed505c@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 08:14:13 -0800 (PST) On Fri, 10 Nov 2023 12:05:13 -0800 Jakub Kicinski wrote: > On Fri, 10 Nov 2023 00:43:55 +0000 Long Li wrote: > > The code above needs to work with and without netvsc (the possible > > master device) present. > > I don't think that's a reasonable requirement for the kernel code. > > The auto-bonding already puts the kernel into business of guessing > policy, which frankly we shouldn't be in. > > Having the kernel guess even harder that there will be a master, > but it's not there yet, is not reasonable. > I wrote the netvsc automatic VF code almost six years ago. So let me give a little history. The original support of VF's was done by using a bonding device and script. Haiyang worked hard to get to work but it could not work on many distro's and had lots of races and problems. Jakub is right that in an ideal world, this could all be managed by userspace. But the management of network devices in Linux is a dumpster fire! Every distro invents there own solution, last time I counted there were six different tools claiming to be the "one network device manager to rule them all". And that doesn't include all the custom scripts and vendor appliances. The users requirements were: - VF networking should work out of the box - VF networking should require no userspace changes - It must work with legacy enterprise distro's - The first network device must show up as eth0 and it must work. The Linux ecosystem of userspace but the kernel is a common base. It was much easier for Microsoft to tell partners to "use these upstream kernel components" and it will work. Windows and BSD OS's have a tight binding between kernel and management from userspace, therefore it is possible to handle things in userspace. There are still problems (as Long indicated in the patch) because the VF device does appear in the list of network devices. And getting the transparent VF support to work in the face of all the trash of userspace scripts is hard. Part of the problem is that the state model of Linux network devices is fractured and poorly documented. The IFF_SLAVE flag is already used to indicate device is managed by another driver. It keeps IPv6 from doing local address assignment and existing userspace should be looking at it. The problem was that userspace must not see a non-flagged VF device, or it will get confused. Microsoft should have exposed only one device in hardware. Other vendors only expose the VF device and hairpin packets any pre-processed packets. Part of the problem here is that VF firmware needs to be updated (too often) and it is a requirement that VM's do not lose connectivity. Ideally, several things should happen: - Linux should support hiding devices managed by another device - the naming of device roles needs to not be master/slave.