Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: networking: device drivers: convert amazon/ena.txt to ReST

- add SPDX header;
- adjust titles and chapters, adding proper markups;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
8d299c7e 9ea2af8d

+92 -55
+90 -54
Documentation/networking/device_drivers/amazon/ena.txt Documentation/networking/device_drivers/amazon/ena.rst
··· 1 - Linux kernel driver for Elastic Network Adapter (ENA) family: 2 - ============================================================= 1 + .. SPDX-License-Identifier: GPL-2.0 3 2 4 - Overview: 5 - ========= 3 + ============================================================ 4 + Linux kernel driver for Elastic Network Adapter (ENA) family 5 + ============================================================ 6 + 7 + Overview 8 + ======== 9 + 6 10 ENA is a networking interface designed to make good use of modern CPU 7 11 features and system architectures. 8 12 ··· 39 35 Some of the ENA devices support a working mode called Low-latency 40 36 Queue (LLQ), which saves several more microseconds. 41 37 42 - Supported PCI vendor ID/device IDs: 43 - =================================== 44 - 1d0f:0ec2 - ENA PF 45 - 1d0f:1ec2 - ENA PF with LLQ support 46 - 1d0f:ec20 - ENA VF 47 - 1d0f:ec21 - ENA VF with LLQ support 38 + Supported PCI vendor ID/device IDs 39 + ================================== 48 40 49 - ENA Source Code Directory Structure: 50 - ==================================== 51 - ena_com.[ch] - Management communication layer. This layer is 52 - responsible for the handling all the management 53 - (admin) communication between the device and the 54 - driver. 55 - ena_eth_com.[ch] - Tx/Rx data path. 56 - ena_admin_defs.h - Definition of ENA management interface. 57 - ena_eth_io_defs.h - Definition of ENA data path interface. 58 - ena_common_defs.h - Common definitions for ena_com layer. 59 - ena_regs_defs.h - Definition of ENA PCI memory-mapped (MMIO) registers. 60 - ena_netdev.[ch] - Main Linux kernel driver. 61 - ena_syfsfs.[ch] - Sysfs files. 62 - ena_ethtool.c - ethtool callbacks. 63 - ena_pci_id_tbl.h - Supported device IDs. 41 + ========= ======================= 42 + 1d0f:0ec2 ENA PF 43 + 1d0f:1ec2 ENA PF with LLQ support 44 + 1d0f:ec20 ENA VF 45 + 1d0f:ec21 ENA VF with LLQ support 46 + ========= ======================= 47 + 48 + ENA Source Code Directory Structure 49 + =================================== 50 + 51 + ================= ====================================================== 52 + ena_com.[ch] Management communication layer. This layer is 53 + responsible for the handling all the management 54 + (admin) communication between the device and the 55 + driver. 56 + ena_eth_com.[ch] Tx/Rx data path. 57 + ena_admin_defs.h Definition of ENA management interface. 58 + ena_eth_io_defs.h Definition of ENA data path interface. 59 + ena_common_defs.h Common definitions for ena_com layer. 60 + ena_regs_defs.h Definition of ENA PCI memory-mapped (MMIO) registers. 61 + ena_netdev.[ch] Main Linux kernel driver. 62 + ena_syfsfs.[ch] Sysfs files. 63 + ena_ethtool.c ethtool callbacks. 64 + ena_pci_id_tbl.h Supported device IDs. 65 + ================= ====================================================== 64 66 65 67 Management Interface: 66 68 ===================== 69 + 67 70 ENA management interface is exposed by means of: 71 + 68 72 - PCIe Configuration Space 69 73 - Device Registers 70 74 - Admin Queue (AQ) and Admin Completion Queue (ACQ) ··· 90 78 framed in a generic Get/Set feature command. 91 79 92 80 The following admin queue commands are supported: 81 + 93 82 - Create I/O submission queue 94 83 - Create I/O completion queue 95 84 - Destroy I/O submission queue ··· 109 96 group may have multiple syndromes, as shown below 110 97 111 98 The events are: 99 + 100 + ==================== =============== 112 101 Group Syndrome 113 - Link state change - X - 114 - Fatal error - X - 102 + ==================== =============== 103 + Link state change **X** 104 + Fatal error **X** 115 105 Notification Suspend traffic 116 106 Notification Resume traffic 117 - Keep-Alive - X - 107 + Keep-Alive **X** 108 + ==================== =============== 118 109 119 110 ACQ and AENQ share the same MSI-X vector. 120 111 ··· 130 113 Keep-Alive event. A missed Keep-Alive event causes the WD handler to 131 114 fire. 132 115 133 - Data Path Interface: 134 - ==================== 116 + Data Path Interface 117 + =================== 135 118 I/O operations are based on Tx and Rx Submission Queues (Tx SQ and Rx 136 119 SQ correspondingly). Each SQ has a completion queue (CQ) associated 137 120 with it. ··· 140 123 physical memory. 141 124 142 125 The ENA driver supports two Queue Operation modes for Tx SQs: 126 + 143 127 - Regular mode 128 + 144 129 * In this mode the Tx SQs reside in the host's memory. The ENA 145 130 device fetches the ENA Tx descriptors and packet data from host 146 131 memory. 132 + 147 133 - Low Latency Queue (LLQ) mode or "push-mode". 134 + 148 135 * In this mode the driver pushes the transmit descriptors and the 149 136 first 128 bytes of the packet directly to the ENA device memory 150 137 space. The rest of the packet payload is fetched by the ··· 163 142 164 143 The driver supports multi-queue for both Tx and Rx. This has various 165 144 benefits: 145 + 166 146 - Reduced CPU/thread/process contention on a given Ethernet interface. 167 147 - Cache miss rate on completion is reduced, particularly for data 168 148 cache lines that hold the sk_buff structures. ··· 173 151 packet is running. 174 152 - In hardware interrupt re-direction. 175 153 176 - Interrupt Modes: 177 - ================ 154 + Interrupt Modes 155 + =============== 178 156 The driver assigns a single MSI-X vector per queue pair (for both Tx 179 157 and Rx directions). The driver assigns an additional dedicated MSI-X vector 180 158 for management (for ACQ and AENQ). ··· 185 163 interface of the adapter is opened, and it is de-registered when the 186 164 interface is closed. 187 165 188 - The management interrupt is named: 166 + The management interrupt is named:: 167 + 189 168 ena-mgmnt@pci:<PCI domain:bus:slot.function> 190 - and for each queue pair, an interrupt is named: 169 + 170 + and for each queue pair, an interrupt is named:: 171 + 191 172 <interface name>-Tx-Rx-<queue index> 192 173 193 174 The ENA device operates in auto-mask and auto-clear interrupt ··· 198 173 automatically cleared and the interrupt is masked. The interrupt is 199 174 unmasked by the driver after NAPI processing is complete. 200 175 201 - Interrupt Moderation: 202 - ===================== 176 + Interrupt Moderation 177 + ==================== 203 178 ENA driver and device can operate in conventional or adaptive interrupt 204 179 moderation mode. 205 180 ··· 227 202 The user can enable/disable adaptive moderation, modify the interrupt 228 203 delay table and restore its default values through sysfs. 229 204 230 - RX copybreak: 231 - ============= 205 + RX copybreak 206 + ============ 232 207 The rx_copybreak is initialized by default to ENA_DEFAULT_RX_COPYBREAK 233 208 and can be configured by the ETHTOOL_STUNABLE command of the 234 209 SIOCETHTOOL ioctl. 235 210 236 - SKB: 237 - ==== 211 + SKB 212 + === 238 213 The driver-allocated SKB for frames received from Rx handling using 239 214 NAPI context. The allocation method depends on the size of the packet. 240 215 If the frame length is larger than rx_copybreak, napi_get_frags() 241 216 is used, otherwise netdev_alloc_skb_ip_align() is used, the buffer 242 217 content is copied (by CPU) to the SKB, and the buffer is recycled. 243 218 244 - Statistics: 245 - =========== 219 + Statistics 220 + ========== 246 221 The user can obtain ENA device and driver statistics using ethtool. 247 222 The driver can collect regular or extended statistics (including 248 223 per-queue stats) from the device. 249 224 250 225 In addition the driver logs the stats to syslog upon device reset. 251 226 252 - MTU: 253 - ==== 227 + MTU 228 + === 254 229 The driver supports an arbitrarily large MTU with a maximum that is 255 230 negotiated with the device. The driver configures MTU using the 256 231 SetFeature command (ENA_ADMIN_MTU property). The user can change MTU 257 232 via ip(8) and similar legacy tools. 258 233 259 - Stateless Offloads: 260 - =================== 234 + Stateless Offloads 235 + ================== 261 236 The ENA driver supports: 237 + 262 238 - TSO over IPv4/IPv6 263 239 - TSO with ECN 264 240 - IPv4 header checksum offload 265 241 - TCP/UDP over IPv4/IPv6 checksum offloads 266 242 267 - RSS: 268 - ==== 243 + RSS 244 + === 269 245 - The ENA device supports RSS that allows flexible Rx traffic 270 246 steering. 271 247 - Toeplitz and CRC32 hash functions are supported. ··· 281 255 - The user can provide a hash key, hash function, and configure the 282 256 indirection table through ethtool(8). 283 257 284 - DATA PATH: 285 - ========== 286 - Tx: 287 - --- 258 + DATA PATH 259 + ========= 260 + Tx 261 + -- 262 + 288 263 end_start_xmit() is called by the stack. This function does the following: 264 + 289 265 - Maps data buffers (skb->data and frags). 290 266 - Populates ena_buf for the push buffer (if the driver and device are 291 267 in push mode.) ··· 299 271 - Calls ena_com_prepare_tx(), an ENA communication layer that converts 300 272 the ena_bufs to ENA descriptors (and adds meta ENA descriptors as 301 273 needed.) 274 + 302 275 * This function also copies the ENA descriptors and the push buffer 303 276 to the Device memory space (if in push mode.) 277 + 304 278 - Writes doorbell to the ENA device. 305 279 - When the ENA device finishes sending the packet, a completion 306 280 interrupt is raised. ··· 310 280 - The ena_clean_tx_irq() function is called. This function handles the 311 281 completion descriptors generated by the ENA, with a single 312 282 completion descriptor per completed packet. 283 + 313 284 * req_id is retrieved from the completion descriptor. The tx_info of 314 285 the packet is retrieved via the req_id. The data buffers are 315 286 unmapped and req_id is returned to the empty req_id ring. 316 287 * The function stops when the completion descriptors are completed or 317 288 the budget is reached. 318 289 319 - Rx: 320 - --- 290 + Rx 291 + -- 292 + 321 293 - When a packet is received from the ENA device. 322 294 - The interrupt handler schedules NAPI. 323 295 - The ena_clean_rx_irq() function is called. This function calls ··· 328 296 no new packet is found. 329 297 - Then it calls the ena_clean_rx_irq() function. 330 298 - ena_eth_rx_skb() checks packet length: 299 + 331 300 * If the packet is small (len < rx_copybreak), the driver allocates 332 301 a SKB for the new packet, and copies the packet payload into the 333 302 SKB data buffer. 303 + 334 304 - In this way the original data buffer is not passed to the stack 335 305 and is reused for future Rx packets. 306 + 336 307 * Otherwise the function unmaps the Rx buffer, then allocates the 337 308 new SKB structure and hooks the Rx buffer to the SKB frags. 309 + 338 310 - The new SKB is updated with the necessary information (protocol, 339 311 checksum hw verify result, etc.), and then passed to the network 340 312 stack, using the NAPI interface function napi_gro_receive().
+1
Documentation/networking/device_drivers/index.rst
··· 29 29 stmicro/stmmac 30 30 3com/3c509 31 31 3com/vortex 32 + amazon/ena 32 33 33 34 .. only:: subproject and html 34 35
+1 -1
MAINTAINERS
··· 815 815 R: Zorik Machulsky <zorik@amazon.com> 816 816 L: netdev@vger.kernel.org 817 817 S: Supported 818 - F: Documentation/networking/device_drivers/amazon/ena.txt 818 + F: Documentation/networking/device_drivers/amazon/ena.rst 819 819 F: drivers/net/ethernet/amazon/ 820 820 821 821 AMAZON RDMA EFA DRIVER