Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sk_buff vs mbuff

925 views
Skip to first unread message

syug...@gmail.com

unread,
Jan 22, 2009, 9:00:39 AM1/22/09
to
Hi,

Can someone please tell me what are significant differences between
mbuff and sk_buff ? I did a google but couldn't find anything
convincing.

Thanks,
syuga

Philip Paeps

unread,
Jan 22, 2009, 11:07:25 AM1/22/09
to
syug...@gmail.com <syug...@gmail.com> wrote:
> Can someone please tell me what are significant differences between mbuff
> and sk_buff ? I did a google but couldn't find anything convincing.

They are completely different.

struct mbuf: http://fxr.watson.org/fxr/source/sys/mbuf.h#L148
struct sk_buff: http://fxr.watson.org/fxr/source/include/linux/skbuff.h?v=linux-2.6#L259

mbufs are a fairly simple and "generic" buffering mechanism which have existed
for ages (they are very thoroughly explained in Stevens vol. 2) while sk_buff
is a more recent Linuxy invention and not at all simple.

struct sk_buff has a lot of bookkeeping internally and is passed through the
stack in a list-like way. mbufs tend to be chained together and most of the
bookkeeping gets done in the first mbuf in the chain (with the M_PKTHDR flag
set).

- Philip

--
Philip Paeps Please don't email any replies
phi...@paeps.cx I follow the newsgroup.

The sky spun again as Marco turned the ship so that 'down' was where long
tradition had always put it, in the region of the feet.
-- (Terry Pratchett, Strata)

0 new messages