[lkml]   [2009]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 1/1] Tell linkwatch about new interfaces
    On Sat, Apr 4, 2009 at 8:05 PM, David Miller <> wrote:
    > From: Andrew Lutomirski <>
    > Date: Wed, 1 Apr 2009 11:40:06 -0400
    >> When a network driver registers a new interface, linkwatch will not notice,
    >> and hence not set the rfc2863 operstate, until netif_carrier_on gets called.
    >> If the new interface has no carrier when it is connected, then a status of
    >> "unknown" is reported to userspace, which confuses various tools
    >> (NetworkManager, for example).
    >> This fires a linkwatch event for all new interfaces, so that operstate
    >> gets set reasonably quickly.
    >> Signed-off-by: Andrew Lutomirski <>
    > The default assumed state for a freshly registered network
    > device is that the link is up.
    > If that disagrees from reality, the driver should make the
    > appropriate netif_carrier_off() call.
    > I'm sure you'll find that the e1000 driver is not doing this
    > and that is what causes the bug you are seeing.

    Nope. The end of e1000_probe (in e1000e) is:

    /* tell the stack to leave us alone until e1000_open() is called */

    strcpy(netdev->name, "eth%d");
    err = register_netdev(netdev);
    if (err)
    goto err_register;


    netif_carrier_off does:

    void netif_carrier_off(struct net_device *dev)
    if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
    if (dev->reg_state == NETREG_UNINITIALIZED)

    So, either it should be illegal to call netif_carrier_off on an
    unregistered net_device (and there should be a WARN() in
    netif_carrier_off), or it should work correctly, and
    register_netdevice should do the right thing when there is no carrier
    (i.e. something like my patch).


     \ /
      Last update: 2009-04-05 06:05    [W:0.022 / U:0.764 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site