Lines Matching refs:csq

63 		(ring_type == HCLGE_TYPE_CSQ) ? &hw->cmq.csq : &hw->cmq.crq;  in hclge_alloc_cmd_queue()
131 hclge_cmd_config_regs(&hw->cmq.csq); in hclge_cmd_init_regs()
138 struct hclge_cmq_ring *csq = &hw->cmq.csq; in hclge_cmd_csq_clean() local
145 if (!is_valid_csq_clean_head(csq, head)) { in hclge_cmd_csq_clean()
147 csq->next_to_use, csq->next_to_clean); in hclge_cmd_csq_clean()
156 clean = (head - csq->next_to_clean + csq->desc_num) % csq->desc_num; in hclge_cmd_csq_clean()
157 csq->next_to_clean = head; in hclge_cmd_csq_clean()
164 return head == hw->cmq.csq.next_to_use; in hclge_cmd_csq_done()
232 desc[handle] = hw->cmq.csq.desc[ntc]; in hclge_cmd_check_retval()
234 if (ntc >= hw->cmq.csq.desc_num) in hclge_cmd_check_retval()
259 struct hclge_cmq_ring *csq = &hw->cmq.csq; in hclge_cmd_send() local
267 spin_lock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
270 spin_unlock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
274 if (num > hclge_ring_space(&hw->cmq.csq)) { in hclge_cmd_send()
278 csq->next_to_clean = hclge_read_dev(hw, HCLGE_NIC_CSQ_HEAD_REG); in hclge_cmd_send()
279 spin_unlock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
287 ntc = hw->cmq.csq.next_to_use; in hclge_cmd_send()
289 desc_to_use = &hw->cmq.csq.desc[hw->cmq.csq.next_to_use]; in hclge_cmd_send()
291 (hw->cmq.csq.next_to_use)++; in hclge_cmd_send()
292 if (hw->cmq.csq.next_to_use >= hw->cmq.csq.desc_num) in hclge_cmd_send()
293 hw->cmq.csq.next_to_use = 0; in hclge_cmd_send()
298 hclge_write_dev(hw, HCLGE_NIC_CSQ_TAIL_REG, hw->cmq.csq.next_to_use); in hclge_cmd_send()
328 spin_unlock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
394 spin_lock_init(&hdev->hw.cmq.csq.lock); in hclge_cmd_queue_init()
398 hdev->hw.cmq.csq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; in hclge_cmd_queue_init()
421 hclge_free_cmd_desc(&hdev->hw.cmq.csq); in hclge_cmd_queue_init()
446 spin_lock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_init()
449 hdev->hw.cmq.csq.next_to_clean = 0; in hclge_cmd_init()
450 hdev->hw.cmq.csq.next_to_use = 0; in hclge_cmd_init()
457 spin_unlock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_init()
524 spin_lock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_uninit()
529 spin_unlock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_uninit()
531 hclge_free_cmd_desc(&hdev->hw.cmq.csq); in hclge_cmd_uninit()