RE: skbuff->dev and sk_buff->input_dev

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

 




> -----Original Message-----
> From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-
> bounce@xxxxxxxxxxxx] On Behalf Of Hayim Shaul
> Sent: Monday, July 18, 2005 11:35 AM
> To: kernelnewbies@xxxxxxxxxxxx
> Subject: skbuff->dev and sk_buff->input_dev
> 
> 
> Can someone explain what are the fields 'dev' and 'input_dev' in the
> skbuff structure.
> 

'input_dev' will always point to the device on which the packet was
received. In general 'dev' points to the real underlying device the
packet is being manipulated for. 
But there may be situations where 'dev' points to a virtual device (for
e.g. for bonding driver) , In such a case 'real_dev' will point to the
actual device.

For example in Link Aggregation (where multiple network links are
grouped into one logical high bandwidth link), there may exist a virtual
device corresponding to the high bandwidth link. In this case the 'dev'
field will point to this logical device while 'real dev' will point to
the actual real device.

Please correct me if I my understanding is not right.
Sanjay


> The comment above the declaration of the struct states:
> " *  @dev: Device we arrived on/are leaving by
>   *  @input_dev: Device we arrived on
>   *      @real_dev: The real device we are using
> "
> 
> However, on one machine I saw that input_dev is always NULL (for
incoming
> packets), while on another it is not.
> 
> 
> Are there configurations where skbuff->input_dev is not initialized?
> Are there configurations where skbuff->dev is not initialized??
> 
> 
> Actually, I want to find out the device (its index )on which an
incoming
> packet arrived. Is there a better way to do it? (One that works
allways?)
> 
> Hayim.
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/

--
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