Skip to contentSkip to conversation

net/hyperv: Advertise hv_netvsc instead of netvsc as driver name

PATCH In review Haiyang Zhang 3 participants 11 messages Mar 7, 2012 – Mar 8, 2012

Subsystems (3)
lore
Share & tools
lore

Haiyang Zhang

author maintainer
#0 lore raw

PATCH 1/1 net/hyperv: Advertise hv_netvsc instead of netvsc as driver name

From: Olaf Hering <[email protected]>

---
 drivers/net/hyperv/netvsc_drv.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/hyperv/netvsc_drv.c +4 -2
index 0ae7a1a..53d1ee5 100644
@@ -40,6 +40,8 @@
 
 #include "hyperv_net.h"
 
+#define MODULE_NAME "hv_netvsc"
+
 struct net_device_context {
 	/* point back to our device context */
 	struct hv_device *device_ctx;
@@ -310,7 +312,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
 static void netvsc_get_drvinfo(struct net_device *net,
 			       struct ethtool_drvinfo *info)
 {
-	strcpy(info->driver, "hv_netvsc");
+	strcpy(info->driver, MODULE_NAME);
 	strcpy(info->version, HV_DRV_VERSION);
 	strcpy(info->fw_version, "N/A");
 }
@@ -482,7 +484,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
 
 /* The one and only one */
 static struct  hv_driver netvsc_drv = {
-	.name = "netvsc",
+	.name = MODULE_NAME,
 	.id_table = id_table,
 	.probe = netvsc_probe,
 	.remove = netvsc_remove,
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 14 lines · Haiyang Zhang

From: Olaf Hering <[email protected]>

---
 drivers/net/hyperv/netvsc_drv.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/hyperv/netvsc_drv.c +0 -0
index 0ae7a1a..53d1ee5 100644

drivers/net/hyperv/netvsc_drv.c line 43

Quoted 4 lines
drivers/net/hyperv/netvsc_drv.c +1 -0
@@ -40,6 +40,8 @@
 
 #include "hyperv_net.h"
 
+#define MODULE_NAME "hv_netvsc"

No, please use the built-in macro for this and don't define your own, that's totally redundant.

greg k-h

author maintainer
#2 lore raw
Quoted 28 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, March 07, 2012 2:22 PM
To: Haiyang Zhang
Cc: KY Srinivasan; [email protected]; [email protected]; linux- [email protected]; [email protected]; Olaf Hering
Subject: Re: [PATCH] net/hyperv: Advertise hv_netvsc instead of netvsc as driver name

Review

Quoted 10 lines · Haiyang Zhang

From: Olaf Hering <[email protected]>

---
 drivers/net/hyperv/netvsc_drv.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/hyperv/netvsc_drv.c

Quoted 5 lines

index 0ae7a1a..53d1ee5 100644

drivers/net/hyperv/netvsc_drv.c +0 -0
@@ -40,6 +40,8 @@
 
Quoted 6 lines

drivers/net/hyperv/netvsc_drv.c line 43

Quoted 3 lines
drivers/net/hyperv/netvsc_drv.c +1 -0
 #include "hyperv_net.h"
 
+#define MODULE_NAME "hv_netvsc"

No, please use the built-in macro for this and don't define your own, that's totally redundant.

I have submitted a patch using the built-in KBUILD_MODNAME. Thanks,
- Haiyang

#3 lore raw
In reply to Haiyang Zhang

drivers/net/hyperv/netvsc_drv.c MODULE_DEVICE_TABLE(vmbus, id_table); · line 487

Quoted 6 lines · Haiyang Zhang
drivers/net/hyperv/netvsc_drv.c +1 -1
@@ -482,7 +484,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
 
 /* The one and only one */
 static struct  hv_driver netvsc_drv = {
-	.name = "netvsc",
+	.name = MODULE_NAME,

It would be nice if this could be applied to 3.3. hv_storvsc and hid-hyperv already use the same naming, this patch was send last year already but was not applied for some reason.

Olaf

#4 lore raw
Quoted 5 lines · Olaf Hering
Quoted 2 lines · Haiyang Zhang
(quoted diff) +0 -0
@@ -482,7 +484,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
 
Quoted 8 lines

drivers/net/hyperv/netvsc_drv.c MODULE_DEVICE_TABLE(vmbus, id_table); · line 487

Quoted 4 lines
drivers/net/hyperv/netvsc_drv.c +1 -1
 /* The one and only one */
 static struct  hv_driver netvsc_drv = {
-	.name = "netvsc",
+	.name = MODULE_NAME,

It would be nice if this could be applied to 3.3. hv_storvsc and hid-hyperv already use the same naming, this patch was send last year already but was not applied for some reason.

What userspace tools depend on this that requires it to be in 3.3?

greg k-h

#5 lore raw
Quoted 15 lines · Greg KH
Quoted 5 lines · Olaf Hering
Quoted 2 lines · Haiyang Zhang
(quoted diff) +0 -0
@@ -482,7 +484,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
 
Quoted 8 lines

drivers/net/hyperv/netvsc_drv.c MODULE_DEVICE_TABLE(vmbus, id_table); · line 487

Quoted 4 lines
drivers/net/hyperv/netvsc_drv.c +1 -1
 /* The one and only one */
 static struct  hv_driver netvsc_drv = {
-	.name = "netvsc",
+	.name = MODULE_NAME,

It would be nice if this could be applied to 3.3. hv_storvsc and hid-hyperv already use the same naming, this patch was send last year already but was not applied for some reason.

Quoted 1 line

What userspace tools depend on this that requires it to be in 3.3?

It represents the module names, at least for pci and other bus types. hwinfo uses it to recognize a network interface (storage in case of hv_storvsc).

Olaf

#6 lore raw
Quoted 17 lines · Olaf Hering
Quoted 15 lines · Greg KH
Quoted 13 lines · Olaf Hering

drivers/net/hyperv/netvsc_drv.c MODULE_DEVICE_TABLE(vmbus, id_table); · line 487

Quoted 6 lines · Haiyang Zhang
drivers/net/hyperv/netvsc_drv.c +1 -1
@@ -482,7 +484,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
 
 /* The one and only one */
 static struct  hv_driver netvsc_drv = {
-	.name = "netvsc",
+	.name = MODULE_NAME,

It would be nice if this could be applied to 3.3. hv_storvsc and hid-hyperv already use the same naming, this patch was send last year already but was not applied for some reason.

Quoted 3 lines
Quoted 1 line

What userspace tools depend on this that requires it to be in 3.3?

It represents the module names, at least for pci and other bus types.

Yes, but no one should care what the name of the module is.

Quoted 2 lines

hwinfo uses it to recognize a network interface (storage in case of hv_storvsc).

That tool should report the real module name, not rely on the name to match based on the structure, if you really care about the real module name.

greg k-h

#7 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines

hwinfo uses it to recognize a network interface (storage in case of hv_storvsc).

That tool should report the real module name, not rely on the name to match based on the structure, if you really care about the real module name.

Its about the driver symlink, not the module name.

I think most, if not all, (relevant) drivers use some sort of KBUILD_MODNAME. Why should this driver be any different?

Olaf

#8 lore raw
Quoted 5 lines · Olaf Hering
Quoted 3 lines · Greg KH
Quoted 2 lines

hwinfo uses it to recognize a network interface (storage in case of hv_storvsc).

Quoted 8 lines
Quoted 3 lines

That tool should report the real module name, not rely on the name to match based on the structure, if you really care about the real module name.

Its about the driver symlink, not the module name.

I think most, if not all, (relevant) drivers use some sort of KBUILD_MODNAME. Why should this driver be any different?

It shouldn't, I'm not saying that at all. I'm only objecting to the insistance that this be something worthwhile for 3.3-final which should be out any day now.

greg k-h

#9 lore raw
Quoted 10 lines · Greg KH
Quoted 9 lines · Olaf Hering
Quoted 6 lines · Greg KH
Quoted 2 lines

hwinfo uses it to recognize a network interface (storage in case of hv_storvsc).

That tool should report the real module name, not rely on the name to match based on the structure, if you really care about the real module name.

Quoted 8 lines
Quoted 4 lines

Its about the driver symlink, not the module name.

I think most, if not all, (relevant) drivers use some sort of KBUILD_MODNAME. Why should this driver be any different?

It shouldn't, I'm not saying that at all. I'm only objecting to the insistance that this be something worthwhile for 3.3-final which should be out any day now.

Since its an API we could settle on the new string, which is already in distro use.

Olaf

#10 lore raw
Quoted 17 lines · Olaf Hering
Quoted 15 lines · Greg KH
Quoted 13 lines · Olaf Hering
Quoted 6 lines · Greg KH
Quoted 2 lines

hwinfo uses it to recognize a network interface (storage in case of hv_storvsc).

That tool should report the real module name, not rely on the name to match based on the structure, if you really care about the real module name.

Its about the driver symlink, not the module name.

I think most, if not all, (relevant) drivers use some sort of KBUILD_MODNAME. Why should this driver be any different?

Quoted 6 lines
Quoted 3 lines

It shouldn't, I'm not saying that at all. I'm only objecting to the insistance that this be something worthwhile for 3.3-final which should be out any day now.

Since its an API we could settle on the new string, which is already in distro use.

I don't really understand, but in the end, it's not up to me, it's up to the network maintainer when he wants to merge this to Linus. If it were up to me, I would wait for 3.4.

good luck,

greg k-h