Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761989AbcLPP4u (ORCPT ); Fri, 16 Dec 2016 10:56:50 -0500 Received: from mail-dm3nam03on0134.outbound.protection.outlook.com ([104.47.41.134]:51724 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1761953AbcLPP4l (ORCPT ); Fri, 16 Dec 2016 10:56:41 -0500 From: Haiyang Zhang 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 Thread-Topic: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial numbers Thread-Index: AQHSUR21+bJgO3U+U0emkkp2CWFPCaD+NO0AgACI2oCAAHx4AIAAtV0AgAAbvVCAAAhUgIAAENNggAAESwCAAAHRAIAAA8WAgAAGUICAAB/eAIAAyPCAgAb+3GCAAATRAIAABpgAgAGolICAAOwjYA== Date: Fri, 16 Dec 2016 15:20:30 +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=haiyangz@microsoft.com; x-originating-ip: [72.74.33.140] x-ms-office365-filtering-correlation-id: 37c2adf2-7197-47e6-ac6c-08d425c71296 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR03MB2483; x-microsoft-exchange-diagnostics: 1;BN6PR03MB2483;7:dWlaGyq1FtW+uIPDEND1Ep9huOr7QQFhITIJWDkWvzvSnUCyd9lZ6tcf/6MQ21fpPJ59aRyfDqa8/9Sgj7mKpxzXLMumpL/aY1XPuUlnEnP4+W45/78oMlC4O9jcAl3rajGISVBjVExc/jwU3qZk+RIkhng/8qMYbJ3k0mnqbGnE9zXsKA0ddm2sRUvne3BVvtOHMyIKQ8NOzkq7NoGTN9y/10RQub/j/Kmge1P4IpTfm5a2hOkjuqvFm3zE5oWSZ7UD03ToYj3VdRUN7uCFJ+3Aoylnpdlm961oxB2madGweIkOywONVSPuEtrUJytLO7u2WCbuZ4Xuh/bzODNYmp5rB+VApu5Bau6Qt+A9U5XLqOAgWpEpWc3nf7UhBnhcR/bEuvCYX+aV4wlaS06b+HUBoJzNnYuuVJrcmULjf6qWsHJKiFN+c/Jf1eGIi8orqtco+9ZVh1987waR8swnO7DgBn5zaFZL1oQ+jHJCxyU= 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)(5005006)(8121501046)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148)(6047074);SRVR:BN6PR03MB2483;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2483; x-forefront-prvs: 01583E185C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39840400002)(39410400002)(39450400003)(39850400002)(39860400002)(40224003)(199003)(13464003)(189002)(377454003)(5001770100001)(2421001)(5005710100001)(8936002)(229853002)(86362001)(25786008)(76176999)(189998001)(38730400001)(39060400001)(54356999)(50986999)(68736007)(6436002)(6506006)(101416001)(77096006)(9686002)(3846002)(102836003)(6116002)(97736004)(2561002)(10090500001)(86612001)(2900100001)(7696004)(33656002)(1511001)(122556002)(66066001)(2950100002)(3280700002)(3660700001)(5660300001)(92566002)(76576001)(3900700001)(93886004)(305945005)(10290500002)(81156014)(8990500004)(81166006)(8676002)(4326007)(2906002)(7736002)(105586002)(106116001)(99286002)(106356001)(74316002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR03MB2483;H:BLUPR03MB1412.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 15:20:30.4394 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2483 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 uBGFusgu010830 Content-Length: 2846 Lines: 66 > -----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? Thanks, - Haiyang