Re: networking questions

Andi Kleen (ak@muc.de)
15 Dec 1999 03:10:12 +0100


dm@cs.duke.edu (Dan Mills) writes:

> Hello,
>
> I am trying to learn the inner workings of the networking code.
> Mainly IP. I've come up with a few questions that (even after
> grepping like mad, and reading several books) I can't answer.
>
> One is, I can't figure out in what context the IP send code (eg,
> ip_queue_xmit) is executed. Is it in interrupt context? If so, with
> interrupts enabled? (ie, like a bh). What pieces of code should I be
> looking at?

Depends. It can be either called from user context (when you send
a packet from a socket), or in a bottom half (net_bh or timer_bh).
They are never called from an actual hardware interrupt.

>
> My next question involves the use of dev->tbusy in the drivers' send
> routine. Am I correct in my assumption that setting dev->tbusy to a
> non-zero value causes the upper layers to block? Also, what would be
> the best strategy for sending packets with an interface that has the
> ability to queue many packets in hardware?[1] Would it be good to
> just copy each packet to the interface and only set dev->tbusy to true
> when the card's queue is full?

Yes.

-Andi

-- 
This is like TV. I don't like TV.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/