Re: Basic understanding about sk_buff packet handling

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

 



On Wed, Apr 14, 2004 at 03:06:53PM -0000, bunty  wrote:
> hello,
>               As a part of my kernel project i come to some problems regardiong
> sk_buff structure
> 1) i want to add two fields of each 4 bytes in sk_buff structure what is the
> effect of it on kernel packet processing? Is there any -ve effect?

No, we did it in my previous job. Didn't affect the kernel packet
processing. We actually attached a whole extra structure to it. skbufs
are in-kernel only. You can look at the cb field BTW it may be good for
what you want.

> 2) if i am going to increase it by 8 bytes then what will happen to net packet
> size and its data part? Is that all will fit in sk_buff?

it doesn't affect net packet size you only affect the in-kernel
structure. You don't have room in the protocol IIRC to add anything the
network packet.

> 3) Which is best to include my 2 fields in sk_buff or include its total value
> at end of data part?

Don't add it at the end of the data part, you don't know where the end
is and when and where it moves around. This will also effect the
allocation sizes since skbuffs are allocated on the slabs IIRC which
works on 2^n sizes.

> 4) When kernel passes the packet to dest host all sk_buff fields are also
> transferred or only packet header and data?

Only the packet header and the data. As far as I recall when the data
is allocated the head pointer isn't pointing to the exact start of the
data buffer to allow room to attach the header before the data is sent
to the net. Thats why you have both a data and a head pointers.
I think the data is dependent on the protocol (when the skbuff is
allocated the about requested is asked for).

> parag.
> 
> 
> 
> +++++++++++++++++++++++++++++++++++++++++++
> This Mail Was Scanned By Mail-seCure System
> at the Tel-Aviv University CC.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux