Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/gve/gve.h
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
| /* | /* | ||||
| * Number of descriptors per queue page list. | * Number of descriptors per queue page list. | ||||
| * Page count AKA QPL size can be derived by dividing the number of elements in | * Page count AKA QPL size can be derived by dividing the number of elements in | ||||
| * a page by the number of descriptors available. | * a page by the number of descriptors available. | ||||
| */ | */ | ||||
| #define GVE_QPL_DIVISOR 16 | #define GVE_QPL_DIVISOR 16 | ||||
| /* Ring Size Limits */ | |||||
| #define GVE_DEFAULT_MIN_RX_RING_SIZE 512 | |||||
| #define GVE_DEFAULT_MIN_TX_RING_SIZE 256 | |||||
| static MALLOC_DEFINE(M_GVE, "gve", "gve allocations"); | static MALLOC_DEFINE(M_GVE, "gve", "gve allocations"); | ||||
| struct gve_dma_handle { | struct gve_dma_handle { | ||||
| bus_addr_t bus_addr; | bus_addr_t bus_addr; | ||||
| void *cpu_addr; | void *cpu_addr; | ||||
| bus_dma_tag_t tag; | bus_dma_tag_t tag; | ||||
| bus_dmamap_t map; | bus_dmamap_t map; | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 450 Lines • ▼ Show 20 Lines | struct gve_priv { | ||||
| struct resource *msix_table; | struct resource *msix_table; | ||||
| uint32_t mgmt_msix_idx; | uint32_t mgmt_msix_idx; | ||||
| uint32_t rx_copybreak; | uint32_t rx_copybreak; | ||||
| uint16_t num_event_counters; | uint16_t num_event_counters; | ||||
| uint16_t default_num_queues; | uint16_t default_num_queues; | ||||
| uint16_t tx_desc_cnt; | uint16_t tx_desc_cnt; | ||||
| uint16_t max_tx_desc_cnt; | |||||
| uint16_t min_tx_desc_cnt; | |||||
| uint16_t rx_desc_cnt; | uint16_t rx_desc_cnt; | ||||
| uint16_t max_rx_desc_cnt; | |||||
| uint16_t min_rx_desc_cnt; | |||||
| uint16_t rx_pages_per_qpl; | uint16_t rx_pages_per_qpl; | ||||
| uint64_t max_registered_pages; | uint64_t max_registered_pages; | ||||
| uint64_t num_registered_pages; | uint64_t num_registered_pages; | ||||
| uint32_t supported_features; | uint32_t supported_features; | ||||
| uint16_t max_mtu; | uint16_t max_mtu; | ||||
| bool modify_ringsize_enabled; | |||||
| struct gve_dma_handle counter_array_mem; | struct gve_dma_handle counter_array_mem; | ||||
| __be32 *counters; | __be32 *counters; | ||||
| struct gve_dma_handle irqs_db_mem; | struct gve_dma_handle irqs_db_mem; | ||||
| struct gve_irq_db *irq_db_indices; | struct gve_irq_db *irq_db_indices; | ||||
| enum gve_queue_format queue_format; | enum gve_queue_format queue_format; | ||||
| struct gve_queue_config tx_cfg; | struct gve_queue_config tx_cfg; | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | gve_is_qpl(struct gve_priv *priv) | ||||
| return (priv->queue_format == GVE_GQI_QPL_FORMAT || | return (priv->queue_format == GVE_GQI_QPL_FORMAT || | ||||
| priv->queue_format == GVE_DQO_QPL_FORMAT); | priv->queue_format == GVE_DQO_QPL_FORMAT); | ||||
| } | } | ||||
| /* Defined in gve_main.c */ | /* Defined in gve_main.c */ | ||||
| void gve_schedule_reset(struct gve_priv *priv); | void gve_schedule_reset(struct gve_priv *priv); | ||||
| int gve_adjust_tx_queues(struct gve_priv *priv, uint16_t new_queue_cnt); | int gve_adjust_tx_queues(struct gve_priv *priv, uint16_t new_queue_cnt); | ||||
| int gve_adjust_rx_queues(struct gve_priv *priv, uint16_t new_queue_cnt); | int gve_adjust_rx_queues(struct gve_priv *priv, uint16_t new_queue_cnt); | ||||
| int gve_adjust_ring_sizes(struct gve_priv *priv, uint16_t new_desc_cnt, bool is_rx); | |||||
| /* Register access functions defined in gve_utils.c */ | /* Register access functions defined in gve_utils.c */ | ||||
| uint32_t gve_reg_bar_read_4(struct gve_priv *priv, bus_size_t offset); | uint32_t gve_reg_bar_read_4(struct gve_priv *priv, bus_size_t offset); | ||||
| void gve_reg_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); | void gve_reg_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); | ||||
| void gve_db_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); | void gve_db_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); | ||||
| void gve_db_bar_dqo_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); | void gve_db_bar_dqo_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); | ||||
| /* QPL (Queue Page List) functions defined in gve_qpl.c */ | /* QPL (Queue Page List) functions defined in gve_qpl.c */ | ||||
| ▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines | |||||