Changes between Version 5 and Version 6 of nic_device_api
- Timestamp:
- Jan 26, 2020, 11:12:40 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
nic_device_api
v5 v6 13 13 * The RX channels are indexed by an hash key derived from the source IP address. 14 14 * 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 inclusters.15 As all chdevs, these 2*N chdev descriptors, and the associated server threads, are distributed in different clusters. 16 16 17 The 2*N server threads implement theprotocols stack.17 These server threads are supposed to implement the network protocols stack. 18 18 19 The RX server threads block and deschedule when the RX queue is empty. The TX server threads block and deschedule whenthe 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.19 An 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. 20 20 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.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, are statically allocated during the kernel initialisation phase. They are routed to the core running the associated server thread. 22 22 23 23 The generic NIC device "kernel" API defines two functions: 24 24 * 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. 26 26 This "kernel" API is detailed in section C below. 27 27 28 All RX or TX pa quets 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).28 All 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). 29 29 30 30 The actual TX an RX queues structures depends on the hardware NIC implementation, and are only accessed by the driver functions. … … 82 82 * '''NIC_CMD_READ''' : consume one packet from the RX queue. 83 83 * '''NIC_CMD_WRITE''' : produce one packet to the TX queue. 84