[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120604194806.GB1648@redhat.com>
Date: Mon, 4 Jun 2012 22:48:07 +0300
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Willy Tarreau <w@....eu>, David Miller <davem@...emloft.net>,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: netdev_alloc_skb() use build_skb()
On Mon, Jun 04, 2012 at 09:24:02PM +0200, Eric Dumazet wrote:
> On Mon, 2012-06-04 at 21:16 +0300, Michael S. Tsirkin wrote:
>
> > Will take a look, thanks.
> > By the way, this comment at build_skb:
> > * @frag_size: size of fragment, or 0 if head was kmalloced
> >
> > is not very clear to me. Could you clarify what exactly size
> > of fragment means in this context?
> >
>
>
> If your driver did :
>
> data = kmalloc(100) then you use @frag_size=0, so that build_skb() does
> the ksize(data) to fetch real size (It can depend on slab/slub/sob
> allocator)
>
>
> If you used netdev_alloc_frag(128), then you use 128 because there is no
> way build_skb() can guess the size of the fragment. Its also how we
> signal to build_skb() that skb->head_frag is set to 1.
>
> __netdev_alloc_skb() for example does :
>
> void *data = netdev_alloc_frag(fragsz);
> skb = build_skb(data, fragsz);
>
If I do this what will truesize be? 128, no?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists