[tulip] race condition leading to hung tx queue in .92, .93

Chris Friesen cfriesen@nortelnetworks.com
Fri Feb 15 10:49:01 2002


We have discovered a race condition that could lead to a hung tx queue in the
.92 and .93 drivers.  Near the end of tulip_start_xmit(), there is the following
code:

        if ( ! tp->tx_full)
                netif_unpause_tx_queue(dev);
        else
                netif_stop_tx_queue(dev);

The problem occurs if we fail the check and then before running the else clause
get interrupted by tulip_interrupt(), which then cleans up enough send packets
that it clears tx_full and tbusy.  The interrupt handler returns, and we proceed
to set tbusy.  At this point we're left with tbusy set, and tx_full cleared, and
the driver never recovers.

The fix is to change this code to the following:

        if ( ! tp->tx_full)
                netif_unpause_tx_queue(dev);
        else {
                netif_stop_tx_queue(dev);

                /* handle case of tulip_interrupt() running under our feet */
                if ( ! tp->tx_full)
                        netif_start_tx_queue(dev);
        }


I'm not subscribed to the list, so please cc any responses to me.

Thanks,

Chris


-- 
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com