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

gve: Update GVE documentation to describe DQO

DQO is a new descriptor format for our next generation virtual NIC.

Signed-off-by: Bailey Forrest <bcf@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Bailey Forrest and committed by
David S. Miller
c6a7ed77 47889068

+48 -5
+48 -5
Documentation/networking/device_drivers/ethernet/google/gve.rst
··· 47 47 - Transmit and Receive Queues 48 48 - See description below 49 49 50 + Descriptor Formats 51 + ------------------ 52 + GVE supports two descriptor formats: GQI and DQO. These two formats have 53 + entirely different descriptors, which will be described below. 54 + 50 55 Registers 51 56 --------- 52 - All registers are MMIO and big endian. 57 + All registers are MMIO. 53 58 54 59 The registers are used for initializing and configuring the device as well as 55 60 querying device status in response to management interrupts. 61 + 62 + Endianness 63 + ---------- 64 + - Admin Queue messages and registers are all Big Endian. 65 + - GQI descriptors and datapath registers are Big Endian. 66 + - DQO descriptors and datapath registers are Little Endian. 56 67 57 68 Admin Queue (AQ) 58 69 ---------------- ··· 108 97 The handler for these irqs schedule the napi for that block to run 109 98 and poll the queues. 110 99 111 - Traffic Queues 112 - -------------- 113 - gVNIC's queues are composed of a descriptor ring and a buffer and are 114 - assigned to a notification block. 100 + GQI Traffic Queues 101 + ------------------ 102 + GQI queues are composed of a descriptor ring and a buffer and are assigned to a 103 + notification block. 115 104 116 105 The descriptor rings are power-of-two-sized ring buffers consisting of 117 106 fixed-size descriptors. They advance their head pointer using a __be32 ··· 132 121 The buffers for receive rings are put into a data ring that is the same 133 122 length as the descriptor ring and the head and tail pointers advance over 134 123 the rings together. 124 + 125 + DQO Traffic Queues 126 + ------------------ 127 + - Every TX and RX queue is assigned a notification block. 128 + 129 + - TX and RX buffers queues, which send descriptors to the device, use MMIO 130 + doorbells to notify the device of new descriptors. 131 + 132 + - RX and TX completion queues, which receive descriptors from the device, use a 133 + "generation bit" to know when a descriptor was populated by the device. The 134 + driver initializes all bits with the "current generation". The device will 135 + populate received descriptors with the "next generation" which is inverted 136 + from the current generation. When the ring wraps, the current/next generation 137 + are swapped. 138 + 139 + - It's the driver's responsibility to ensure that the RX and TX completion 140 + queues are not overrun. This can be accomplished by limiting the number of 141 + descriptors posted to HW. 142 + 143 + - TX packets have a 16 bit completion_tag and RX buffers have a 16 bit 144 + buffer_id. These will be returned on the TX completion and RX queues 145 + respectively to let the driver know which packet/buffer was completed. 146 + 147 + Transmit 148 + ~~~~~~~~ 149 + A packet's buffers are DMA mapped for the device to access before transmission. 150 + After the packet was successfully transmitted, the buffers are unmapped. 151 + 152 + Receive 153 + ~~~~~~~ 154 + The driver posts fixed sized buffers to HW on the RX buffer queue. The packet 155 + received on the associated RX queue may span multiple descriptors.