RE: Doubt on dev field in struct packet_type

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

 




Regards,
Rajendra Stalekar(extn 2016)
Location:- Akruti
Mobile no:- +91 9860501143
 

-----Original Message-----
From: pradeep singh [mailto:2500.pradeep@xxxxxxxxx] 
Sent: Monday, July 16, 2007 3:47 PM
To: rajendra.stalekar@xxxxxxxxx
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: Doubt on dev field in struct packet_type

On 7/16/07, Rajendra Stalekar <rajendra.stalekar@xxxxxxxxx> wrote:
> Hi,
>
> In the struct packet_type, the description for struct net_device *dev , is
> said to be the parameter which would allow to have different protocol
> handlers for different devices or one protocol handler for a specific
> device.
>
> I don't understand how this can be done, because the frames which comes to
> us through an interface , is not processed but queued into the
> input_pkt_queue before being processed by the driver, so only when the
> driver processes frames will can it notify the network layer which
protocol
> handler to execute.

I am not able to understand you clearly here.
BTW driver's interrupt handler is the first routine which gets the
packet isn't it.
So technically speaking you cannot say that driver processes packet
after it is put in the input_pkt_queue. It is queued there but is
moved to the correct queue by the driver's poll method (in new drivers
i mean).

>> What I meant by driver processing the packet implied that the poll method
of the driver processing it.
What I haven't got in your above statement is the "correct queue by the
driver's poll method?"
Isn't there only one kernel queue for the network layer to access?

>
> So it means that we need to have all the protocol handlers for all
devices.

What do you mean by We? Driver author or what?
Do you mean packet type handler ?
If so, then it is invoked in deliver_skb() depending on the type of
the packet i guess. So you don't have to worry about type of the
packet's handler. Just set the correct type and forget. Thats the
advantage of an object oriented approach.

I am still not very clear in what you asked.
Or may be i am disillusioned. :)

Feel free to rectify me.

>> What I meant to ask, was the struct net_device *dev in packet_type
structure mentioned that different protocol handlers for different devices
or a protocol handler for a specific device?
This is what I didn't get? 
Can you tell me what this field struct net_device *dev in packet_type
structure do?
My other query is when do we use ptype_all and ptype_base?

Regards,
Rajendra S.

Thanks
--psr

>
> I would appreciate if you could provide an explanantion on this.
>
>
>
>
>
> Regards,
>
> Rajendra Stalekar(extn 2016)
>
> Location:- Akruti
>
> Mobile no:- +91 9860501143
>
>
>
>


-- 
play the game



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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