[gve] Allow for out-of-order buffer consumption

We currently assume that the buffer index is equal to the descriptor
ring index, which is correct only for in-order queues.

Out-of-order queues will include a buffer tag value that is copied
from the descriptor to the completion.  Redefine the data buffers as
being indexed by this tag value (rather than by the descriptor ring
index), and add a circular ring buffer to allow for tags to be reused
in whatever order they are released by the hardware.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-09-29 12:41:06 +01:00
parent b8dd3c384b
commit 86b322d999
2 changed files with 106 additions and 71 deletions

View File

@@ -666,6 +666,8 @@ struct gve_queue {
uint32_t prod;
/** Consumer counter */
uint32_t cons;
/** Tag ring */
uint8_t *tag;
/** Queue page list */
struct gve_qpl qpl;
@@ -730,8 +732,12 @@ struct gve_nic {
struct gve_queue tx;
/** Receive queue */
struct gve_queue rx;
/** Transmit I/O buffers */
/** Transmit I/O buffers (indexed by tag) */
struct io_buffer *tx_iobuf[GVE_TX_FILL];
/** Transmit tag ring */
uint8_t tx_tag[GVE_TX_FILL];
/** Receive tag ring */
uint8_t rx_tag[GVE_RX_FILL];
/** Receive sequence number */
unsigned int seq;