Subject: Re: [PATCH 1/2] e1000: fix netpoll with NAPI

From: Mitch Williams <[email-masked]>
Date: Thu, 08 Jun 2006 10:19:34 -0700

On Wed, 2006-06-07 at 11:44 -0700, Jeff Moyer wrote:

> That patch locks around the tx clean routine.  As such, it doesn't
> prevent
> the problem.

The call to netif_rx_schedule_prep provides locking because it sets the
__LINK_STATE_RX_SCHED bit atomically.  The spinlock around
e1000_clean_tx_irq is to protect it from other calls to the transmit
routine, not NAPI.

-Mitch

> > +     disable_irq(adapter->pdev->irq);
> > +     if
> (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0]))) {
> > +             if (spin_trylock(&adapter->tx_queue_lock)) {
> > +                     e1000_clean_tx_irq(adapter,
> &adapter->tx_ring[0]);
> > +                     spin_unlock(&adapter->tx_queue_lock);
> > +             }
> > +             adapter->clean_rx(adapter, adapter->rx_ring,
> > +                             &budget, netdev->weight);
> > +             clear_bit(__LINK_STATE_RX_SCHED,
> > +                             &adapter->polling_netdev[0].state);
> 
> -Jeff
> 
>