[gve] Set descriptor and completion ring sizes when creating queues

The "create TX queue" and "create RX queue" commands have fields for
the descriptor and completion ring sizes, which are currently left
unpopulated since they are not required for the original GQI-QPL
operating mode.

Populate these fields, and allow for the possibility that a transmit
completion ring exists (which will be the case when using the DQO
operating mode).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-09-29 12:37:25 +01:00
parent 048a346705
commit 91db5b68ff
2 changed files with 25 additions and 5 deletions

View File

@@ -639,9 +639,15 @@ static void gve_create_tx_param ( struct gve_queue *queue,
/* Construct request parameters */
create->res = cpu_to_be64 ( dma ( &queue->res_map, queue->res ) );
create->desc =
cpu_to_be64 ( dma ( &queue->desc_map, queue->desc.tx ) );
cpu_to_be64 ( dma ( &queue->desc_map, queue->desc.raw ) );
create->qpl_id = cpu_to_be32 ( type->qpl );
create->notify_id = cpu_to_be32 ( type->irq );
create->desc_count = cpu_to_be16 ( queue->count );
if ( queue->cmplt.raw ) {
create->cmplt = cpu_to_be64 ( dma ( &queue->cmplt_map,
queue->cmplt.raw ) );
create->cmplt_count = cpu_to_be16 ( queue->count );
}
}
/**
@@ -659,11 +665,13 @@ static void gve_create_rx_param ( struct gve_queue *queue,
create->notify_id = cpu_to_be32 ( type->irq );
create->res = cpu_to_be64 ( dma ( &queue->res_map, queue->res ) );
create->desc =
cpu_to_be64 ( dma ( &queue->desc_map, queue->desc.rx ) );
cpu_to_be64 ( dma ( &queue->desc_map, queue->desc.raw ) );
create->cmplt =
cpu_to_be64 ( dma ( &queue->cmplt_map, queue->cmplt.rx ) );
cpu_to_be64 ( dma ( &queue->cmplt_map, queue->cmplt.raw ) );
create->qpl_id = cpu_to_be32 ( type->qpl );
create->desc_count = cpu_to_be16 ( queue->count );
create->bufsz = cpu_to_be16 ( GVE_BUF_SIZE );
create->cmplt_count = cpu_to_be16 ( queue->count );
}
/**

View File

@@ -278,6 +278,14 @@ struct gve_admin_create_tx {
uint32_t qpl_id;
/** Notification channel ID */
uint32_t notify_id;
/** Completion ring address */
uint64_t cmplt;
/** Number of descriptor ring entries */
uint16_t desc_count;
/** Number of completion ring entries */
uint16_t cmplt_count;
/** Reserved */
uint8_t reserved_b[4];
} __attribute__ (( packed ));
/** Create receive queue command */
@@ -303,10 +311,14 @@ struct gve_admin_create_rx {
uint64_t desc;
/** Queue page list ID */
uint32_t qpl_id;
/** Reserved */
uint8_t reserved_b[2];
/** Number of descriptor ring entries */
uint16_t desc_count;
/** Packet buffer size */
uint16_t bufsz;
/** Number of completion ring entries */
uint16_t cmplt_count;
/** Reserved */
uint8_t reserved[6];
} __attribute__ (( packed ));
/** Destroy transmit queue command */