tech-net archive

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

Re: Mbufs stored in RX queues



vincent%labri.fr@localhost writes:

>It looks to me that holding a number of mbufs in the rxq is useless
>since anyway we will fail to keep the incoming packet if we can't
>allocate a new mbuf when the packet arrives.

There are systems where multiple packets can arrive even before
the interrupt routine is entered.

>Could anyone please help me see when this could be useful? From my
>perspective, it looks like passing up a freshly allocated mbuf would
>make us spend exactly the same amount of time in the interrupt handler,
>waste less memory, and simplify the code.

The mbuf needs to exist before the interrupt is requested. If you want to
pass up a new mbuf you need to copy the data to that new mbuf first. Some
drivers even do this, but only for small packets that fit into a single
header mbuf.

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index