Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vnic/nicvf_queues.c
Show First 20 Lines • Show All 1,705 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) { | ||||
vangyzen: One wonders if `tail` should be used in this loop. I have no idea. | |||||
Not Done Inline ActionsAgain, as of not it is a pure write-only variable that is not affecting existing code. If one needs one in the future, one is welcome to resurrect it. This patch is not about implementing missing code. kan: Again, as of not it is a pure write-only variable that is not affecting existing code. If one… | |||||
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) { | ||||
bus_dmamap_unload(sq->snd_buff_dmat, snd_buff->dmap); | bus_dmamap_unload(sq->snd_buff_dmat, snd_buff->dmap); | ||||
▲ Show 20 Lines • Show All 629 Lines • Show Last 20 Lines |
One wonders if tail should be used in this loop. I have no idea.