netdev
[Top] [All Lists]

[PATCH] tg3 locking update (with NAPI overtones)

To: Jeff Garzik <jgarzik@xxxxxxxxx>
Subject: [PATCH] tg3 locking update (with NAPI overtones)
From: Robert Olsson <Robert.Olsson@xxxxxxxxxxx>
Date: Thu, 28 Nov 2002 11:12:52 +0100
Cc: netdev@xxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxx>, Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>
In-reply-to: <3DE406AE.2000908@xxxxxxxxx>
References: <3DE406AE.2000908@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx

Jeff Garzik writes:

 > * When net drivers move TX completion from interrupt to dev->poll(), 
 > this allows the rethinking of some traditional locking, namely 
 > eliminating a lock in dev->start_xmit() that most drivers implement 
 > these days.

 Yes. 

 > 
 > tg3_tx_timeout: net stack already holds dev->xmit_lock.  tx_lock GC'd.
 
 For tx_timout and other timer/async work there may exist a scheduled poll 
 to which we have to sync. Something like this could be done. Ideas comes
 from dev->close.

 /*
  *  Synchronize and disable poll
  */

  while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) {

          current->state = TASK_INTERRUPTIBLE;
          schedule_timeout(1);
  }

  .
  .

 /* Enable */
  clear_bit(__LINK_STATE_RX_SCHED, &dev->state);


 Cheers.
                                                --ro


<Prev in Thread] Current Thread [Next in Thread>