Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932171AbcLBVly (ORCPT ); Fri, 2 Dec 2016 16:41:54 -0500 Received: from mail-bl2nam02on0137.outbound.protection.outlook.com ([104.47.38.137]:16265 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752156AbcLBVlx (ORCPT ); Fri, 2 Dec 2016 16:41:53 -0500 From: KY Srinivasan To: Greg KH CC: "olaf@aepfle.de" , "jasowang@redhat.com" , Haiyang Zhang , "linux-kernel@vger.kernel.org" , "apw@canonical.com" , "devel@linuxdriverproject.org" , "leann.ogasawara@canonical.com" Subject: RE: [PATCH 02/15] hyperv: Add a function to detect hv_device Thread-Topic: [PATCH 02/15] hyperv: Add a function to detect hv_device Thread-Index: AQHSS+hcRHtOOpPMlEiibc7N0eIJt6DzjS2AgACaP1CAABDUgIAAAKewgAAMzQCAAIJ0gIAACyGAgABSA9A= Date: Fri, 2 Dec 2016 21:41:50 +0000 Message-ID: References: <1480613287-7748-1-git-send-email-kys@exchange.microsoft.com> <1480613332-7788-1-git-send-email-kys@exchange.microsoft.com> <1480613332-7788-2-git-send-email-kys@exchange.microsoft.com> <20161201203547.GB1602@kroah.com> <20161202064805.GA19267@kroah.com> <20161202073614.GA21628@kroah.com> <20161202160259.GA6050@kroah.com> In-Reply-To: <20161202160259.GA6050@kroah.com> 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:6::344] x-ms-office365-filtering-correlation-id: 8fa7138d-ff93-4f36-3f5c-08d41afc0696 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN3PR03MB1414; x-microsoft-exchange-diagnostics: 1;BN3PR03MB1414;7:lbhJ0x325sNjyuC7Ny+dWOoMkxOtpyioCWi8r+jFb3cDXDbBJON0CKbGdI3LUapfojQK1+HdElRv1AecuLvgOomwnlTuyluenQc++jG6jxE/4zdjwSRGJIe458HbuYCqTZB40vG0Cqq6Q7YEpQQS+1iVqn5er8viA+EJCyDZ1lktbK4QkqS8igQSWfLihrIEeTbxFL9Y4LmMs/mAH6yyUMblqsu9B63Y7Sr9LQR4juU0nGPiLP3Qx5/hgPgt+meDsjm78Ceh+NvOI27kQ+qYQP8XXN3FLoo2ODDiSJbbj9pqN0kCXydiq3mrWGvQXxob8jLxnySLZbV7WWz+ybzhomzYt7QX2+PPHIMFFOngvDXjRnhqq7Ahc8WUr0To8OpViiOsLggq0B1pJIDf+XR+OlyeJVf7gkaKkv29Pr7D3rJXT06GGMdSPHfneF85e7pstzNSV9z0+8uJfdl/ruGnGYvpUfEohuotMOuXQyBzT8o= 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)(20161123555025)(20161123562025)(6047074)(6072148);SRVR:BN3PR03MB1414;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1414; x-forefront-prvs: 0144B30E41 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(40224003)(189002)(199003)(24454002)(377454003)(13464003)(74316002)(33656002)(8936002)(10090500001)(8676002)(81166006)(9686002)(81156014)(68736007)(2906002)(3280700002)(92566002)(3660700001)(105586002)(101416001)(50986999)(5005710100001)(106116001)(106356001)(6116002)(10290500002)(189998001)(97736004)(99286002)(102836003)(4326007)(54356999)(305945005)(5660300001)(6916009)(110136003)(122556002)(8990500004)(7696004)(93886004)(2900100001)(76176999)(38730400001)(86362001)(7846002)(39410400001)(86612001)(39450400002)(7736002)(2950100002)(229853002)(77096006)(76576001)(6506006);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1414;H:DM5PR03MB2490.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A: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: 02 Dec 2016 21:41:50.7470 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1414 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 uB2Lg01U027256 Content-Length: 2966 Lines: 75 > -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Friday, December 2, 2016 8:03 AM > To: KY Srinivasan > Cc: olaf@aepfle.de; jasowang@redhat.com; Haiyang Zhang > ; linux-kernel@vger.kernel.org; > apw@canonical.com; devel@linuxdriverproject.org; > leann.ogasawara@canonical.com > Subject: Re: [PATCH 02/15] hyperv: Add a function to detect hv_device > > On Fri, Dec 02, 2016 at 03:38:51PM +0000, KY Srinivasan wrote: > > > > > > > -----Original Message----- > > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > > Sent: Thursday, December 1, 2016 11:36 PM > > > To: KY Srinivasan > > > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; > > > olaf@aepfle.de; apw@canonical.com; vkuznets@redhat.com; > > > jasowang@redhat.com; leann.ogasawara@canonical.com; Haiyang Zhang > > > > > > Subject: Re: [PATCH 02/15] hyperv: Add a function to detect hv_device > > > > > > On Fri, Dec 02, 2016 at 07:14:03AM +0000, KY Srinivasan wrote: > > > > > In other words, why do you need this and PCI or USB doesn't? Why is > > > > > hyperv "special"? > > > > > > > > On Hyper-V, each VF interface (SR-IOV interface) > > > > is paired with an instance of the > > > > synthetic interface that is managed by netvsc. > > > > When the VF interface comes up, we > > > > need to associate the VF instance with > > > > the corresponding netvsc instance. To do this > > > > without modifying the VF drivers, netvsc registers > > > > for netdev events. > > > > > > Why not modify the VF drivers? You have the full source to them... > > Greg, > > > > This is even worse. On Linux, VF drivers are hypervisor agnostic > > and I want to keep it that way. > > Ok, I really don't know what to suggest, other than this is probably not > the way to do this as no other bus has to. As I don't see the code that > actually uses this anywhere, it's really impossible to have this > conversation at all :( I agree it is difficult to discuss this without having the code that uses this. That said, there is currently code in the tree that disambiguates the netdev events that netvsc sees - look at the function get_netvsc_bymac(). This function allows us to associate the VF interface that maybe coming up with the associated netvsc interface using MAC address. What I want to do is to not use the MAC address but to use a serial number that the host publishes. I could send the netvsc patches that use this if that would help here. In any case once we have this functionality, we will be submitting the patches that use this. What I am trying to do here is to implement the equivalent of dev_is_pci() for vmbus. You also had concerns about how we were implementing this functionality. We could certainly use the same mechanism used in dev_is_pci(). Perhaps I could also use the same naming convention - dev_is_hv()? Regards, K. Y > > greg k-h