Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/ixl_pf_qmgr.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
#define IXL_MAX_SCATTERED_QUEUES 16 | #define IXL_MAX_SCATTERED_QUEUES 16 | ||||
#define IXL_MAX_CONTIGUOUS_QUEUES_XL710 64 | #define IXL_MAX_CONTIGUOUS_QUEUES_XL710 64 | ||||
#define IXL_MAX_CONTIGUOUS_QUEUES_X722 128 | #define IXL_MAX_CONTIGUOUS_QUEUES_X722 128 | ||||
/* Structures */ | /* Structures */ | ||||
/* Manager */ | /* Manager */ | ||||
struct ixl_pf_qmgr_qinfo { | struct ixl_pf_qmgr_qinfo { | ||||
bool allocated; | u8 allocated; | ||||
bool tx_enabled; | u8 tx_enabled; | ||||
bool rx_enabled; | u8 rx_enabled; | ||||
bool tx_configured; | u8 tx_configured; | ||||
bool rx_configured; | u8 rx_configured; | ||||
}; | }; | ||||
struct ixl_pf_qmgr { | struct ixl_pf_qmgr { | ||||
u16 num_queues; | u16 num_queues; | ||||
struct ixl_pf_qmgr_qinfo *qinfo; | struct ixl_pf_qmgr_qinfo *qinfo; | ||||
}; | }; | ||||
/* Tag */ | /* Tag */ | ||||
enum ixl_pf_qmgr_qalloc_type { | enum ixl_pf_qmgr_qalloc_type { | ||||
IXL_PF_QALLOC_CONTIGUOUS, | IXL_PF_QALLOC_CONTIGUOUS, | ||||
IXL_PF_QALLOC_SCATTERED | IXL_PF_QALLOC_SCATTERED | ||||
}; | }; | ||||
struct ixl_pf_qtag { | struct ixl_pf_qtag { | ||||
struct ixl_pf_qmgr *qmgr; | struct ixl_pf_qmgr *qmgr; | ||||
enum ixl_pf_qmgr_qalloc_type type; | enum ixl_pf_qmgr_qalloc_type type; | ||||
union { | |||||
u16 qidx[IXL_MAX_SCATTERED_QUEUES]; | u16 qidx[IXL_MAX_SCATTERED_QUEUES]; | ||||
u16 first_qidx; | |||||
}; | |||||
u16 num_allocated; | u16 num_allocated; | ||||
u16 num_active; | u16 num_active; | ||||
}; | }; | ||||
/* Public manager functions */ | /* Public manager functions */ | ||||
int ixl_pf_qmgr_init(struct ixl_pf_qmgr *qmgr, u16 num_queues); | int ixl_pf_qmgr_init(struct ixl_pf_qmgr *qmgr, u16 num_queues); | ||||
void ixl_pf_qmgr_destroy(struct ixl_pf_qmgr *qmgr); | void ixl_pf_qmgr_destroy(struct ixl_pf_qmgr *qmgr); | ||||
Show All 10 Lines | |||||
/* Help manage queues used in VFs */ | /* Help manage queues used in VFs */ | ||||
/* Typically hardware refers to RX as 0 and TX as 1, so continue that convention here */ | /* Typically hardware refers to RX as 0 and TX as 1, so continue that convention here */ | ||||
void ixl_pf_qmgr_mark_queue_enabled(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | void ixl_pf_qmgr_mark_queue_enabled(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | ||||
void ixl_pf_qmgr_mark_queue_disabled(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | void ixl_pf_qmgr_mark_queue_disabled(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | ||||
void ixl_pf_qmgr_mark_queue_configured(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | void ixl_pf_qmgr_mark_queue_configured(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | ||||
bool ixl_pf_qmgr_is_queue_enabled(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | bool ixl_pf_qmgr_is_queue_enabled(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | ||||
bool ixl_pf_qmgr_is_queue_configured(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | bool ixl_pf_qmgr_is_queue_configured(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx); | ||||
void ixl_pf_qmgr_clear_queue_flags(struct ixl_pf_qtag *qtag); | |||||
/* Public tag functions */ | /* Public tag functions */ | ||||
u16 ixl_pf_qidx_from_vsi_qidx(struct ixl_pf_qtag *qtag, u16 index); | u16 ixl_pf_qidx_from_vsi_qidx(struct ixl_pf_qtag *qtag, u16 index); | ||||
#endif /* _IXL_PF_QMGR_H_ */ | #endif /* _IXL_PF_QMGR_H_ */ | ||||