This project proposal is a subtask of smp networking.
The goal of this project is to enhance the networking protocols to process incoming packets more efficiently. The basic idea is the following: when a packet is received and it is destined for a socket, simply place the packet in the socket's receive PCQ (see atomic pcq) and wake the blocking socket. Then, the protocol is able to process the next packet.
The typical packet flow from
ip_input is to
- Does the lookup to locate the socket which takes a reader lock on the appropriate pcbtable's hash bucket.
- If found and in the proper state:
- Do not lock the socket since that would might block and therefore stop packet demultiplexing.
pcq_putthe packet to the pcb's pcq.
kcont_schedulethe worker continuation with small delay (~100ms). See kernel continuations.
- Lock the socket's
- Release the pcbtable lock.
- If TCP and in sequence, then if we need to send an immediate ACK:
- Try to lock the socket.
- If successful, send an ACK.
- Set a flag to process the PCQ.
cv_signalthe socket's cv.
- Release the cvmutex.
- If not found or not in the proper state:
- Release the pcb hash table lock.