Question about socket Queues

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

 



Hi,

Had couple of questions about socket.

Socket maintains few queues : Write, Receive, Error, backlog and Prequeue(tcp_opt)

tcp_v4_rcv makes a decision as to where the packet needs to be tailed.

What exactly is a Prequeue? 
<I assume that the ucopy struct of socket represents the User Space memory and is for the direct access of the user. > How is this queue used?

Why is it important that the number of socket users have to be ZERO (socket_lock_t    lock.users =0) for the tcp_preque to be called? When can lock.users = 0? There should be atleaset one thread which is using the socket right?

Why should ucopy.task be not NULL for tcp_prequeue to process packet? If its null, it return 0 and tcp_v4_rcv, anyway calls tcp_v4_do_rcv anyway on the packets! and tcp_prequeue is doing EXACTLY the same thing...It adds the skb into prequeue and it loops till the end of the queue and calls tcp_v4_do_rcv for every member of the queue!!! 

And in the process_preque, why is it necessary that the ucopy.memory > socket->rcvbuf for the packets to be dequeued from Prequeue to hand it over to tcp_v4_do_rcv?

And why is it important that the total headcount of Prequeue to be 1 AND ucopy.memory <= socket->rcvbuf, to wake up all threads which are sleeping on 'listen' call?
If there is one thread for the socket(lock.users), then tcp_prequeue wont be called from tcp_v4_rcv. Then, how can it wake up all the threads in the sleep queue through wake_up_interruptable(sock->sleep)? Please explain.


Any help with explanation of tcp_prequeue and the different queues like Prequeue and backlog queue will be greatly appreciated.

Thank you for time and effort.

Regards,
Anu




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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