diff options
Diffstat (limited to 'sys/dev/mana/mana.h')
-rw-r--r-- | sys/dev/mana/mana.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/sys/dev/mana/mana.h b/sys/dev/mana/mana.h index 906b28eb56b6..a037eb3f05c7 100644 --- a/sys/dev/mana/mana.h +++ b/sys/dev/mana/mana.h @@ -106,9 +106,23 @@ enum TRI_STATE { #define DEFAULT_FRAME_SIZE (ADAPTER_MTU_SIZE + 14) #define MAX_FRAME_SIZE 4096 -#define RX_BUFFERS_PER_QUEUE 512 - -#define MAX_SEND_BUFFERS_PER_QUEUE 256 +/* Unit number of RX buffers. Must be power of two + * Higher number could fail at allocation. + */ +#define MAX_RX_BUFFERS_PER_QUEUE 8192 +#define DEF_RX_BUFFERS_PER_QUEUE 1024 +#define MIN_RX_BUFFERS_PER_QUEUE 128 + +/* Unit number of TX buffers. Must be power of two + * Higher number could fail at allocation. + * The max value is derived as the maximum + * allocatable pages supported on host per guest + * through testing. TX buffer size beyond this + * value is rejected by the hardware. + */ +#define MAX_SEND_BUFFERS_PER_QUEUE 16384 +#define DEF_SEND_BUFFERS_PER_QUEUE 1024 +#define MIN_SEND_BUFFERS_PER_QUEUE 128 #define EQ_SIZE (8 * PAGE_SIZE) #define LOG2_EQ_THROTTLE 3 @@ -135,6 +149,7 @@ struct mana_stats { counter_u64_t collapse_err; /* tx */ counter_u64_t dma_mapping_err; /* rx, tx */ counter_u64_t mbuf_alloc_fail; /* rx */ + counter_u64_t partial_refill; /* rx */ counter_u64_t alt_chg; /* tx */ counter_u64_t alt_reset; /* tx */ counter_u64_t cqe_err; /* tx */ @@ -427,6 +442,8 @@ struct mana_rxq { uint32_t num_rx_buf; uint32_t buf_index; + uint32_t next_to_refill; + uint32_t refill_thresh; uint64_t lro_tried; uint64_t lro_failed; @@ -507,6 +524,9 @@ struct mana_port_context { unsigned int max_queues; unsigned int num_queues; + unsigned int tx_queue_size; + unsigned int rx_queue_size; + mana_handle_t port_handle; int vport_use_count; @@ -694,6 +714,13 @@ struct mana_cfg_rx_steer_resp { #define MANA_SHORT_VPORT_OFFSET_MAX ((1U << 8) - 1) +#define MANA_IDX_NEXT(idx, size) (((idx) + 1) & ((size) - 1)) +#define MANA_GET_SPACE(start_idx, end_idx, size) \ + (((end_idx) >= (start_idx)) ? \ + ((end_idx) - (start_idx)) : ((size) - (start_idx) + (end_idx))) + +#define MANA_RX_REFILL_THRESH 256 + struct mana_tx_package { struct gdma_wqe_request wqe_req; struct gdma_sge sgl_array[MAX_MBUF_FRAGS]; |