netdev
[Top] [All Lists]

Re: alloc_etherdev breaks ether=

To: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Subject: Re: alloc_etherdev breaks ether=
From: Jeff Garzik <jgarzik@xxxxxxxxxxxxxxxx>
Date: Fri, 29 Jun 2001 12:01:56 -0400
Cc: Andrew Morton <andrewm@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, netdev@xxxxxxxxxxx, Linus Torvalds <torvalds@xxxxxxxxxxxxx>
Organization: MandrakeSoft
References: <E15G0KM-0000Va-00@the-village.bc.nu>
Sender: owner-netdev@xxxxxxxxxxx
Alan Cox wrote:
> 
> > - init_etherdev
> > - failure, call unregister_netdev
> > - ether= is no longer correct
> 
> I tested this path in 2.4.0pre - it worked then. The device is unregistered,
> the next device registered is created with the same name and assigned the
> same options

Yeah but I don't view that behavior as perfect :)

For cases where the reason for device unregister is not ENODEV, you are
now assigning device B options intended for device A.  That sort of
stuff has all sorts of unintended consequences.


> > - init_etherdev, calls /sbin/hotplug
> > - device comes up before dev->mem_start is read/set from ether=
> 
> If your device is coming up before you register it then yes you need to
> re-order stuff and get the parameters seperately. But that isnt a big problem
> - its also already buggy as hell when this occurs and we have drivers 
> reporting
> eth%s: blah blah

I won't repeat what Andrew said.  WRT drivers reporting "eth%d" now, yes
that is a cleanup.  Printing dev->name was similar to the ether= case
above... it was usually right, but not always.  Consider, in 2.4, 2.2,
or 2.0:

        dev = init_etherdev(...); /* assigned eth0 */
        printk(... dev->name ...);
        failure, unregister_netdev(dev);

        dev = init_etherdev(...); /* assigned eth0 */
        printk(... dev->name ...);

-- 
Jeff Garzik      | Andre the Giant has a posse.
Building 1024    |
MandrakeSoft     |

<Prev in Thread] Current Thread [Next in Thread>