[lkml]   [2001]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Network buffer allocation
Tobin Park wrote:
> Hello,
> I am a newbie of linux kernel and studying network kernel source.
> when network device driver receives packet and allocates buffer,
> what is the default size of allocation?
> and is there any reallocation happened when upper layer(ip/tcp) manipulates
> buffer which was allocated by device driver?

You like to jump in the deep end, I see.

You might want to look at LINUX IP Stacks Commentary by Satchell and
Clifford (Coriolis). It covers 2.0, but it might prove helpful anyway.
(Also look into the device driver book,, and the

I'm not sure about a default allocation size... I'm not sure if there is

But as for the reallocation in the upper layers, usually it doesn't. (I
think there are some cases where it may have to, but we want to avoid it
when we can.) From my knowledge of 2.2.x, you'll want to look at how
that is avoided by using skb_push(), skb_pull(), skb_trim(),
skb_reserve(), etc.
skb_copy() and skb_clone() may also be of interest.

HTH, and good luck!

--------------------. Real Users find the one combination of bizarre
Eli Carter \ input values that shuts down the system for days.
eli.carter(a) `-------------------------------------------------
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.039 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site