Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ixl/ixl_pf_qmgr.c
Show All 39 Lines | |||||
int | int | ||||
ixl_pf_qmgr_init(struct ixl_pf_qmgr *qmgr, u16 num_queues) | ixl_pf_qmgr_init(struct ixl_pf_qmgr *qmgr, u16 num_queues) | ||||
{ | { | ||||
if (num_queues < 1) | if (num_queues < 1) | ||||
return (EINVAL); | return (EINVAL); | ||||
qmgr->num_queues = num_queues; | qmgr->num_queues = num_queues; | ||||
qmgr->qinfo = malloc(num_queues * sizeof(struct ixl_pf_qmgr_qinfo), | qmgr->qinfo = malloc(num_queues * sizeof(struct ixl_pf_qmgr_qinfo), | ||||
M_IXL, M_ZERO | M_WAITOK); | M_IXL, M_ZERO | M_NOWAIT); | ||||
if (qmgr->qinfo == NULL) | if (qmgr->qinfo == NULL) | ||||
return ENOMEM; | return ENOMEM; | ||||
return (0); | return (0); | ||||
} | } | ||||
int | int | ||||
ixl_pf_qmgr_alloc_contiguous(struct ixl_pf_qmgr *qmgr, u16 num, struct ixl_pf_qtag *qtag) | ixl_pf_qmgr_alloc_contiguous(struct ixl_pf_qmgr *qmgr, u16 num, struct ixl_pf_qtag *qtag) | ||||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | ixl_pf_qmgr_is_queue_configured(struct ixl_pf_qtag *qtag, u16 vsi_qidx, bool tx) | ||||
struct ixl_pf_qmgr *qmgr = qtag->qmgr; | struct ixl_pf_qmgr *qmgr = qtag->qmgr; | ||||
u16 pf_qidx = ixl_pf_qidx_from_vsi_qidx(qtag, vsi_qidx); | u16 pf_qidx = ixl_pf_qidx_from_vsi_qidx(qtag, vsi_qidx); | ||||
if (tx) | if (tx) | ||||
return (qmgr->qinfo[pf_qidx].tx_configured); | return (qmgr->qinfo[pf_qidx].tx_configured); | ||||
else | else | ||||
return (qmgr->qinfo[pf_qidx].rx_configured); | return (qmgr->qinfo[pf_qidx].rx_configured); | ||||
} | } | ||||
void | |||||
ixl_pf_qmgr_clear_queue_flags(struct ixl_pf_qtag *qtag) | |||||
{ | |||||
MPASS(qtag != NULL); | |||||
struct ixl_pf_qmgr *qmgr = qtag->qmgr; | |||||
for (u16 i = 0; i < qtag->num_allocated; i++) { | |||||
u16 pf_qidx = ixl_pf_qidx_from_vsi_qidx(qtag, i); | |||||
qmgr->qinfo[pf_qidx].tx_configured = 0; | |||||
qmgr->qinfo[pf_qidx].rx_configured = 0; | |||||
qmgr->qinfo[pf_qidx].rx_enabled = 0; | |||||
qmgr->qinfo[pf_qidx].tx_enabled = 0; | |||||
} | |||||
} | |||||
u16 | u16 | ||||
ixl_pf_qidx_from_vsi_qidx(struct ixl_pf_qtag *qtag, u16 index) | ixl_pf_qidx_from_vsi_qidx(struct ixl_pf_qtag *qtag, u16 index) | ||||
{ | { | ||||
MPASS(index < qtag->num_allocated); | MPASS(index < qtag->num_allocated); | ||||
if (qtag->type == IXL_PF_QALLOC_CONTIGUOUS) | if (qtag->type == IXL_PF_QALLOC_CONTIGUOUS) | ||||
return qtag->qidx[0] + index; | return qtag->first_qidx + index; | ||||
else | else | ||||
return qtag->qidx[index]; | return qtag->qidx[index]; | ||||
} | } | ||||
/* Static Functions */ | /* Static Functions */ | ||||
static int | static int | ||||
ixl_pf_qmgr_find_free_contiguous_block(struct ixl_pf_qmgr *qmgr, int num) | ixl_pf_qmgr_find_free_contiguous_block(struct ixl_pf_qmgr *qmgr, int num) | ||||
Show All 25 Lines |