Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758111AbcLPS5P (ORCPT ); Fri, 16 Dec 2016 13:57:15 -0500 Received: from mail-sn1nam01on0097.outbound.protection.outlook.com ([104.47.32.97]:6845 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753265AbcLPS5G (ORCPT ); Fri, 16 Dec 2016 13:57:06 -0500 From: KY Srinivasan To: Haiyang Zhang , Stephen Hemminger , Greg KH CC: "olaf@aepfle.de" , "jasowang@redhat.com" , "linux-kernel@vger.kernel.org" , "bjorn.helgaas@gmail.com" , "apw@canonical.com" , "devel@linuxdriverproject.org" , "leann.ogasawara@canonical.com" Subject: RE: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial numbers Thread-Topic: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial numbers Thread-Index: AQHSUR217WryFwQHM0aSgrk15jlaWqD+NO0AgABUCDCAALFKAIAAtV0AgAAei4CAAAWGgIAAEUeAgAAD1wCAAAJrgIAAAyuAgAAIXYCAAB3RAIAAyPCAgAcBK4CAAAKCAIAABpgAgAGl5UCAAO/7AIAAN2Ag Date: Fri, 16 Dec 2016 18:39:42 +0000 Message-ID: References: <20161209122935.2bd0779e@xeon-e3> <20161209134510.22087f81@xeon-e3> <20161209140509.1dd7cad2@xeon-e3> <20161209162148.44887938@xeon-e3> <20161210122059.GA21421@kroah.com> <20161214232758.GA24234@kroah.com> <20161214155134.2015831f@xeon-e3> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kys@microsoft.com; x-originating-ip: [2001:4898:80e8:1::5a] x-ms-office365-filtering-correlation-id: 3be4db1a-9a28-4ef9-97fe-08d425e2e65b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR03MB1422; x-microsoft-exchange-diagnostics: 1;CY1PR03MB1422;7:kOC4y4QjiLPRyQKDfeCfU/RnFtLq2QbMnsKpvbaqMidAvPPKRVuMqrjfVnACunUXuYn1oyr2bH+6cldGgW1KqwXNBmfLUBz8XB7xKbZ9S+6n6k5XqR6ehNdG0g5Sg50hgIWm9aHSTEggVd+eNnssCQJae48Hza7vD0RrSUuYY8oNG2RtxBki0Lmq7vq215scQRo8PRSQaFO58Ohi9VVsaWyL/fjQJErlcsBPRMp/hd+gDF3eieMwF73y+w/wJOCkOvgRSCBIf1oWeBddGfax+H/8Clc8YwogdLNSswOUFMlWwUIDNN4qri7MZqZccBqiti2JxfH1Y6EBIfgSyEAJn+bytAek4q98ODD+FVmD/7O5afjtYO4fZxd2WbQ/Do+UxU2HsIeRkVOSOAuVa0R2k4sGd3VIsTN/3By/knLZLlQ/EGviIGbDW1nShArlmaASY8+HVUWVBBQ2TMvC46MUTJyO1Z5PQh5SZZnx2/7Scyw= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(198206253151910); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148)(6047074);SRVR:CY1PR03MB1422;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1422; x-forefront-prvs: 01583E185C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39840400002)(39410400002)(39850400002)(39860400002)(39450400003)(13464003)(377454003)(40224003)(199003)(189002)(6506006)(81166006)(3280700002)(77096006)(189998001)(5660300001)(33656002)(39060400001)(229853002)(102836003)(6116002)(38730400001)(76576001)(86612001)(97736004)(68736007)(86362001)(6436002)(9686002)(93886004)(5001770100001)(25786008)(10290500002)(76176999)(305945005)(54356999)(8936002)(106116001)(105586002)(106356001)(74316002)(2900100001)(50986999)(3660700001)(7736002)(81156014)(5005710100001)(10090500001)(8990500004)(3900700001)(2950100002)(4326007)(2906002)(2561002)(2421001)(1511001)(122556002)(101416001)(7696004)(99286002)(8676002)(92566002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1422;H:DM5PR03MB2490.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2016 18:39:42.1399 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1422 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uBGIvJqu023426 Content-Length: 3562 Lines: 88 > -----Original Message----- > From: Haiyang Zhang > Sent: Friday, December 16, 2016 7:21 AM > To: KY Srinivasan ; Stephen Hemminger > ; Greg KH > Cc: olaf@aepfle.de; jasowang@redhat.com; linux-kernel@vger.kernel.org; > bjorn.helgaas@gmail.com; apw@canonical.com; > devel@linuxdriverproject.org; leann.ogasawara@canonical.com > Subject: RE: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial > numbers > > > > > -----Original Message----- > > From: KY Srinivasan > > Sent: Thursday, December 15, 2016 8:11 PM > > To: Stephen Hemminger ; Greg KH > > > > Cc: olaf@aepfle.de; jasowang@redhat.com; linux-kernel@vger.kernel.org; > > bjorn.helgaas@gmail.com; apw@canonical.com; > devel@linuxdriverproject.org; > > leann.ogasawara@canonical.com; Haiyang Zhang > > > Subject: RE: [PATCH 3/3] hv_netvsc: Implement VF matching based on > > serial numbers > > > > > > > > > -----Original Message----- > > > From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] > On > > > Behalf Of Stephen Hemminger > > > Sent: Wednesday, December 14, 2016 3:52 PM > > > To: Greg KH > > > Cc: olaf@aepfle.de; jasowang@redhat.com; linux- > kernel@vger.kernel.org; > > > bjorn.helgaas@gmail.com; apw@canonical.com; > > > devel@linuxdriverproject.org; leann.ogasawara@canonical.com; Haiyang > > > Zhang > > > Subject: Re: [PATCH 3/3] hv_netvsc: Implement VF matching based on > > serial > > > numbers > > > > > > Normally, that would work but in this case we have one driver (netvsc) > > > which is managing another driver which is unaware of Hyper-V or netvsc > > > drivers existence. The callback is happening in netvsc driver and it > > > needs to say "hey I know that SR-IOV device, it is associated with my > > > network device". This problem is how to know that N is associated with > > > V? The V device has to be a network device, that is easy. But then it > > > also has to be a PCI device, not to bad. But then the netvsc code > > > is matching based on hyper-V only PCI bus metadata (the serial #). > > > > > > The Microsoft developers made the rational decision not to go > > modifying > > > all the possible SR-IOV network devices from Intel and Mellanox to add > > > the functionality there. That would have been much worse. > > > > > > Maybe, rather than trying to do the management in the kernel it > > > could have been done better in user space. Unfortunately, this would > > > only move the problem. The PCI-hyperv host driver could expose serial > > > value through sysfs (with some pain). But the problem would be how > > > to make a new API to join the two V and N device. Doing a private > > > ioctl is worse than the notifier. > > > > All this has been discussed earlier in the thread. I think I have a > > solution > > to the problem: > > The only PCI (non-VF) NIC that may be present in the VM is the emulated > > NIC and > > we know exactly the device ID and vendor ID of this NIC. Furthermore, > > as a platform we are not going to be emulating additional NICs. So, > > if the PCI NIC is not the emulated NIC, it must be a VF and we can > > extract the > > serial number. > > How about direct pass-through NIC devices. Do they have vPCI serial > number? > And, the numbers should be different from VF NIC? This may not have a valid serial number; but is still a descendent of vmbus. K. Y > > Thanks, > - Haiyang