From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbbLUWLX (ORCPT ); Mon, 21 Dec 2015 17:11:23 -0500 Received: from mail-bn1bon0134.outbound.protection.outlook.com ([157.56.111.134]:53856 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751367AbbLUWLW convert rfc822-to-8bit (ORCPT ); Mon, 21 Dec 2015 17:11:22 -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" Subject: RE: [PATCH 1/1] Drivers: hv: vmbus: Add vendor and device atttributes Thread-Topic: [PATCH 1/1] Drivers: hv: vmbus: Add vendor and device atttributes Thread-Index: AQHRORjAoMWZNzNiBkKc4GSCa8juK57V9wEAgAAMjlA= Date: Mon, 21 Dec 2015 22:11:19 +0000 Message-ID: References: <1450396289-17309-1-git-send-email-kys@microsoft.com> <20151221211438.GB8015@kroah.com> In-Reply-To: <20151221211438.GB8015@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:8c01:121d:c11c:853a:414c:c43a] x-microsoft-exchange-diagnostics: 1;BY2PR0301MB1653;5:rAZUp28DsFfI4JCNiET8d5QTc/egRhu/9rr4+wKbT2x7UZj9V9Shj7ec8vDUTDNE1pIbiNKK/hU92Edhs4q+uHA3T8PgPPKLlUEKuqhVjWQOgFBAbvXxRrBc0xiGLt9ZzYDgUKdM/Wn0mGr1B6yFlw==;24:bbmg3Dk+2qQu120Ib0E0AUWGL6HmfW7LKWKpSvldhEk7kdgDblm0+7PUQ4L9WRO1b7K3vIQIZY3aspKjg4S8mw5oEFbMOoGN1QjjZ+MhGYE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1653; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001)(61426038)(61427038);SRVR:BY2PR0301MB1653;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1653; x-forefront-prvs: 079756C6B9 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(50944005)(199003)(377454003)(13464003)(189002)(24454002)(54356999)(40100003)(11100500001)(33656002)(76176999)(50986999)(10400500002)(10290500002)(8990500004)(106116001)(5005710100001)(97736004)(5001960100002)(5003600100002)(81156007)(5002640100001)(106356001)(110136002)(77096005)(6116002)(10090500001)(92566002)(1096002)(586003)(102836003)(105586002)(86362001)(87936001)(1220700001)(76576001)(122556002)(101416001)(2900100001)(2950100001)(5008740100001)(189998001)(74316001)(5004730100002)(19580405001)(19580395003)(86612001)(99286002)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB1653;H:BY2PR0301MB1654.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2015 22:11:19.9046 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1653 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Monday, December 21, 2015 1:15 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 > Subject: Re: [PATCH 1/1] Drivers: hv: vmbus: Add vendor and device > atttributes > > On Thu, Dec 17, 2015 at 03:51:29PM -0800, K. Y. Srinivasan wrote: > > Add vendor and device attributes to VMBUS devices. These will be used > > by Hyper-V tools as well user-level RDMA libraries that will use the > > vendor/device tuple to discover the RDMA device. > > > > Signed-off-by: K. Y. Srinivasan > > --- > > Documentation/ABI/stable/sysfs-bus-vmbus | 14 ++++++++++++++ > > drivers/hv/vmbus_drv.c | 21 +++++++++++++++++++++ > > include/linux/hyperv.h | 2 ++ > > 3 files changed, 37 insertions(+), 0 deletions(-) > > > > diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus > b/Documentation/ABI/stable/sysfs-bus-vmbus > > index 636e938..5d0125f 100644 > > --- a/Documentation/ABI/stable/sysfs-bus-vmbus > > +++ b/Documentation/ABI/stable/sysfs-bus-vmbus > > @@ -27,3 +27,17 @@ Description: The mapping of which primary/sub > channels are bound to which > > Virtual Processors. > > Format: > > Users: tools/hv/lsvmbus > > + > > +What: /sys/bus/vmbus/devices/vmbus_*/device > > Shouldn't that be 'device_id' as 'device' is a symlink in the sysfs > tree? We currently have device_id as one of the attributes - this is the instance GUID. We want to add the 16 bit device attribute to VMBUS devices. > > > +Date: Dec. 2015 > > +KernelVersion: 4.5 > > +Contact: K. Y. Srinivasan > > +Description: The 16 bit device ID of the device > > +Users: tools/hv/lsvmbus and user level RDMA libraries > > + > > +What: /sys/bus/vmbus/devices/vmbus_*/vendor > > 'vendor_id'? We want to have the device and vendor attributes like the PCI devices have. > > > > +Date: Dec. 2015 > > +KernelVersion: 4.5 > > +Contact: K. Y. Srinivasan > > +Description: The 16 bit vendor ID of the device > > +Users: tools/hv/lsvmbus and user level RDMA libraries > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > > index 328e4c3..3668a95 100644 > > --- a/drivers/hv/vmbus_drv.c > > +++ b/drivers/hv/vmbus_drv.c > > @@ -477,6 +477,24 @@ static ssize_t channel_vp_mapping_show(struct > device *dev, > > } > > static DEVICE_ATTR_RO(channel_vp_mapping); > > > > +static ssize_t vendor_show(struct device *dev, > > + struct device_attribute *dev_attr, > > + char *buf) > > +{ > > + struct hv_device *hv_dev = device_to_hv_device(dev); > > + return sprintf(buf, "0x%x\n", hv_dev->vendor_id); > > +} > > +static DEVICE_ATTR_RO(vendor); > > + > > +static ssize_t device_show(struct device *dev, > > + struct device_attribute *dev_attr, > > + char *buf) > > +{ > > + struct hv_device *hv_dev = device_to_hv_device(dev); > > + return sprintf(buf, "0x%x\n", hv_dev->device_id); > > +} > > +static DEVICE_ATTR_RO(device); > > + > > /* Set up per device attributes in /sys/bus/vmbus/devices/ > */ > > static struct attribute *vmbus_attrs[] = { > > &dev_attr_id.attr, > > @@ -502,6 +520,8 @@ static struct attribute *vmbus_attrs[] = { > > &dev_attr_in_read_bytes_avail.attr, > > &dev_attr_in_write_bytes_avail.attr, > > &dev_attr_channel_vp_mapping.attr, > > + &dev_attr_vendor.attr, > > + &dev_attr_device.attr, > > NULL, > > }; > > ATTRIBUTE_GROUPS(vmbus); > > @@ -957,6 +977,7 @@ struct hv_device *vmbus_device_create(const > uuid_le *type, > > memcpy(&child_device_obj->dev_type, type, sizeof(uuid_le)); > > memcpy(&child_device_obj->dev_instance, instance, > > sizeof(uuid_le)); > > + child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */ > > So this is always the same value? The MSFT PCI Vendor ID is the default value. > > And device_id is never set? What does it default to? Why include it in > this patch if it's never used? I will add that and resubmit. Regards, K. Y