From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755502AbcLBGDA (ORCPT ); Fri, 2 Dec 2016 01:03:00 -0500 Received: from mail-by2nam01on0090.outbound.protection.outlook.com ([104.47.34.90]:16288 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753332AbcLBGC7 (ORCPT ); Fri, 2 Dec 2016 01:02:59 -0500 From: KY Srinivasan To: Greg KH 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 Thread-Topic: [PATCH 02/15] hyperv: Add a function to detect hv_device Thread-Index: AQHSS+hcRHtOOpPMlEiibc7N0eIJt6DzjS2AgACaP1A= Date: Fri, 2 Dec 2016 06:02:29 +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> In-Reply-To: <20161201203547.GB1602@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: [2601:600:8c00:1040:8d4f:4276:55f2:2e42] x-ms-office365-filtering-correlation-id: aadcfee1-3287-420f-0f25-08d41a78cce2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN3PR03MB1414; x-microsoft-exchange-diagnostics: 1;BN3PR03MB1414;7:be/HNeI8lKSXcsc5esFuYYql6OBKfWhh3aw47l2ldxXGLC8gVh4X7mG/boOT27SKcrMiblFyyayVnqH0ahyZTK9tRXgWBc6zI3X/pEnDeKxsv95YmbOJuz97riy2BWiwKkBoo4eYMNWFkKTnQSU+PWTw9oa8n2DVAyA1ae7oo1INFL7cKmnpRInEPnyH9wz2jMLdD10TlGBAhOm7Br8detQF/SEKzsyCf4yJn2a9QaFdE0NIbWv4msQmLwwR0IT9A/879lg8mzTTwp2J2cK8014efKY47frdlfe2lt3Kne45w/1UOSa+xoO2q5IVU8hKd3OTSdUgQRvcZSfpSBkPdf5JaPXHHKb6MgTy8Y+jfdoPamPd2CKJlE/LjUb85e4oya7TN5oLGlidwP1gLGjZp4D4jz5g/pJRoA098FdKfU24+ZUSl4QQx/V8H4EH9BVMg6RByvXAzXCFixpSTEzrBKuZ2qo7bQp8sTCVYIgozOM= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(140211028294663)(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)(189002)(199003)(24454002)(377454003)(13464003)(74316002)(33656002)(81166006)(4001430100002)(8936002)(10090500001)(8676002)(2906002)(81156014)(3280700002)(68736007)(9686002)(3660700001)(50986999)(54356999)(105586002)(92566002)(101416001)(5005710100001)(6506004)(106116001)(189998001)(6116002)(106356001)(10290500002)(102836003)(97736004)(99286002)(4326007)(305945005)(5660300001)(6916009)(110136003)(107886002)(122556002)(8990500004)(93886004)(7696004)(76176999)(2900100001)(38730400001)(86362001)(39410400001)(7846002)(86612001)(7736002)(76576001)(229853002)(2950100002)(77096006)(39450400002);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 06:02:29.9915 (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 uB2635GH011205 > -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Thursday, December 1, 2016 12: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 Thu, Dec 01, 2016 at 09:28:39AM -0800, kys@exchange.microsoft.com > wrote: > > From: Haiyang Zhang > > > > Signed-off-by: Haiyang Zhang > > Signed-off-by: K. Y. Srinivasan > > --- > > drivers/hv/vmbus_drv.c | 6 ++++++ > > include/linux/hyperv.h | 2 ++ > > 2 files changed, 8 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > > index 0276d2e..1730ac0 100644 > > --- a/drivers/hv/vmbus_drv.c > > +++ b/drivers/hv/vmbus_drv.c > > @@ -692,6 +692,12 @@ struct onmessage_work_context { > > struct hv_message msg; > > }; > > > > +bool device_is_hyperv(struct device *dev) > > +{ > > + return dev->release == vmbus_device_release; > > +} > > +EXPORT_SYMBOL_GPL(device_is_hyperv); > > Wait, eek, no! That's NOT how you determine a device type, if you > really even ever need to do that. > > Why are you needing this? You should always "just know" what type of > device a struct device * is, that's what we rely on in the driver model. > Otherwise things get messy very very quickly. > > Sorry, I can't take this without a ton of justification, and even then, > you need to do this correctly (and no, I'm not going to tell you how to > do that as I don't like it being done...) > Greg, To support SR-IOV, netvsc registers for all netdev events. For netdev events related to the VF interface, we need to do some special processing. And so, we need to determine if the device that is generating the netdev event is Hyper-V device or not (passed through the PCI pass through driver). Is this justification sufficient. As you have observed, currently there is no user of this API and that is because netvsc will be the user. To avoid cross-tree dependency, we wanted to get this functionality in first before submitting the netvsc patch. Regards, K. Y > greg k-h