* Re: [PATCH] vhost-net: add module alias (v2)
2012-01-11 17:16 ` [PATCH] vhost-net: add module alias (v2) Stephen Hemminger
@ 2012-01-11 18:09 ` Michael S. Tsirkin
2012-01-11 21:00 ` Ben Hutchings
` (3 subsequent siblings)
4 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2012-01-11 18:09 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Alan Cox, Kay Sievers, kvm, virtualization
On Wed, Jan 11, 2012 at 09:16:53AM -0800, Stephen Hemminger wrote:
> By adding the correct module alias, programs won't have to explicitly
> call modprobe. Vhost-net will always be available if built into the kernel.
> It does require assigning a permanent minor number for depmod to work.
> Choose one next to TUN since this driver is related to it.
>
> Also, use C99 style initialization.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
I don't mind but this needs an Ack from Alan Cox
who made it dynamic in the first place,
see 79907d89c397b8bc2e05b347ec94e928ea919d33.
> ---
> v2 - document minor number and make sure to not overlap
>
> Documentation/devices.txt | 2 ++
> drivers/vhost/net.c | 8 +++++---
> include/linux/miscdevice.h | 1 +
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> --- a/drivers/vhost/net.c 2012-01-10 10:56:58.883179194 -0800
> +++ b/drivers/vhost/net.c 2012-01-10 19:48:23.650225892 -0800
> @@ -856,9 +856,9 @@ static const struct file_operations vhos
> };
>
> static struct miscdevice vhost_net_misc = {
> - MISC_DYNAMIC_MINOR,
> - "vhost-net",
> - &vhost_net_fops,
> + .minor = VHOST_NET_MINOR,
> + .name = "vhost-net",
> + .fops = &vhost_net_fops,
> };
>
> static int vhost_net_init(void)
> @@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
> MODULE_LICENSE("GPL v2");
> MODULE_AUTHOR("Michael S. Tsirkin");
> MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
> +MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
> +MODULE_ALIAS("devname:vhost-net");
> --- a/include/linux/miscdevice.h 2012-01-10 10:56:59.779189436 -0800
> +++ b/include/linux/miscdevice.h 2012-01-11 09:13:20.803694316 -0800
> @@ -42,6 +42,7 @@
> #define AUTOFS_MINOR 235
> #define MAPPER_CTRL_MINOR 236
> #define LOOP_CTRL_MINOR 237
> +#define VHOST_NET_MINOR 238
> #define MISC_DYNAMIC_MINOR 255
>
> struct device;
> --- a/Documentation/devices.txt 2012-01-10 10:56:53.399116518 -0800
> +++ b/Documentation/devices.txt 2012-01-11 09:12:49.251197653 -0800
> @@ -447,6 +447,8 @@ Your cooperation is appreciated.
> 234 = /dev/btrfs-control Btrfs control device
> 235 = /dev/autofs Autofs control device
> 236 = /dev/mapper/control Device-Mapper control device
> + 237 = /dev/vhost-net Host kernel accelerator for virtio net
> +
> 240-254 Reserved for local use
> 255 Reserved for MISC_DYNAMIC_MINOR
>
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2)
2012-01-11 17:16 ` [PATCH] vhost-net: add module alias (v2) Stephen Hemminger
2012-01-11 18:09 ` Michael S. Tsirkin
@ 2012-01-11 21:00 ` Ben Hutchings
2012-01-12 2:15 ` Zhi Yong Wu
` (2 subsequent siblings)
4 siblings, 0 replies; 23+ messages in thread
From: Ben Hutchings @ 2012-01-11 21:00 UTC (permalink / raw)
To: Stephen Hemminger
Cc: kvm, Michael S. Tsirkin, netdev, Kay Sievers, virtualization,
Alan Cox
On Wed, 2012-01-11 at 09:16 -0800, Stephen Hemminger wrote:
> By adding the correct module alias, programs won't have to explicitly
> call modprobe. Vhost-net will always be available if built into the kernel.
> It does require assigning a permanent minor number for depmod to work.
> Choose one next to TUN since this driver is related to it.
>
> Also, use C99 style initialization.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> v2 - document minor number and make sure to not overlap
[...]
> --- a/include/linux/miscdevice.h 2012-01-10 10:56:59.779189436 -0800
> +++ b/include/linux/miscdevice.h 2012-01-11 09:13:20.803694316 -0800
> @@ -42,6 +42,7 @@
> #define AUTOFS_MINOR 235
> #define MAPPER_CTRL_MINOR 236
> #define LOOP_CTRL_MINOR 237
> +#define VHOST_NET_MINOR 238
> #define MISC_DYNAMIC_MINOR 255
>
> struct device;
> --- a/Documentation/devices.txt 2012-01-10 10:56:53.399116518 -0800
> +++ b/Documentation/devices.txt 2012-01-11 09:12:49.251197653 -0800
> @@ -447,6 +447,8 @@ Your cooperation is appreciated.
> 234 = /dev/btrfs-control Btrfs control device
> 235 = /dev/autofs Autofs control device
> 236 = /dev/mapper/control Device-Mapper control device
> + 237 = /dev/vhost-net Host kernel accelerator for virtio net
[...]
238 != 237. It looks like someone forgot to add loopctrl here.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2)
2012-01-11 17:16 ` [PATCH] vhost-net: add module alias (v2) Stephen Hemminger
2012-01-11 18:09 ` Michael S. Tsirkin
2012-01-11 21:00 ` Ben Hutchings
@ 2012-01-12 2:15 ` Zhi Yong Wu
[not found] ` <CAEH94LiF_F51_avA9UWMneo1N1wY0NzJmfohpxdrkAv2WkWT5Q@mail.gmail.com>
2012-01-12 20:04 ` [PATCH] vhost-net: add module alias (v2) Thadeu Lima de Souza Cascardo
4 siblings, 0 replies; 23+ messages in thread
From: Zhi Yong Wu @ 2012-01-12 2:15 UTC (permalink / raw)
To: Stephen Hemminger
Cc: kvm, Michael S. Tsirkin, netdev, Kay Sievers, virtualization,
Alan Cox
On Thu, Jan 12, 2012 at 1:16 AM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> By adding the correct module alias, programs won't have to explicitly
> call modprobe. Vhost-net will always be available if built into the kernel.
> It does require assigning a permanent minor number for depmod to work.
> Choose one next to TUN since this driver is related to it.
>
> Also, use C99 style initialization.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> v2 - document minor number and make sure to not overlap
>
> Documentation/devices.txt | 2 ++
> drivers/vhost/net.c | 8 +++++---
> include/linux/miscdevice.h | 1 +
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> --- a/drivers/vhost/net.c 2012-01-10 10:56:58.883179194 -0800
> +++ b/drivers/vhost/net.c 2012-01-10 19:48:23.650225892 -0800
> @@ -856,9 +856,9 @@ static const struct file_operations vhos
> };
>
> static struct miscdevice vhost_net_misc = {
> - MISC_DYNAMIC_MINOR,
> - "vhost-net",
> - &vhost_net_fops,
> + .minor = VHOST_NET_MINOR,
> + .name = "vhost-net",
> + .fops = &vhost_net_fops,
> };
>
> static int vhost_net_init(void)
> @@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
> MODULE_LICENSE("GPL v2");
> MODULE_AUTHOR("Michael S. Tsirkin");
> MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
> +MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
> +MODULE_ALIAS("devname:vhost-net");
> --- a/include/linux/miscdevice.h 2012-01-10 10:56:59.779189436 -0800
> +++ b/include/linux/miscdevice.h 2012-01-11 09:13:20.803694316 -0800
> @@ -42,6 +42,7 @@
> #define AUTOFS_MINOR 235
> #define MAPPER_CTRL_MINOR 236
> #define LOOP_CTRL_MINOR 237
> +#define VHOST_NET_MINOR 238
> #define MISC_DYNAMIC_MINOR 255
>
> struct device;
> --- a/Documentation/devices.txt 2012-01-10 10:56:53.399116518 -0800
> +++ b/Documentation/devices.txt 2012-01-11 09:12:49.251197653 -0800
> @@ -447,6 +447,8 @@ Your cooperation is appreciated.
> 234 = /dev/btrfs-control Btrfs control device
> 235 = /dev/autofs Autofs control device
> 236 = /dev/mapper/control Device-Mapper control device
> + 237 = /dev/vhost-net Host kernel accelerator for virtio net
> +
238? The stuff for LOOP_CTRL seems to be missing?
> 240-254 Reserved for local use
> 255 Reserved for MISC_DYNAMIC_MINOR
>
>
>
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
--
Regards,
Zhi Yong Wu
^ permalink raw reply [flat|nested] 23+ messages in thread
[parent not found: <CAEH94LiF_F51_avA9UWMneo1N1wY0NzJmfohpxdrkAv2WkWT5Q@mail.gmail.com>]
* [PATCH] vhost-net: add module alias (v2.1)
[not found] ` <CAEH94LiF_F51_avA9UWMneo1N1wY0NzJmfohpxdrkAv2WkWT5Q@mail.gmail.com>
@ 2012-01-12 5:30 ` Stephen Hemminger
2012-01-13 4:07 ` David Miller
0 siblings, 1 reply; 23+ messages in thread
From: Stephen Hemminger @ 2012-01-12 5:30 UTC (permalink / raw)
To: Zhi Yong Wu
Cc: kvm, Michael S. Tsirkin, netdev, Kay Sievers, virtualization,
Alan Cox
Subject: vhost-net: add module alias (v2.1)
By adding some module aliases, programs (or users) won't have to explicitly
call modprobe. Vhost-net will always be available if built into the kernel.
It does require assigning a permanent minor number for depmod to work.
Also:
- use C99 style initialization.
- add missing entry in documentation for loop-control
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
2.1 - add missing documentation for loop control as well
Documentation/devices.txt | 3 +++
drivers/vhost/net.c | 8 +++++---
include/linux/miscdevice.h | 1 +
3 files changed, 9 insertions(+), 3 deletions(-)
--- a/drivers/vhost/net.c 2012-01-10 10:56:58.883179194 -0800
+++ b/drivers/vhost/net.c 2012-01-10 19:48:23.650225892 -0800
@@ -856,9 +856,9 @@ static const struct file_operations vhos
};
static struct miscdevice vhost_net_misc = {
- MISC_DYNAMIC_MINOR,
- "vhost-net",
- &vhost_net_fops,
+ .minor = VHOST_NET_MINOR,
+ .name = "vhost-net",
+ .fops = &vhost_net_fops,
};
static int vhost_net_init(void)
@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael S. Tsirkin");
MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
+MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
+MODULE_ALIAS("devname:vhost-net");
--- a/include/linux/miscdevice.h 2012-01-10 10:56:59.779189436 -0800
+++ b/include/linux/miscdevice.h 2012-01-11 09:13:20.803694316 -0800
@@ -42,6 +42,7 @@
#define AUTOFS_MINOR 235
#define MAPPER_CTRL_MINOR 236
#define LOOP_CTRL_MINOR 237
+#define VHOST_NET_MINOR 238
#define MISC_DYNAMIC_MINOR 255
struct device;
--- a/Documentation/devices.txt 2012-01-10 10:56:53.399116518 -0800
+++ b/Documentation/devices.txt 2012-01-11 13:17:07.882113340 -0800
@@ -447,6 +447,9 @@ Your cooperation is appreciated.
234 = /dev/btrfs-control Btrfs control device
235 = /dev/autofs Autofs control device
236 = /dev/mapper/control Device-Mapper control device
+ 237 = /dev/loop-control Loopback control device
+ 238 = /dev/vhost-net Host kernel accelerator for virtio net
+
240-254 Reserved for local use
255 Reserved for MISC_DYNAMIC_MINOR
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-12 5:30 ` [PATCH] vhost-net: add module alias (v2.1) Stephen Hemminger
@ 2012-01-13 4:07 ` David Miller
2012-01-13 4:19 ` Kay Sievers
` (2 more replies)
0 siblings, 3 replies; 23+ messages in thread
From: David Miller @ 2012-01-13 4:07 UTC (permalink / raw)
To: shemminger; +Cc: kvm, mst, netdev, kay.sievers, virtualization, device
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 11 Jan 2012 21:30:38 -0800
> Subject: vhost-net: add module alias (v2.1)
>
> By adding some module aliases, programs (or users) won't have to explicitly
> call modprobe. Vhost-net will always be available if built into the kernel.
> It does require assigning a permanent minor number for depmod to work.
>
> Also:
> - use C99 style initialization.
> - add missing entry in documentation for loop-control
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
ACKs, NACKs? What is happening here?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-13 4:07 ` David Miller
@ 2012-01-13 4:19 ` Kay Sievers
2012-01-13 18:12 ` David Miller
2012-01-15 12:42 ` Michael S. Tsirkin
[not found] ` <20120115124236.GA31012@redhat.com>
2 siblings, 1 reply; 23+ messages in thread
From: Kay Sievers @ 2012-01-13 4:19 UTC (permalink / raw)
To: David Miller; +Cc: kvm, mst, netdev, virtualization, shemminger, device
On Fri, Jan 13, 2012 at 05:07, David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Wed, 11 Jan 2012 21:30:38 -0800
>
>> Subject: vhost-net: add module alias (v2.1)
>>
>> By adding some module aliases, programs (or users) won't have to explicitly
>> call modprobe. Vhost-net will always be available if built into the kernel.
>> It does require assigning a permanent minor number for depmod to work.
>>
>> Also:
>> - use C99 style initialization.
>> - add missing entry in documentation for loop-control
>>
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ACKs, NACKs? What is happening here?
In general, static minors are acceptable and very useful to make
on-demand loading of kernel modules working. They should be used only
for single-instance devices though, which usually means: One single
static device name associated with a module.
That looks all fine here, and for what it's worth:
Acked-By: Kay Sievers <kay.sievers@vrfy.org>
Kay
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-13 4:19 ` Kay Sievers
@ 2012-01-13 18:12 ` David Miller
0 siblings, 0 replies; 23+ messages in thread
From: David Miller @ 2012-01-13 18:12 UTC (permalink / raw)
To: kay.sievers; +Cc: kvm, mst, netdev, virtualization, shemminger, device
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Fri, 13 Jan 2012 05:19:05 +0100
> On Fri, Jan 13, 2012 at 05:07, David Miller <davem@davemloft.net> wrote:
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Wed, 11 Jan 2012 21:30:38 -0800
>>
>>> Subject: vhost-net: add module alias (v2.1)
>>>
>>> By adding some module aliases, programs (or users) won't have to explicitly
>>> call modprobe. Vhost-net will always be available if built into the kernel.
>>> It does require assigning a permanent minor number for depmod to work.
>>>
>>> Also:
>>> - use C99 style initialization.
>>> - add missing entry in documentation for loop-control
>>>
>>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>
>> ACKs, NACKs? What is happening here?
>
> In general, static minors are acceptable and very useful to make
> on-demand loading of kernel modules working. They should be used only
> for single-instance devices though, which usually means: One single
> static device name associated with a module.
>
> That looks all fine here, and for what it's worth:
> Acked-By: Kay Sievers <kay.sievers@vrfy.org>
Ok, applied, thanks everyone.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-13 4:07 ` David Miller
2012-01-13 4:19 ` Kay Sievers
@ 2012-01-15 12:42 ` Michael S. Tsirkin
[not found] ` <20120115124236.GA31012@redhat.com>
2 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2012-01-15 12:42 UTC (permalink / raw)
To: David Miller
Cc: kvm, netdev, kay.sievers, virtualization, shemminger, device,
Alan Cox
On Thu, Jan 12, 2012 at 08:07:01PM -0800, David Miller wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Wed, 11 Jan 2012 21:30:38 -0800
>
> > Subject: vhost-net: add module alias (v2.1)
> >
> > By adding some module aliases, programs (or users) won't have to explicitly
> > call modprobe. Vhost-net will always be available if built into the kernel.
> > It does require assigning a permanent minor number for depmod to work.
> >
> > Also:
> > - use C99 style initialization.
> > - add missing entry in documentation for loop-control
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ACKs, NACKs? What is happening here?
I would like an Ack from Alan Cox who switched vhost-net
to a dynamic minor in the first place, in commit
79907d89c397b8bc2e05b347ec94e928ea919d33.
--
MST
^ permalink raw reply [flat|nested] 23+ messages in thread
[parent not found: <20120115124236.GA31012@redhat.com>]
* Re: [PATCH] vhost-net: add module alias (v2.1)
[not found] ` <20120115124236.GA31012@redhat.com>
@ 2012-01-16 12:26 ` Alan Cox
2012-01-16 15:52 ` Stephen Hemminger
0 siblings, 1 reply; 23+ messages in thread
From: Alan Cox @ 2012-01-16 12:26 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: kvm, netdev, kay.sievers, David Miller, shemminger,
virtualization, device
> > ACKs, NACKs? What is happening here?
>
> I would like an Ack from Alan Cox who switched vhost-net
> to a dynamic minor in the first place, in commit
> 79907d89c397b8bc2e05b347ec94e928ea919d33.
Sorry device@lanana.org isn't yet back from the kernel hack incident.
I don't read netdev so someone needs to summarise the issue and send me
a copy of the patch to look at.
Alan
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-16 12:26 ` Alan Cox
@ 2012-01-16 15:52 ` Stephen Hemminger
2012-01-16 23:06 ` David Miller
2012-01-16 23:34 ` Alan Cox
0 siblings, 2 replies; 23+ messages in thread
From: Stephen Hemminger @ 2012-01-16 15:52 UTC (permalink / raw)
To: Alan Cox
Cc: kvm, Michael S. Tsirkin, netdev, kay.sievers, virtualization,
device, David Miller
On Mon, 16 Jan 2012 12:26:45 +0000
Alan Cox <alan@linux.intel.com> wrote:
> > > ACKs, NACKs? What is happening here?
> >
> > I would like an Ack from Alan Cox who switched vhost-net
> > to a dynamic minor in the first place, in commit
> > 79907d89c397b8bc2e05b347ec94e928ea919d33.
>
> Sorry device@lanana.org isn't yet back from the kernel hack incident.
>
> I don't read netdev so someone needs to summarise the issue and send me
> a copy of the patch to look at.
>
> Alan
Subject: vhost-net: add module alias (v2.1)
By adding some module aliases, programs (or users) won't have to explicitly
call modprobe. Vhost-net will always be available if built into the kernel.
It does require assigning a permanent minor number for depmod to work.
Also:
- use C99 style initialization.
- add missing entry in documentation for loop-control
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
2.1 - add missing documentation for loop control as well
Documentation/devices.txt | 3 +++
drivers/vhost/net.c | 8 +++++---
include/linux/miscdevice.h | 1 +
3 files changed, 9 insertions(+), 3 deletions(-)
--- a/drivers/vhost/net.c 2012-01-12 14:14:25.681815487 -0800
+++ b/drivers/vhost/net.c 2012-01-12 18:09:56.810680816 -0800
@@ -856,9 +856,9 @@ static const struct file_operations vhos
};
static struct miscdevice vhost_net_misc = {
- MISC_DYNAMIC_MINOR,
- "vhost-net",
- &vhost_net_fops,
+ .minor = VHOST_NET_MINOR,
+ .name = "vhost-net",
+ .fops = &vhost_net_fops,
};
static int vhost_net_init(void)
@@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Michael S. Tsirkin");
MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
+MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
+MODULE_ALIAS("devname:vhost-net");
--- a/include/linux/miscdevice.h 2012-01-12 14:14:25.725815981 -0800
+++ b/include/linux/miscdevice.h 2012-01-12 18:09:56.810680816 -0800
@@ -42,6 +42,7 @@
#define AUTOFS_MINOR 235
#define MAPPER_CTRL_MINOR 236
#define LOOP_CTRL_MINOR 237
+#define VHOST_NET_MINOR 238
#define MISC_DYNAMIC_MINOR 255
struct device;
--- a/Documentation/devices.txt 2012-01-12 14:14:25.701815712 -0800
+++ b/Documentation/devices.txt 2012-01-12 18:09:56.814680860 -0800
@@ -447,6 +447,9 @@ Your cooperation is appreciated.
234 = /dev/btrfs-control Btrfs control device
235 = /dev/autofs Autofs control device
236 = /dev/mapper/control Device-Mapper control device
+ 237 = /dev/loop-control Loopback control device
+ 238 = /dev/vhost-net Host kernel accelerator for virtio net
+
240-254 Reserved for local use
255 Reserved for MISC_DYNAMIC_MINOR
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-16 15:52 ` Stephen Hemminger
@ 2012-01-16 23:06 ` David Miller
2012-01-16 23:34 ` Alan Cox
1 sibling, 0 replies; 23+ messages in thread
From: David Miller @ 2012-01-16 23:06 UTC (permalink / raw)
To: shemminger; +Cc: kvm, mst, netdev, kay.sievers, virtualization, device, alan
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 16 Jan 2012 07:52:36 -0800
> On Mon, 16 Jan 2012 12:26:45 +0000
> Alan Cox <alan@linux.intel.com> wrote:
>
>> > > ACKs, NACKs? What is happening here?
>> >
>> > I would like an Ack from Alan Cox who switched vhost-net
>> > to a dynamic minor in the first place, in commit
>> > 79907d89c397b8bc2e05b347ec94e928ea919d33.
>>
>> Sorry device@lanana.org isn't yet back from the kernel hack incident.
>>
>> I don't read netdev so someone needs to summarise the issue and send me
>> a copy of the patch to look at.
>>
>> Alan
>
> Subject: vhost-net: add module alias (v2.1)
>
> By adding some module aliases, programs (or users) won't have to explicitly
> call modprobe. Vhost-net will always be available if built into the kernel.
> It does require assigning a permanent minor number for depmod to work.
>
> Also:
> - use C99 style initialization.
> - add missing entry in documentation for loop-control
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
I already applied your first patch, so you need to give me something
relative to apply on top of your original one.
And it also shows that you're really not generating these patches
against current 'net', otherwise you'd have noticed your other patch
already there.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2.1)
2012-01-16 15:52 ` Stephen Hemminger
2012-01-16 23:06 ` David Miller
@ 2012-01-16 23:34 ` Alan Cox
1 sibling, 0 replies; 23+ messages in thread
From: Alan Cox @ 2012-01-16 23:34 UTC (permalink / raw)
To: Stephen Hemminger
Cc: kvm, Michael S. Tsirkin, netdev, kay.sievers, virtualization,
device, David Miller
> Also:
> - use C99 style initialization.
> - add missing entry in documentation for loop-control
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
For the device allocation
Acked-by: Alan Cox <devices@lanana.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] vhost-net: add module alias (v2)
2012-01-11 17:16 ` [PATCH] vhost-net: add module alias (v2) Stephen Hemminger
` (3 preceding siblings ...)
[not found] ` <CAEH94LiF_F51_avA9UWMneo1N1wY0NzJmfohpxdrkAv2WkWT5Q@mail.gmail.com>
@ 2012-01-12 20:04 ` Thadeu Lima de Souza Cascardo
4 siblings, 0 replies; 23+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2012-01-12 20:04 UTC (permalink / raw)
To: Stephen Hemminger
Cc: kvm, Michael S. Tsirkin, netdev, Kay Sievers, virtualization,
Alan Cox
On Wed, Jan 11, 2012 at 09:16:53AM -0800, Stephen Hemminger wrote:
> By adding the correct module alias, programs won't have to explicitly
> call modprobe. Vhost-net will always be available if built into the kernel.
> It does require assigning a permanent minor number for depmod to work.
> Choose one next to TUN since this driver is related to it.
>
> Also, use C99 style initialization.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> ---
> v2 - document minor number and make sure to not overlap
>
> Documentation/devices.txt | 2 ++
> drivers/vhost/net.c | 8 +++++---
> include/linux/miscdevice.h | 1 +
> 3 files changed, 8 insertions(+), 3 deletions(-)
>
> --- a/drivers/vhost/net.c 2012-01-10 10:56:58.883179194 -0800
> +++ b/drivers/vhost/net.c 2012-01-10 19:48:23.650225892 -0800
> @@ -856,9 +856,9 @@ static const struct file_operations vhos
> };
>
> static struct miscdevice vhost_net_misc = {
> - MISC_DYNAMIC_MINOR,
> - "vhost-net",
> - &vhost_net_fops,
> + .minor = VHOST_NET_MINOR,
> + .name = "vhost-net",
> + .fops = &vhost_net_fops,
> };
>
> static int vhost_net_init(void)
> @@ -879,3 +879,5 @@ MODULE_VERSION("0.0.1");
> MODULE_LICENSE("GPL v2");
> MODULE_AUTHOR("Michael S. Tsirkin");
> MODULE_DESCRIPTION("Host kernel accelerator for virtio net");
> +MODULE_ALIAS_MISCDEV(VHOST_NET_MINOR);
> +MODULE_ALIAS("devname:vhost-net");
> --- a/include/linux/miscdevice.h 2012-01-10 10:56:59.779189436 -0800
> +++ b/include/linux/miscdevice.h 2012-01-11 09:13:20.803694316 -0800
> @@ -42,6 +42,7 @@
> #define AUTOFS_MINOR 235
> #define MAPPER_CTRL_MINOR 236
> #define LOOP_CTRL_MINOR 237
> +#define VHOST_NET_MINOR 238
> #define MISC_DYNAMIC_MINOR 255
>
> struct device;
> --- a/Documentation/devices.txt 2012-01-10 10:56:53.399116518 -0800
> +++ b/Documentation/devices.txt 2012-01-11 09:12:49.251197653 -0800
> @@ -447,6 +447,8 @@ Your cooperation is appreciated.
> 234 = /dev/btrfs-control Btrfs control device
> 235 = /dev/autofs Autofs control device
> 236 = /dev/mapper/control Device-Mapper control device
> + 237 = /dev/vhost-net Host kernel accelerator for virtio net
> +
> 240-254 Reserved for local use
> 255 Reserved for MISC_DYNAMIC_MINOR
>
>
You added vhost-net minor as 238 in the code and 237 in the
documentation. That's because loop-control is missing from the docs.
Regards.
Cascardo.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 23+ messages in thread