Annotation of wikisrc/projects/project/fast_protocol.mdwn, revision 1.2

1.1       jmmv        1: [[!template id=project
                      2: 
                      3: title="Fast protocol and port demultiplexing"
                      4: 
                      5: contact="""
                      6: [tech-kern](mailto:tech-kern@NetBSD.org),
                      7: [tech-net](mailto:tech-net@NetBSD.org),
                      8: [board](mailto:board@NetBSD.org),
                      9: [core](mailto:core@NetBSD.org)
                     10: """
                     11: 
                     12: category="networking"
                     13: difficulty="hard"
                     14: 
                     15: description="""
1.2     ! riastrad   16: This project proposal is a subtask of [[smp_networking]].
1.1       jmmv       17: 
                     18: The goal of this project is to enhance the networking protocols to process
                     19: incoming packets more efficiently.  The basic idea is the following: when a
                     20: packet is received and it is destined for a socket, simply place the packet
                     21: in the socket's receive PCQ (see [[atomic_pcq]]) and wake the blocking
                     22: socket.  Then, the protocol is able to process the next packet.
                     23: 
                     24: The typical packet flow from `ip_input` is to `{rip,tcp,udp}_input` which:
                     25: 
                     26: * Does the lookup to locate the socket which takes a reader lock on the
                     27:   appropriate pcbtable's hash bucket.
                     28: * If found and in the proper state:
                     29:   * Do not lock the socket since that would might block and therefore stop
                     30:     packet demultiplexing.
                     31:   * `pcq_put` the packet to the pcb's pcq.
                     32:   * `kcont_schedule` the worker continuation with small delay (~100ms).
                     33:     See [[kernel_continuations]].
                     34:   * Lock the socket's `cvmutex`.
                     35:   * Release the pcbtable lock.
                     36:   * If TCP and in sequence, then if we need to send an immediate ACK:
                     37:     * Try to lock the socket.
                     38:     * If successful, send an ACK.
                     39:   * Set a flag to process the PCQ.
                     40:   * `cv_signal` the socket's cv.
                     41:   * Release the cvmutex.
                     42: * If not found or not in the proper state:
                     43:   * Release the pcb hash table lock.
                     44: """
                     45: ]]
                     46: 
                     47: [[!tag smp_networking]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb