From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 0/2] hv_netvsc: associate VF and PV device by serial number Date: Thu, 20 Sep 2018 09:50:11 -0700 Message-ID: <20180920095011.26406404@xeon-e3> References: <20180914195457.20433-1-sthemmin@microsoft.com> <20180920141820.GD838@e107981-ln.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, devel@linuxdriverproject.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org To: Lorenzo Pieralisi Return-path: Received: from mail-pl1-f194.google.com ([209.85.214.194]:38323 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731223AbeITWek (ORCPT ); Thu, 20 Sep 2018 18:34:40 -0400 Received: by mail-pl1-f194.google.com with SMTP id u11-v6so4625100plq.5 for ; Thu, 20 Sep 2018 09:50:18 -0700 (PDT) In-Reply-To: <20180920141820.GD838@e107981-ln.cambridge.arm.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 20 Sep 2018 15:18:20 +0100 Lorenzo Pieralisi wrote: > On Fri, Sep 14, 2018 at 12:54:55PM -0700, Stephen Hemminger wrote: > > The Hyper-V implementation of PCI controller has concept of 32 bit serial number > > (not to be confused with PCI-E serial number). This value is sent in the protocol > > from the host to indicate SR-IOV VF device is attached to a synthetic NIC. > > > > Using the serial number (instead of MAC address) to associate the two devices > > avoids lots of potential problems when there are duplicate MAC addresses from > > tunnels or layered devices. > > > > The patch set is broken into two parts, one is for the PCI controller > > and the other is for the netvsc device. Normally, these go through different > > trees but sending them together here for better review. The PCI changes > > were submitted previously, but the main review comment was "why do you > > need this?". This is why. > > The question was more whether we should convert this serial number into > a PCI slot number (that has user space visibility and that is what you are > after) to improve the current matching, I do not question why you need > it, just for the records. The name slot is way overloaded in this context. There is windows slot number which comes from Hyperv pci address slot which pci-hyperv sets from windows slot pci slot api value which for normal devices comes from ACPI this patch gets it from serial number The netvsc driver needed to be able to find a PCI device based on the serial number. The serial number was not visible in any current PCI-hyperv controller values. The windows slot (wslot) is not the same the serial number.