Hi,

We had a bad ethernet card that wouldnt initialise, so I figured we
could blink all other ethernets in the box to identify the bad one.

I was surprised to find we could only blink one card at a time, the
other ethtool processes were all blocked in D state. It turns out
the ethtool ioctl takes the rtnl semaphore:

        rtnl_lock();
        ret = dev_ethtool(&ifr);
        rtnl_unlock();

And all the ->phys_id methods I looked at sleep for the amount of time
you want to blink for. eg for e100:

static int e100_phys_id(struct net_device *netdev, u32 data)
{
        struct nic *nic = netdev_priv(netdev);

        if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))
                data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ);
        mod_timer(&nic->blink_timer, jiffies);
        msleep_interruptible(data * 1000);
        del_timer_sync(&nic->blink_timer);
        mdio_write(netdev, nic->mii.phy_id, MII_LED_CONTROL, 0);

        return 0;
}

While its a bit annoying to only be able to blink one card at a time,
the fact we can hold the rtnl semaphore for a very long time sounds bad.

Maybe we should instead fire off the blink timer, return immediately
and stop the blink when our timeout has been exceeded. If the user
wanted to clear a blink they could then issue another ethtool call with
a 0 length timeout.

Anton
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to