tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: refactoring ip_output() and the L2 _output()

On Fri, Feb 01, 2013 at 05:27:07PM -0600, David Young wrote:
> I've been trying to get a handle on a few of the many MP-safety problems
> in the network stack.  My investigations brought me yesterday to
> ether_output().
> ether_output() is surprisingly complicated.  The ether_output() that one
> would hope for takes an ifnet, a packet, and a nexthop as arguments,
> adds the correct L2 header to the front of the packet, and calls into a
> driver's transmit routine.  The ether_output() that we have does some
> acrobatics with routes, ARP resolution, cons'ing up and prepending an L2
> header, queueing the packet and nudging the driver.
> Here are the route acrobatics with some annotations:
>         if ((rt = rt0) != NULL) {
>                 if ((rt->rt_flags & RTF_UP) == 0) {
> It's funny that we get into ether_output() with an rtentry that's
> not even usable.  I'm not sure how that happens.  I will have to
> look more carefully at what ip_output() is doing.

I think the checks for !RTF_UP have something to do with the route
caches (struct route).  I'm experimenting with a tree that uses no route
caches and dispenses with this strange logic: if I remember, I will let
you know how that goes.


David Young    Urbana, IL    (217) 721-9981

Home | Main Index | Thread Index | Old Index