Changes between Version 5 and Version 6 of nic_device_api


Ignore:
Timestamp:
Jan 26, 2020, 11:12:40 PM (4 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • nic_device_api

    v5 v6  
    1313* The RX channels are indexed by an hash key derived from the source IP address.
    1414* The TX channels are indexed by an hash key derived from the destination IP address.
    15 These 2*N chdev descriptors, and 2*N associated server threads, are distributed in clusters.
     15As all chdevs, these 2*N chdev descriptors, and the associated server threads, are distributed in different clusters.
    1616
    17 The  2*N server threads implement the protocols stack.
     17These server threads are supposed to implement the network protocols stack.
    1818
    19 The RX server threads block and deschedule when the RX queue is empty. The TX server threads block and deschedule when the TX queue is full. It is the driver responsibily to re-activate a blocked server thread when the queue state is modified: not full for TX, or not empty for RX.
     19An RX server threads blocks and deschedules when it try to read a packet, and the RX queue is empty. A TX server threads blocks and deschedules when it try to write a packet, and the TX queue is full. It is the driver responsibily to re-activate a blocked server thread when the queue state is modified: not full for TX, or not empty for RX.
    2020
    21 The WTI mailboxes used to receive the NIC_TX_IRQ[N] and NIC_RX_IRQ[N] (one IRQ per channel and per direction) to signal available RX packet, or free TX slot, for a given channel, must be statically allocated during the kernel initialisation phase. They are routed to the cluster containing the associated chdev descriptor and The associated server thread.
     21The WTI mailboxes used to receive the NIC_TX_IRQ[N] and NIC_RX_IRQ[N] (one IRQ per channel and per direction) to signal available RX packet, or free TX slot, for a given channel, are statically allocated during the kernel initialisation phase. They are routed to the core running the associated server thread.
    2222
    2323The generic NIC device "kernel" API defines two functions:
    2424* the '''read()''' function is called by the RX server thread to get one paquet from the RX queue.
    25 * the '''write()''' function is called by the TX server thread to put one packet to the TX queue.
     25* the '''write()''' function is called by the TX server thread to put one packet into the TX queue.
    2626This "kernel" API is detailed in section C below.
    2727
    28 All RX or TX paquets are sent or received in standard 2 Kbytes kernel buffers, that are dynamically allocated by the server threads. The structure ''pkd_t'' defining a packet descriptor contains the buffer pointer and the actual Ethernet packet length (in bytes).
     28All RX or TX packets are transferred between the server threads and the driver  in standardized 2 Kbytes kernel buffers, that are dynamically allocated by the server threads. The structure ''pkd_t'' defining a packet descriptor contains the buffer pointer and the actual Ethernet packet length (in bytes).
    2929
    3030The actual TX an RX queues structures depends on the hardware NIC implementation, and are only accessed by the driver functions.
     
    8282 * '''NIC_CMD_READ'''     : consume one packet from the RX queue.
    8383 * '''NIC_CMD_WRITE'''    : produce one packet to the TX queue.
    84