Re: NETDEV_CHANGE events when __LINK_STATE_NOCARRIER is modified

Jeff Garzik (jgarzik@mandrakesoft.com)
Mon, 14 May 2001 14:12:17 -0400


kuznet@ms2.inr.ac.ru wrote:
>
> Hello!
>
> > Jeff has introduced `alloc_etherdev()' which allocates storage
> > for a netdev but doesn't register it. The one quirk with this
> > approach (and why it's vastly simpler than my thing)
>
> I do not see where it is simpler. The only difference is that
> name is unknown. 8)

Note that using dev->name during probe was always incorrect. Think
about the error case:

device 0:
dev = init_etherdev(...); /* gets if eth0 */
printk(... dev->name ...)
/* prints "eth0: error foo, aborting" */
failure! exit and unregister_netdev
device 1:
dev = init_etherdev(...); /* gets if eth0 */
printk(... dev->name ...)
/* prints "eth0: error foo, aborting" */
failure! exit and unregister_netdev
device 2:
dev = init_etherdev(...); /* gets if eth0 */
printk(... dev->name ...)
/* prints "eth0: error foo, aborting" */
failure! exit and unregister_netdev

So, using interface name in this manner was always buggy because it
conveys no useful information to the user.

> What's about dev_probe_lock, I again do not understand why it is not deleted.
> Please, shed some light.

I'm all for removing it... I do not like removing it in a so-called
"stable" series, though. alloc_etherdev() was enough to solve the race
and flush out buggy drivers using dev->name during probe. Notice I did
not remove init_etherdev and fix it properly -- IMHO that is 2.5
material.

Jeff

-- 
Jeff Garzik      | Game called on account of naked chick
Building 1024    |
MandrakeSoft     |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/