Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/vnic/nicvf_queues.c
Show First 20 Lines • Show All 1,708 Lines • ▼ Show 20 Lines | nicvf_sq_disable(struct nicvf *nic, int qidx) | ||||
sq_cfg = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_CFG, qidx); | sq_cfg = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_CFG, qidx); | ||||
sq_cfg &= ~NICVF_SQ_EN; | sq_cfg &= ~NICVF_SQ_EN; | ||||
nicvf_queue_reg_write(nic, NIC_QSET_SQ_0_7_CFG, qidx, sq_cfg); | nicvf_queue_reg_write(nic, NIC_QSET_SQ_0_7_CFG, qidx, sq_cfg); | ||||
} | } | ||||
static void | static void | ||||
nicvf_sq_free_used_descs(struct nicvf *nic, struct snd_queue *sq, int qidx) | nicvf_sq_free_used_descs(struct nicvf *nic, struct snd_queue *sq, int qidx) | ||||
{ | { | ||||
uint64_t head, tail; | uint64_t head; | ||||
struct snd_buff *snd_buff; | struct snd_buff *snd_buff; | ||||
struct sq_hdr_subdesc *hdr; | struct sq_hdr_subdesc *hdr; | ||||
NICVF_TX_LOCK(sq); | NICVF_TX_LOCK(sq); | ||||
head = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_HEAD, qidx) >> 4; | head = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_HEAD, qidx) >> 4; | ||||
tail = nicvf_queue_reg_read(nic, NIC_QSET_SQ_0_7_TAIL, qidx) >> 4; | |||||
while (sq->head != head) { | while (sq->head != head) { | ||||
hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, sq->head); | hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, sq->head); | ||||
if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) { | if (hdr->subdesc_type != SQ_DESC_TYPE_HEADER) { | ||||
nicvf_put_sq_desc(sq, 1); | nicvf_put_sq_desc(sq, 1); | ||||
continue; | continue; | ||||
} | } | ||||
snd_buff = &sq->snd_buff[sq->head]; | snd_buff = &sq->snd_buff[sq->head]; | ||||
if (snd_buff->mbuf != NULL) { | if (snd_buff->mbuf != NULL) { | ||||
▲ Show 20 Lines • Show All 636 Lines • Show Last 20 Lines |