Zonghua Gu <[EMAIL PROTECTED]> writes:
> I appreciate any help on this question:
>
> When outgoing packets are sent out by dev_queue_xmit, and
> dev->tbusy is true, it's queued in the link-level queue. Suppose the
> device has been continuously busy for a while and the link-level queue
> dev->qdisc fills up. Later when the device is not busy any more, who is
> responsible for sending out the queued packets? I only see 2
> possibilities:
> 1. When another outgoing packet comes down from higher level protocols and
> hard_start_xmit calls qdisc_wakeup. But then only one packet is sent out
> by qdisc_wakeup, so this does not empty the queue.
> 2. When an incoming packet generates an interrupt and qdisc_run_queues is
> called from net_bh, therefore emptying the outgoing queue.
> But what if no incoming packets are forthcoming? I don't see how the
> outgoing queue can be emptied.
Since tbusy is true, that usually means that the network hardware/driver is
busy transmitting. Most network hardware will generate an interrupt when
the current transmission is finished. The interrupt handler will then clear
tbusy and call mark_bh(NET_BH) to schedule the "network layer" which will
then call the hard_start_xmit() function with the next queued packet (if
any)
For network adapters that implement transmit "rings", the tbusy will only
be set when the ring is full, and will always be cleared as long as the
ring is not full. Again, it is the "transmit" interrupt that clears the
tbusy flag when a packet has been transmitted since the ring is not full
anymore.
If you don't have transmit interrupts (or write wakeups of any kind), then
you'll need to have a timer of some sort (linux kernel timer or on chip
timer) that can schedule a function which can poll to check if the transmit
has actually finished.
-- Dag
--
/ Dag Brattli | The Linux-IrDA Project /
// University of Tromsoe, Norway | Infrared communication for Linux //
/// http://www.cs.uit.no/~dagb | http://www.cs.uit.no/linux-irda/ ///
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]