From: Stephen Hemminger <hidden> Date: 2012-01-11 04:54:00
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Also, use C99 style initialization.
Signed-off-by: Stephen Hemminger <redacted>
---
drivers/vhost/net.c | 8 +++++---
include/linux/miscdevice.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
From: Michael Tokarev <hidden> Date: 2012-01-11 07:07:47
On 11.01.2012 08:54, Stephen Hemminger wrote:
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Why do you think a statically-allocated device number will do any good
at all? Static /dev is gone almost completely, at least on the systems
where whole virt stuff makes any sense, so you don't have pre-created
vhost-net device anymore, and hence this allocation makes no sense.
Just IMHO anyway.
Thanks,
/mjt
From: Amos Kong <hidden> Date: 2012-01-11 07:43:42
On Wed, Jan 11, 2012 at 12:54 PM, Stephen Hemminger
[off-list ref]wrote:
quoted hunk
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Also, use C99 style initialization.
Signed-off-by: Stephen Hemminger <redacted>
---
drivers/vhost/net.c | 8 +++++---
include/linux/miscdevice.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
CC: alan@linux.intel.com
CC: device@lanana.org
include/linux/miscdevice.h:
/*
* These allocations are managed by device@lanana.org. If you use an
* entry that is not in assigned your entry may well be moved and
* reassigned, or set dynamic if a fixed value is not justified.
*/
#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
From: Stephen Hemminger <hidden> Date: 2012-01-11 16:54:26
On Wed, 11 Jan 2012 15:43:42 +0800
Amos Kong [off-list ref] wrote:
On Wed, Jan 11, 2012 at 12:54 PM, Stephen Hemminger
[off-list ref]wrote:
quoted
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Also, use C99 style initialization.
Signed-off-by: Stephen Hemminger <redacted>
---
drivers/vhost/net.c | 8 +++++---
include/linux/miscdevice.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
:
/*
* These allocations are managed by device@lanana.org. If you use an
* entry that is not in assigned your entry may well be moved and
* reassigned, or set dynamic if a fixed value is not justified.
*/
Didn't that mailing address was ever used any more. Like many places
in kernel, the comment looked like a historical leftover.
From: Stephen Hemminger <hidden> Date: 2012-01-11 16:58:57
On Wed, 11 Jan 2012 11:07:47 +0400
Michael Tokarev [off-list ref] wrote:
On 11.01.2012 08:54, Stephen Hemminger wrote:
quoted
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Why do you think a statically-allocated device number will do any good
at all? Static /dev is gone almost completely, at least on the systems
where whole virt stuff makes any sense, so you don't have pre-created
vhost-net device anymore, and hence this allocation makes no sense.
Just IMHO anyway.
The statically allocated device number is required for the udev/module
autoloading to work. Probably the udev infrastructure needs a consistent
number to hang off of.
It looks like:
* driver adds MODULE_ALIAS() for devname and character device
* depmod scans modules and creates modules.devname (in /lib/modules)
* udev uses modules.devname to autoload the module
$ /sbin/modinfo vhost_net
filename: /lib/modules/3.2.0-net+/kernel/drivers/vhost/vhost_net.ko
alias: devname:vhost-net
alias: char-major-10-201
description: Host kernel accelerator for virtio net
...
See also: https://lkml.org/lkml/2010/5/21/134
From: Michael Tokarev <hidden> Date: 2012-01-11 17:02:44
On 11.01.2012 20:58, Stephen Hemminger wrote:
On Wed, 11 Jan 2012 11:07:47 +0400
Michael Tokarev [off-list ref] wrote:
quoted
On 11.01.2012 08:54, Stephen Hemminger wrote:
quoted
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Why do you think a statically-allocated device number will do any good
at all? Static /dev is gone almost completely, at least on the systems
where whole virt stuff makes any sense, so you don't have pre-created
vhost-net device anymore, and hence this allocation makes no sense.
Just IMHO anyway.
Aha. So udev pre-creates statically-allocated devnodes nowadays:
Udev will pick up the depmod created file on startup and create all the
static device nodes which the kernel modules specify, so that these modules
get automatically loaded when the device node is accessed...
This was the part I missed. Now it all looks logically.
Thanks,
/mjt
From: Kay Sievers <hidden> Date: 2012-01-11 17:03:53
On Wed, Jan 11, 2012 at 17:58, Stephen Hemminger [off-list ref] wrote:
On Wed, 11 Jan 2012 11:07:47 +0400
Michael Tokarev [off-list ref] wrote:
quoted
On 11.01.2012 08:54, Stephen Hemminger wrote:
quoted
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Why do you think a statically-allocated device number will do any good
at all?
It's totally fine to use them for single-instance devices. You are
right, enumerated devices must _never_ use any facility like that.
That would just be broken.
quoted
Static /dev is gone almost completely, at least on the systems
where whole virt stuff makes any sense, so you don't have pre-created
vhost-net device anymore, and hence this allocation makes no sense.
Just IMHO anyway.
It makes a lot of sense in this case. The kernel module files
advertise the dev_t, it's not stored anywhere else. UDev finds these
static numbers and does inplicit mkdev() for them.
The statically allocated device number is required for the udev/module
autoloading to work. Probably the udev infrastructure needs a consistent
number to hang off of.
It does that properly.
Just check:
$ cat /lib/modules/$(uname -r)/modules.devname
# Device nodes to trigger on-demand module loading.
fuse fuse c10:229
btrfs btrfs-control c10:234
ppp_generic ppp c108:0
tun net/tun c10:200
uinput uinput c10:223
...
Kay
From: Stephen Hemminger <hidden> Date: 2012-01-11 17:16:53
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 <redacted>
---
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(-)
@@ -447,6 +447,8 @@ Your cooperation is appreciated.234=/dev/btrfs-controlBtrfscontroldevice235=/dev/autofsAutofscontroldevice236=/dev/mapper/controlDevice-Mappercontroldevice+237=/dev/vhost-netHostkernelacceleratorforvirtionet+240-254Reservedforlocaluse255ReservedforMISC_DYNAMIC_MINOR
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2012-01-11 18:09:41
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 <redacted>
I don't mind but this needs an Ack from Alan Cox
who made it dynamic in the first place,
see 79907d89c397b8bc2e05b347ec94e928ea919d33.
quoted hunk
---
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(-)
@@ -447,6 +447,8 @@ Your cooperation is appreciated.234=/dev/btrfs-controlBtrfscontroldevice235=/dev/autofsAutofscontroldevice236=/dev/mapper/controlDevice-Mappercontroldevice+237=/dev/vhost-netHostkernelacceleratorforvirtionet+240-254Reservedforlocaluse255ReservedforMISC_DYNAMIC_MINOR
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2012-01-11 18:15:31
On Wed, Jan 11, 2012 at 08:54:26AM -0800, Stephen Hemminger wrote:
On Wed, 11 Jan 2012 15:43:42 +0800
Amos Kong [off-list ref] wrote:
quoted
On Wed, Jan 11, 2012 at 12:54 PM, Stephen Hemminger
[off-list ref]wrote:
quoted
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Also, use C99 style initialization.
Signed-off-by: Stephen Hemminger <redacted>
---
drivers/vhost/net.c | 8 +++++---
include/linux/miscdevice.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
:
quoted
/*
* These allocations are managed by device@lanana.org. If you use an
* entry that is not in assigned your entry may well be moved and
* reassigned, or set dynamic if a fixed value is not justified.
*/
Didn't that mailing address was ever used any more. Like many places
in kernel, the comment looked like a historical leftover.
This was only added in 2010, see
79907d89c397b8bc2e05b347ec94e928ea919d33.
That said at least lanana.org web site seems to be down.
Alan, any idea?
--
MST
From: Ben Hutchings <hidden> Date: 2012-01-11 21:00:17
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 <redacted>
---
v2 - document minor number and make sure to not overlap
@@ -447,6 +447,8 @@ Your cooperation is appreciated.234=/dev/btrfs-controlBtrfscontroldevice235=/dev/autofsAutofscontroldevice236=/dev/mapper/controlDevice-Mappercontroldevice+237=/dev/vhost-netHostkernelacceleratorforvirtionet
[...]
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.
On Thu, Jan 12, 2012 at 1:16 AM, Stephen Hemminger
[off-list ref] wrote:
quoted hunk
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 <redacted>
---
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(-)
From: Stephen Hemminger <hidden> Date: 2012-01-12 05:30:38
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 <redacted>
---
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(-)
@@ -447,6 +447,9 @@ Your cooperation is appreciated.234=/dev/btrfs-controlBtrfscontroldevice235=/dev/autofsAutofscontroldevice236=/dev/mapper/controlDevice-Mappercontroldevice+237=/dev/loop-controlLoopbackcontroldevice+238=/dev/vhost-netHostkernelacceleratorforvirtionet+240-254Reservedforlocaluse255ReservedforMISC_DYNAMIC_MINOR
From: Thadeu Lima de Souza Cascardo <hidden> Date: 2012-01-12 20:04:48
On Wed, Jan 11, 2012 at 09:16:53AM -0800, Stephen Hemminger wrote:
quoted hunk
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 <redacted>
---
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(-)
@@ -447,6 +447,8 @@ Your cooperation is appreciated.234=/dev/btrfs-controlBtrfscontroldevice235=/dev/autofsAutofscontroldevice236=/dev/mapper/controlDevice-Mappercontroldevice+237=/dev/vhost-netHostkernelacceleratorforvirtionet+240-254Reservedforlocaluse255ReservedforMISC_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
From: David Miller <davem@davemloft.net> Date: 2012-01-13 04:07:01
From: Stephen Hemminger <redacted>
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 <redacted>
From: Kay Sievers <hidden> Date: 2012-01-13 04:19:05
On Fri, Jan 13, 2012 at 05:07, David Miller [off-list ref] wrote:
From: Stephen Hemminger <redacted>
Date: Wed, 11 Jan 2012 21:30:38 -0800
quoted
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 <redacted>
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 [off-list ref]
Kay
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
From: David Miller <davem@davemloft.net> Date: 2012-01-13 18:12:45
From: Kay Sievers <redacted>
Date: Fri, 13 Jan 2012 05:19:05 +0100
On Fri, Jan 13, 2012 at 05:07, David Miller [off-list ref] wrote:
quoted
From: Stephen Hemminger <redacted>
Date: Wed, 11 Jan 2012 21:30:38 -0800
quoted
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 <redacted>
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 [off-list ref]
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2012-01-15 12:42:36
On Thu, Jan 12, 2012 at 08:07:01PM -0800, David Miller wrote:
From: Stephen Hemminger <redacted>
Date: Wed, 11 Jan 2012 21:30:38 -0800
quoted
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 <redacted>
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
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
From: Avi Kivity <hidden> Date: 2012-01-16 12:28:35
On 01/11/2012 06:54 AM, Stephen Hemminger wrote:
By adding the a module alias, 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.
Choose one next to TUN since this driver is related to it.
Statically allocated numbers have to go through lanana, no?
This increases the security exposure and the kernel footprint for hosts
that don't want vhost-net.
--
error compiling committee.c: too many arguments to function
From: Stephen Hemminger <hidden> Date: 2012-01-16 15:52:36
On Mon, 16 Jan 2012 12:26:45 +0000
Alan Cox [off-list ref] wrote:
quoted
quoted
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 <redacted>
---
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(-)
@@ -447,6 +447,9 @@ Your cooperation is appreciated.234=/dev/btrfs-controlBtrfscontroldevice235=/dev/autofsAutofscontroldevice236=/dev/mapper/controlDevice-Mappercontroldevice+237=/dev/loop-controlLoopbackcontroldevice+238=/dev/vhost-netHostkernelacceleratorforvirtionet+240-254Reservedforlocaluse255ReservedforMISC_DYNAMIC_MINOR
From: David Miller <davem@davemloft.net> Date: 2012-01-16 23:06:47
From: Stephen Hemminger <redacted>
Date: Mon, 16 Jan 2012 07:52:36 -0800
On Mon, 16 Jan 2012 12:26:45 +0000
Alan Cox [off-list ref] wrote:
quoted
quoted
quoted
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 <redacted>
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.