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
|