Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/gve/gve_adminq.h
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | struct gve_device_option_dqo_rda { | ||||
__be32 supported_features_mask; | __be32 supported_features_mask; | ||||
__be16 tx_comp_ring_entries; | __be16 tx_comp_ring_entries; | ||||
__be16 rx_buff_ring_entries; | __be16 rx_buff_ring_entries; | ||||
}; | }; | ||||
_Static_assert(sizeof(struct gve_device_option_dqo_rda) == 8, | _Static_assert(sizeof(struct gve_device_option_dqo_rda) == 8, | ||||
"gve: bad admin queue struct length"); | "gve: bad admin queue struct length"); | ||||
struct gve_device_option_dqo_qpl { | |||||
__be32 supported_features_mask; | |||||
__be16 tx_comp_ring_entries; | |||||
__be16 rx_buff_ring_entries; | |||||
}; | |||||
_Static_assert(sizeof(struct gve_device_option_dqo_qpl) == 8, | |||||
"gve: bad admin queue struct length"); | |||||
struct gve_device_option_modify_ring { | struct gve_device_option_modify_ring { | ||||
__be32 supported_features_mask; | __be32 supported_features_mask; | ||||
__be16 max_rx_ring_size; | __be16 max_rx_ring_size; | ||||
__be16 max_tx_ring_size; | __be16 max_tx_ring_size; | ||||
}; | }; | ||||
_Static_assert(sizeof(struct gve_device_option_modify_ring) == 8, | _Static_assert(sizeof(struct gve_device_option_modify_ring) == 8, | ||||
"gve: bad admin queue struct length"); | "gve: bad admin queue struct length"); | ||||
struct gve_device_option_jumbo_frames { | struct gve_device_option_jumbo_frames { | ||||
__be32 supported_features_mask; | __be32 supported_features_mask; | ||||
__be16 max_mtu; | __be16 max_mtu; | ||||
uint8_t padding[2]; | uint8_t padding[2]; | ||||
}; | }; | ||||
_Static_assert(sizeof(struct gve_device_option_jumbo_frames) == 8, | _Static_assert(sizeof(struct gve_device_option_jumbo_frames) == 8, | ||||
"gve: bad admin queue struct length"); | "gve: bad admin queue struct length"); | ||||
enum gve_dev_opt_id { | enum gve_dev_opt_id { | ||||
GVE_DEV_OPT_ID_GQI_RAW_ADDRESSING = 0x1, | GVE_DEV_OPT_ID_GQI_RAW_ADDRESSING = 0x1, | ||||
GVE_DEV_OPT_ID_GQI_RDA = 0x2, | GVE_DEV_OPT_ID_GQI_RDA = 0x2, | ||||
GVE_DEV_OPT_ID_GQI_QPL = 0x3, | GVE_DEV_OPT_ID_GQI_QPL = 0x3, | ||||
GVE_DEV_OPT_ID_DQO_RDA = 0x4, | GVE_DEV_OPT_ID_DQO_RDA = 0x4, | ||||
GVE_DEV_OPT_ID_MODIFY_RING = 0x6, | GVE_DEV_OPT_ID_MODIFY_RING = 0x6, | ||||
GVE_DEV_OPT_ID_DQO_QPL = 0x7, | |||||
GVE_DEV_OPT_ID_JUMBO_FRAMES = 0x8, | GVE_DEV_OPT_ID_JUMBO_FRAMES = 0x8, | ||||
}; | }; | ||||
/* | /* | ||||
* These masks are way to predicate the use of a particular option on the driver | * These masks are way to predicate the use of a particular option on the driver | ||||
* having particular bug fixes represented by each bit position in the mask. | * having particular bug fixes represented by each bit position in the mask. | ||||
* Currently they are all zero because there are no known bugs preventing the | * Currently they are all zero because there are no known bugs preventing the | ||||
* use of any option. | * use of any option. | ||||
*/ | */ | ||||
enum gve_dev_opt_req_feat_mask { | enum gve_dev_opt_req_feat_mask { | ||||
GVE_DEV_OPT_REQ_FEAT_MASK_GQI_RAW_ADDRESSING = 0x0, | GVE_DEV_OPT_REQ_FEAT_MASK_GQI_RAW_ADDRESSING = 0x0, | ||||
GVE_DEV_OPT_REQ_FEAT_MASK_GQI_RDA = 0x0, | GVE_DEV_OPT_REQ_FEAT_MASK_GQI_RDA = 0x0, | ||||
GVE_DEV_OPT_REQ_FEAT_MASK_GQI_QPL = 0x0, | GVE_DEV_OPT_REQ_FEAT_MASK_GQI_QPL = 0x0, | ||||
GVE_DEV_OPT_REQ_FEAT_MASK_DQO_RDA = 0x0, | GVE_DEV_OPT_REQ_FEAT_MASK_DQO_RDA = 0x0, | ||||
GVE_DEV_OPT_REQ_FEAT_MASK_DQO_QPL = 0x0, | |||||
GVE_DEV_OPT_REQ_FEAT_MASK_MODIFY_RING = 0x0, | GVE_DEV_OPT_REQ_FEAT_MASK_MODIFY_RING = 0x0, | ||||
GVE_DEV_OPT_REQ_FEAT_MASK_JUMBO_FRAMES = 0x0, | GVE_DEV_OPT_REQ_FEAT_MASK_JUMBO_FRAMES = 0x0, | ||||
}; | }; | ||||
enum gve_sup_feature_mask { | enum gve_sup_feature_mask { | ||||
GVE_SUP_MODIFY_RING_MASK = 1 << 0, | GVE_SUP_MODIFY_RING_MASK = 1 << 0, | ||||
GVE_SUP_JUMBO_FRAMES_MASK = 1 << 2, | GVE_SUP_JUMBO_FRAMES_MASK = 1 << 2, | ||||
}; | }; | ||||
#define GVE_VERSION_STR_LEN 128 | #define GVE_VERSION_STR_LEN 128 | ||||
enum gve_driver_capability { | enum gve_driver_capability { | ||||
gve_driver_capability_gqi_qpl = 0, | gve_driver_capability_gqi_qpl = 0, | ||||
gve_driver_capability_gqi_rda = 1, | gve_driver_capability_gqi_rda = 1, | ||||
gve_driver_capability_dqo_qpl = 2, /* reserved for future use */ | gve_driver_capability_dqo_qpl = 2, | ||||
gve_driver_capability_dqo_rda = 3, | gve_driver_capability_dqo_rda = 3, | ||||
}; | }; | ||||
#define GVE_CAP1(a) BIT((int) a) | #define GVE_CAP1(a) BIT((int) a) | ||||
#define GVE_CAP2(a) BIT(((int) a) - 64) | #define GVE_CAP2(a) BIT(((int) a) - 64) | ||||
#define GVE_CAP3(a) BIT(((int) a) - 128) | #define GVE_CAP3(a) BIT(((int) a) - 128) | ||||
#define GVE_CAP4(a) BIT(((int) a) - 192) | #define GVE_CAP4(a) BIT(((int) a) - 192) | ||||
/* | /* | ||||
* The following four defines describe 256 compatibility bits. | * The following four defines describe 256 compatibility bits. | ||||
* Only a few bits (as shown in `gve_driver_compatibility`) are currently | * Only a few bits (as shown in `gve_driver_compatibility`) are currently | ||||
* defined. The rest are reserved for future use. | * defined. The rest are reserved for future use. | ||||
*/ | */ | ||||
#define GVE_DRIVER_CAPABILITY_FLAGS1 \ | #define GVE_DRIVER_CAPABILITY_FLAGS1 \ | ||||
(GVE_CAP1(gve_driver_capability_gqi_qpl) | \ | (GVE_CAP1(gve_driver_capability_gqi_qpl) | \ | ||||
GVE_CAP1(gve_driver_capability_dqo_qpl) | \ | |||||
GVE_CAP1(gve_driver_capability_dqo_rda)) | GVE_CAP1(gve_driver_capability_dqo_rda)) | ||||
#define GVE_DRIVER_CAPABILITY_FLAGS2 0x0 | #define GVE_DRIVER_CAPABILITY_FLAGS2 0x0 | ||||
#define GVE_DRIVER_CAPABILITY_FLAGS3 0x0 | #define GVE_DRIVER_CAPABILITY_FLAGS3 0x0 | ||||
#define GVE_DRIVER_CAPABILITY_FLAGS4 0x0 | #define GVE_DRIVER_CAPABILITY_FLAGS4 0x0 | ||||
struct gve_driver_info { | struct gve_driver_info { | ||||
uint8_t os_type; | uint8_t os_type; | ||||
uint8_t driver_major; | uint8_t driver_major; | ||||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |