Re: What is the best way for multiple net_devices

2001-06-28 Thread Jesse Pollard

-  Received message begins Here  -

> 
> On Wed, Jun 27, 2001 at 06:04:02PM -0400, Jeff Garzik wrote:
> > andrew may wrote:
> > > 
> > > Is there a standard way to make multiple copies of a network device?
> > > 
> > > For things like the bonding/ipip/ip_gre and others they seem to expect
> > > insmod -o copy1 module.o
> > > insmod -o copy2 module.o
> > 
> > The network driver should provide the capability to add new devices.
> 
> I am planning to write or patch some drivers to do this as well as other
> things. 
> 
> I would want to add things at run time after the module is alreaded loaded.
> So options to the module won't work.
> 
> I don't know how to use ifconfig to create a new device.

Ifconfig doesn't create the new device, when the driver module is loaded
it looks for all devices on the bus and creates the table with those
entries. To locat them, an "ifconfig -a" will do

> Any examples of drivers and apps that do this cleanly. The ones I have
> seen are not.

The only one I've seen are SCSI ( I believe it was done with
"echo 1 >/proc/ ". If a new device is present (turned on) the new
entry is appended.

Another one (similar) is the parport. Loading parport_probe rescans, and
defines the new devices.

Another is a module version of IDE. unload/loading ide-probe rescans
the IDE devices.

These ARE clumsy because you have to unload them to do a rescan, also
I think the tables are contained inside the probe module. I don't think
you can unload the probe module if one of the devices is busy (though the
SCSI version might be closer to what you want, it is also the most complex).

-
Jesse I Pollard, II
Email: [EMAIL PROTECTED]

Any opinions expressed are solely my own.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-28 Thread Jesse Pollard

-  Received message begins Here  -

 
 On Wed, Jun 27, 2001 at 06:04:02PM -0400, Jeff Garzik wrote:
  andrew may wrote:
   
   Is there a standard way to make multiple copies of a network device?
   
   For things like the bonding/ipip/ip_gre and others they seem to expect
   insmod -o copy1 module.o
   insmod -o copy2 module.o
  
  The network driver should provide the capability to add new devices.
 
 I am planning to write or patch some drivers to do this as well as other
 things. 
 
 I would want to add things at run time after the module is alreaded loaded.
 So options to the module won't work.
 
 I don't know how to use ifconfig to create a new device.

Ifconfig doesn't create the new device, when the driver module is loaded
it looks for all devices on the bus and creates the table with those
entries. To locat them, an ifconfig -a will do

 Any examples of drivers and apps that do this cleanly. The ones I have
 seen are not.

The only one I've seen are SCSI ( I believe it was done with
echo 1 /proc/ . If a new device is present (turned on) the new
entry is appended.

Another one (similar) is the parport. Loading parport_probe rescans, and
defines the new devices.

Another is a module version of IDE. unload/loading ide-probe rescans
the IDE devices.

These ARE clumsy because you have to unload them to do a rescan, also
I think the tables are contained inside the probe module. I don't think
you can unload the probe module if one of the devices is busy (though the
SCSI version might be closer to what you want, it is also the most complex).

-
Jesse I Pollard, II
Email: [EMAIL PROTECTED]

Any opinions expressed are solely my own.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread andrew may

On Wed, Jun 27, 2001 at 03:36:37PM -0700, Maksim Krasnyanskiy wrote:
> 
> >Any examples of drivers and apps that do this cleanly. The ones I have seen are not.
> TUN/TAP driver and tuncfg utility
> http://vtun.sf.net/tun

OK, thanks that is nice, but I think adding support to get into the /dev
namespace may be a little heavy for things like bonding or ipip.

I did not see tuncfg. From what I could see there were 2 ways to create
new devices. There was a script with mknod and then the ioctl(fd, TUNSETIFF, 
(void *) ).

I could do a similar ioctl for a pure net device but I still need a dummy
socket for creating/destroying devices.

I am going for an embedded system so I want to keep things light.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread Maksim Krasnyanskiy


>Any examples of drivers and apps that do this cleanly. The ones I have seen are not.
TUN/TAP driver and tuncfg utility
http://vtun.sf.net/tun
  
Max

Maksim Krasnyanskiy 
Senior Kernel Engineer
Qualcomm Incorporated

[EMAIL PROTECTED]
http://bluez.sf.net
http://vtun.sf.net

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread Stuart Lynne

In article <[EMAIL PROTECTED]>,
Jeff Garzik <[EMAIL PROTECTED]> wrote:
>andrew may wrote:
>> 
>> Is there a standard way to make multiple copies of a network device?
>> 
>> For things like the bonding/ipip/ip_gre and others they seem to expect
>> insmod -o copy1 module.o
>> insmod -o copy2 module.o
>
>The network driver should provide the capability to add new devices.
>
>Most drivers currently have the capability to do N devices, where N is
>some constant set at compile time.  Typically you use ifconfig, a
>special-purpose userland program, or sometimes even sysctls to configure
>additional net devices.

Ioctls require modifications to other parts of the kernel and a supporting
user land program.

Passing the number to create via insmod seems to be a reasonable compromise.

>It's certainly possible to modify the driver to create additional
>network interfaces on the fly, but a lot of drivers are not coded to do
>that at present.

-- 
__O 
Lineo - For Embedded Linux Solutions  _-\<,_ 
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00 (_)/ (_) 88 EC A3 EE 2D 1C 15 68
Stuart Lynne <[EMAIL PROTECTED]>   www.fireplug.net604-461-7532
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread andrew may

On Wed, Jun 27, 2001 at 06:04:02PM -0400, Jeff Garzik wrote:
> andrew may wrote:
> > 
> > Is there a standard way to make multiple copies of a network device?
> > 
> > For things like the bonding/ipip/ip_gre and others they seem to expect
> > insmod -o copy1 module.o
> > insmod -o copy2 module.o
> 
> The network driver should provide the capability to add new devices.

I am planning to write or patch some drivers to do this as well as other
things. 

I would want to add things at run time after the module is alreaded loaded.
So options to the module won't work.

I don't know how to use ifconfig to create a new device.

Any examples of drivers and apps that do this cleanly. The ones I have
seen are not.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread Jeff Garzik

andrew may wrote:
> 
> Is there a standard way to make multiple copies of a network device?
> 
> For things like the bonding/ipip/ip_gre and others they seem to expect
> insmod -o copy1 module.o
> insmod -o copy2 module.o

The network driver should provide the capability to add new devices.

Most drivers currently have the capability to do N devices, where N is
some constant set at compile time.  Typically you use ifconfig, a
special-purpose userland program, or sometimes even sysctls to configure
additional net devices.

It's certainly possible to modify the driver to create additional
network interfaces on the fly, but a lot of drivers are not coded to do
that at present.

-- 
Jeff Garzik  | Andre the Giant has a posse.
Building 1024|
MandrakeSoft |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



What is the best way for multiple net_devices

2001-06-27 Thread andrew may

Is there a standard way to make multiple copies of a network device?

For things like the bonding/ipip/ip_gre and others they seem to expect
insmod -o copy1 module.o
insmod -o copy2 module.o

It seems to me that this will waste space creating copies of all the 
static data.

Then there are things like ipsec that create a few static net_dev
structures, but I have no idea how they deal with more entries. 
They probably don't.

The PCI drivers seem to be pretty clean with init_one type functions.

Is there anything similar for generic hardware-less network devices.

I would hate to have write an ioctl to create a new device without
loading a module twice.

--
Andrew May
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



What is the best way for multiple net_devices

2001-06-27 Thread andrew may

Is there a standard way to make multiple copies of a network device?

For things like the bonding/ipip/ip_gre and others they seem to expect
insmod -o copy1 module.o
insmod -o copy2 module.o

It seems to me that this will waste space creating copies of all the 
static data.

Then there are things like ipsec that create a few static net_dev
structures, but I have no idea how they deal with more entries. 
They probably don't.

The PCI drivers seem to be pretty clean with init_one type functions.

Is there anything similar for generic hardware-less network devices.

I would hate to have write an ioctl to create a new device without
loading a module twice.

--
Andrew May
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread Jeff Garzik

andrew may wrote:
 
 Is there a standard way to make multiple copies of a network device?
 
 For things like the bonding/ipip/ip_gre and others they seem to expect
 insmod -o copy1 module.o
 insmod -o copy2 module.o

The network driver should provide the capability to add new devices.

Most drivers currently have the capability to do N devices, where N is
some constant set at compile time.  Typically you use ifconfig, a
special-purpose userland program, or sometimes even sysctls to configure
additional net devices.

It's certainly possible to modify the driver to create additional
network interfaces on the fly, but a lot of drivers are not coded to do
that at present.

-- 
Jeff Garzik  | Andre the Giant has a posse.
Building 1024|
MandrakeSoft |
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread andrew may

On Wed, Jun 27, 2001 at 06:04:02PM -0400, Jeff Garzik wrote:
 andrew may wrote:
  
  Is there a standard way to make multiple copies of a network device?
  
  For things like the bonding/ipip/ip_gre and others they seem to expect
  insmod -o copy1 module.o
  insmod -o copy2 module.o
 
 The network driver should provide the capability to add new devices.

I am planning to write or patch some drivers to do this as well as other
things. 

I would want to add things at run time after the module is alreaded loaded.
So options to the module won't work.

I don't know how to use ifconfig to create a new device.

Any examples of drivers and apps that do this cleanly. The ones I have
seen are not.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread Stuart Lynne

In article [EMAIL PROTECTED],
Jeff Garzik [EMAIL PROTECTED] wrote:
andrew may wrote:
 
 Is there a standard way to make multiple copies of a network device?
 
 For things like the bonding/ipip/ip_gre and others they seem to expect
 insmod -o copy1 module.o
 insmod -o copy2 module.o

The network driver should provide the capability to add new devices.

Most drivers currently have the capability to do N devices, where N is
some constant set at compile time.  Typically you use ifconfig, a
special-purpose userland program, or sometimes even sysctls to configure
additional net devices.

Ioctls require modifications to other parts of the kernel and a supporting
user land program.

Passing the number to create via insmod seems to be a reasonable compromise.

It's certainly possible to modify the driver to create additional
network interfaces on the fly, but a lot of drivers are not coded to do
that at present.

-- 
__O 
Lineo - For Embedded Linux Solutions  _-\,_ 
PGP Fingerprint: 28 E2 A0 15 99 62 9A 00 (_)/ (_) 88 EC A3 EE 2D 1C 15 68
Stuart Lynne [EMAIL PROTECTED]   www.fireplug.net604-461-7532
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread Maksim Krasnyanskiy


Any examples of drivers and apps that do this cleanly. The ones I have seen are not.
TUN/TAP driver and tuncfg utility
http://vtun.sf.net/tun
  
Max

Maksim Krasnyanskiy 
Senior Kernel Engineer
Qualcomm Incorporated

[EMAIL PROTECTED]
http://bluez.sf.net
http://vtun.sf.net

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: What is the best way for multiple net_devices

2001-06-27 Thread andrew may

On Wed, Jun 27, 2001 at 03:36:37PM -0700, Maksim Krasnyanskiy wrote:
 
 Any examples of drivers and apps that do this cleanly. The ones I have seen are not.
 TUN/TAP driver and tuncfg utility
 http://vtun.sf.net/tun

OK, thanks that is nice, but I think adding support to get into the /dev
namespace may be a little heavy for things like bonding or ipip.

I did not see tuncfg. From what I could see there were 2 ways to create
new devices. There was a script with mknod and then the ioctl(fd, TUNSETIFF, 
(void *) ifr).

I could do a similar ioctl for a pure net device but I still need a dummy
socket for creating/destroying devices.

I am going for an embedded system so I want to keep things light.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/