Skip to contentSkip to conversation

udev and ISA network cards

DISCUSSION Olaf 3 participants 5 messages Jun 26, 2009 – Jul 2, 2009

lore
Share & tools
lore

Olaf

author
#0 lore raw

Hi,

I would like to use ISA cards in combination with persistent net rules, especially renaming ethX to something like internal / internet / etc. as this is somewhat easier to remember ;-)

Is this at all possible?
Or is this more a case of: will never work 'cause the drivers are not cooperating enough?
Or even isapnp missing (this box is not playing along with pnp)?

I have cards with 3c509 and ne driver. Both cards do work, apart from the persistent net stuff :-/
Monitoring using udevadm monitor shows udevd is at least doing 'something' (see snippet below) but it is either ignoring ISA or the kernel/driver is missing some information. udevadm info provides very little information:

# udevadm info --query all --path=/sys/bus/isa/drivers/3c509/3c509.0 
--attribute-walk

looking at device '/devices/isa/3c509.0':

    KERNEL="3c509.0"
    SUBSYSTEM="isa"
    DRIVER="3c509"

looking at parent device '/devices/isa':

    KERNELS="isa"
    SUBSYSTEMS=""
    DRIVERS=""

Please advise.
Thanks.

Olaf

KERNEL[1246007462.702266] add      /module/3c509 (module)
UDEV  [1246007462.704344] add      /module/3c509 (module)
KERNEL[1246007462.706222] add      /bus/pnp/drivers/3c509 (drivers)
KERNEL[1246007462.709164] add      /bus/isa/drivers/3c509 (drivers)
KERNEL[1246007462.711276] add      /devices/isa/3c509.0 (isa)
KERNEL[1246007462.713145] add      /devices/virtual/net/eth0 (net)
KERNEL[1246007462.715007] add      /devices/isa/3c509.1 (isa)
KERNEL[1246007462.720220] remove   /devices/isa/3c509.1 (isa)
KERNEL[1246007462.721475] add      /devices/isa/3c509.2 (isa)
KERNEL[1246007462.722471] remove   /devices/isa/3c509.2 (isa)
KERNEL[1246007462.726667] add      /devices/isa/3c509.3 (isa)
UDEV  [1246007462.728006] add      /bus/pnp/drivers/3c509 (drivers)
KERNEL[1246007462.729041] remove   /devices/isa/3c509.3 (isa)
KERNEL[1246007462.730033] add      /devices/isa/3c509.4 (isa)
KERNEL[1246007462.731688] remove   /devices/isa/3c509.4 (isa)
KERNEL[1246007462.736603] add      /devices/isa/3c509.5 (isa)
KERNEL[1246007462.737985] remove   /devices/isa/3c509.5 (isa)
KERNEL[1246007462.739210] add      /devices/isa/3c509.6 (isa)
KERNEL[1246007462.743217] remove   /devices/isa/3c509.6 (isa)
UDEV  [1246007462.744583] add      /bus/isa/drivers/3c509 (drivers)
KERNEL[1246007462.745817] add      /devices/isa/3c509.7 (isa)
KERNEL[1246007462.747043] remove   /devices/isa/3c509.7 (isa)
KERNEL[1246007462.752101] add      /bus/eisa/drivers/3c579 (drivers)
UDEV  [1246007462.756301] add      /devices/isa/3c509.0 (isa)
UDEV  [1246007462.765593] add      /devices/virtual/net/eth0 (net)
UDEV  [1246007462.780655] add      /devices/isa/3c509.1 (isa)
UDEV  [1246007462.788468] remove   /devices/isa/3c509.1 (isa)
UDEV  [1246007462.796445] add      /devices/isa/3c509.2 (isa)
UDEV  [1246007462.804252] remove   /devices/isa/3c509.2 (isa)
UDEV  [1246007462.812270] add      /devices/isa/3c509.3 (isa)
UDEV  [1246007462.819985] remove   /devices/isa/3c509.3 (isa)
UDEV  [1246007462.827933] add      /devices/isa/3c509.4 (isa)
UDEV  [1246007462.835793] remove   /devices/isa/3c509.4 (isa)
UDEV  [1246007462.843736] add      /devices/isa/3c509.5 (isa)
UDEV  [1246007462.851621] remove   /devices/isa/3c509.5 (isa)
UDEV  [1246007462.859457] add      /devices/isa/3c509.6 (isa)
UDEV  [1246007462.867219] remove   /devices/isa/3c509.6 (isa)
UDEV  [1246007462.875175] add      /devices/isa/3c509.7 (isa)
UDEV  [1246007462.883008] remove   /devices/isa/3c509.7 (isa)
UDEV  [1246007462.890990] add      /bus/eisa/drivers/3c579 (drivers)
#1 lore raw
Quoted 5 lines · Olaf

I would like to use ISA cards in combination with persistent net rules, especially renaming ethX to something like internal / internet / etc. as this is somewhat easier to remember ;-)

Is this at all possible?

It should work.

Quoted 1 line

KERNEL[1246007462.711276] add      /devices/isa/3c509.0 (isa)

This is the card device.

Quoted 1 line

KERNEL[1246007462.713145] add      /devices/virtual/net/eth0 (net)

This is the network interface device, which needs to be connected to the card device as a parent.

Then it would look like:

        /devices/isa/3c509.0/net/eth0

and only then the persistent rule generator will kick in.

This needs to be fixed in the kernel driver, it needs to set the parent device of the netdev before it is registered.

Kay

author
#2 lore raw
In reply to Olaf
Quoted 7 lines · Kay Sievers
Quoted 5 lines

I would like to use ISA cards in combination with persistent net rules, especially renaming ethX to something like internal / internet / etc. as this is somewhat easier to remember ;-)

Is this at all possible?

It should work.

[... snip snip ...]

Quoted 2 lines

This needs to be fixed in the kernel driver, it needs to set the parent device of the netdev before it is registered.

I was afraid you were going to say something like that ... Ah well, I'll start staring at kernel driver code then.

regards

Olaf

PS: I'd appreciate any hints, pushes, shoves etc. to get me in proper direction.

#3 lore raw
In reply to Olaf

Hi Olaf,

Quoted 10 lines · Olaf
Quoted 7 lines · Kay Sievers
Quoted 5 lines

I would like to use ISA cards in combination with persistent net rules, especially renaming ethX to something like internal / internet / etc. as this is somewhat easier to remember ;-)

Is this at all possible?

It should work.

Quoted 8 lines

[... snip snip ...]

Quoted 2 lines

This needs to be fixed in the kernel driver, it needs to set the parent device of the netdev before it is registered.

I was afraid you were going to say something like that ... Ah well, I'll start staring at kernel driver code then.

Which would help you only to a very limited amount.

udev relies on device autodetection, ie a (hardware) device must have some means by which someone else can identify it. With PCI this is no problem at all, as each device has its vendor/device ID as per spec.

ISA OTOH is a different beast. And if you trawl memory back to the ISA days, the main problem with it was that it _doesn't_ have an independent identifier.
IIRC you couldn't even identify the slot itself; each device mostly hardcoded to use a specific I/O address / region and some IRQ. And it was up to the task of the admin to ensure each device got a separate addr/irq tuple.

Hence they invented PnP IDs which provide for exactly this sort of identifier.

So, translated to udev this means that any ISA card providing PnP IDs should work, or at least it should be possible to make it work with udev.
Any ISA card _not_ providing PnP IDs you're basically out of luck. The only choice you'd have here is to use some sort of lookup-table which provides a static assignment between IO addresses and drivers.

HTH.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
author
#4 lore raw
In reply to Olaf

Hi Hannes,

thanks for your thoughts!

Quoted 5 lines

udev relies on device autodetection, ie a (hardware) device must have some means by which someone else can identify it. With PCI this is no problem at all, as each device has its vendor/device ID as per spec.

Quoted 7 lines

ISA OTOH is a different beast. And if you trawl memory back to the ISA days, the main problem with it was that it _doesn't_ have an independent identifier.
IIRC you couldn't even identify the slot itself; each device mostly hardcoded to use a specific I/O address / region and some IRQ. And it was up to the task of the admin to ensure each device got a separate addr/irq tuple.

For ISA (and PCI, USB, etc.) I use an additional method and do not fully rely on autodetection to work.

In my case I have some sort of network configuration file, which includes kernel modules, option if so required (i.e. ISA port addresses, IRQs etc.) and the things needed for if up.
My network init script uses this config file to modprobe first and then configure each interface.

Quoted 9 lines

Hence they invented PnP IDs which provide for exactly this sort of identifier.

So, translated to udev this means that any ISA card providing PnP IDs should work, or at least it should be possible to make it work with udev.
Any ISA card _not_ providing PnP IDs you're basically out of luck. The only choice you'd have here is to use some sort of lookup-table which provides a static assignment between IO addresses and drivers.

The only problem I face is the lack of autodetection, so the config file needs to be filled more or less manually. But there is not much one can do about that with ISA cards.

OK, I have one additional problem, and that is the udev net device renaming which is (understandably) not working with ISA cards ;-)

thanks

Olaf