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 5:11 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:
> -----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:
[snip]
>
> >> 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?

accessing and moving are different.pkt_input_queue packets need to be
moved to some where else i.e a different queue or in the same queue at
the end prfereably(this is just and example)after they have been
processed.

>> Correct queue of what is my question? The queue accessible by the
kernel??? Is that what u mean?

>
[...]
>
> >> 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?

I dont know, but it is NULL.
I guess it may be of use but i cant thing of why would i force a
certain packet type to a net_device structure.
May be useful for VLAN and bonding drivers, which are the only
techniques seem to be bound to this field. Else there is no use of
putting of net_device field there i think.

You need to worry about handler, there is usually not a specific
protocol handler for a device. A device tied to just one protocol
looks too restrictive and i am not aware of such device(s).

>> Again even I felt that having only specific protocol handler for a
specific device is wrong, but that is what is mentioned in one of the
documents which I am going through.
I was only wondering how can we have a specific protocol handler for a
specific device.
The dev field assigned to NULL means that the protocol is enabled for all
devices.??? Even I don't get why would anyone want a specific protocol to be
enabled on  a specific device. It never made sense to me either.

BTW driver author does not have to worry about protocol handlers, you
just set the correct protocol type in your interrupt routine[refer my
earlier reply], and the correct handler is invoked without driver's
knowledge.
>> Well I understand that, however it was just a curiosity that why was this
dev field introduced.

> My other query is when do we use ptype_all and ptype_base?

packet types. Not evey packets received is of same type, some are arp
apckets, some are ICMP, some raw packets and so on so forth. There two
variables help you in finding the list of these packet types near to
you in an easy way.

>> I am aware about why they are there , but my question was when do we put
a packet in the ptype_all and when do we put them ptype_base?
Why are these 2 different packet_type structures used interchangeably?

Does this answer(s) your queries?

thanks

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


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