Skip to content

Commit 7cea48b

Browse files
shailend-gkuba-moo
authored andcommitted
gve: Define config structs for queue allocation
Queue allocation functions currently can only allocate into priv and free memory in priv. These new structs would be passed into the queue functions in a subsequent change to make them capable of returning newly allocated resources and not just writing them into priv. They also make it possible to allocate resources for queues with a different config than that of the currently active queues. Signed-off-by: Shailend Chand <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Reviewed-by: Jeroen de Borst <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 20df28f commit 7cea48b

File tree

1 file changed

+49
-0
lines changed
  • drivers/net/ethernet/google/gve

1 file changed

+49
-0
lines changed

drivers/net/ethernet/google/gve/gve.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,55 @@ struct gve_ptype_lut {
622622
struct gve_ptype ptypes[GVE_NUM_PTYPES];
623623
};
624624

625+
/* Parameters for allocating queue page lists */
626+
struct gve_qpls_alloc_cfg {
627+
struct gve_qpl_config *qpl_cfg;
628+
struct gve_queue_config *tx_cfg;
629+
struct gve_queue_config *rx_cfg;
630+
631+
u16 num_xdp_queues;
632+
bool raw_addressing;
633+
bool is_gqi;
634+
635+
/* Allocated resources are returned here */
636+
struct gve_queue_page_list *qpls;
637+
};
638+
639+
/* Parameters for allocating resources for tx queues */
640+
struct gve_tx_alloc_rings_cfg {
641+
struct gve_queue_config *qcfg;
642+
643+
/* qpls and qpl_cfg must already be allocated */
644+
struct gve_queue_page_list *qpls;
645+
struct gve_qpl_config *qpl_cfg;
646+
647+
u16 ring_size;
648+
u16 start_idx;
649+
u16 num_rings;
650+
bool raw_addressing;
651+
652+
/* Allocated resources are returned here */
653+
struct gve_tx_ring *tx;
654+
};
655+
656+
/* Parameters for allocating resources for rx queues */
657+
struct gve_rx_alloc_rings_cfg {
658+
/* tx config is also needed to determine QPL ids */
659+
struct gve_queue_config *qcfg;
660+
struct gve_queue_config *qcfg_tx;
661+
662+
/* qpls and qpl_cfg must already be allocated */
663+
struct gve_queue_page_list *qpls;
664+
struct gve_qpl_config *qpl_cfg;
665+
666+
u16 ring_size;
667+
bool raw_addressing;
668+
bool enable_header_split;
669+
670+
/* Allocated resources are returned here */
671+
struct gve_rx_ring *rx;
672+
};
673+
625674
/* GVE_QUEUE_FORMAT_UNSPECIFIED must be zero since 0 is the default value
626675
* when the entire configure_device_resources command is zeroed out and the
627676
* queue_format is not specified.

0 commit comments

Comments
 (0)