mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user