Lines Matching refs:cmq

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()
132 hclge_cmd_config_regs(&hw->cmq.crq); in hclge_cmd_init_regs()
138 struct hclge_cmq_ring *csq = &hw->cmq.csq; in hclge_cmd_csq_clean()
164 return head == hw->cmq.csq.next_to_use; in hclge_cmd_csq_done()
207 desc_to_use = &hw->cmq.csq.desc[hw->cmq.csq.next_to_use]; in hclge_cmd_copy_desc()
209 (hw->cmq.csq.next_to_use)++; in hclge_cmd_copy_desc()
210 if (hw->cmq.csq.next_to_use >= hw->cmq.csq.desc_num) in hclge_cmd_copy_desc()
211 hw->cmq.csq.next_to_use = 0; in hclge_cmd_copy_desc()
250 desc[handle] = hw->cmq.csq.desc[ntc]; in hclge_cmd_check_retval()
252 if (ntc >= hw->cmq.csq.desc_num) in hclge_cmd_check_retval()
260 hw->cmq.last_status = desc_ret; in hclge_cmd_check_retval()
285 } while (timeout < hw->cmq.tx_timeout); in hclge_cmd_check_result()
315 struct hclge_cmq_ring *csq = &hw->cmq.csq; in hclge_cmd_send()
319 spin_lock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
322 spin_unlock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
326 if (num > hclge_ring_space(&hw->cmq.csq)) { in hclge_cmd_send()
331 spin_unlock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
339 ntc = hw->cmq.csq.next_to_use; in hclge_cmd_send()
344 hclge_write_dev(hw, HCLGE_NIC_CSQ_TAIL_REG, hw->cmq.csq.next_to_use); in hclge_cmd_send()
348 spin_unlock_bh(&hw->cmq.csq.lock); in hclge_cmd_send()
439 spin_lock_init(&hdev->hw.cmq.csq.lock); in hclge_cmd_queue_init()
440 spin_lock_init(&hdev->hw.cmq.crq.lock); in hclge_cmd_queue_init()
443 hdev->hw.cmq.csq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; in hclge_cmd_queue_init()
444 hdev->hw.cmq.crq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; in hclge_cmd_queue_init()
447 hdev->hw.cmq.tx_timeout = HCLGE_CMDQ_TX_TIMEOUT; in hclge_cmd_queue_init()
466 hclge_free_cmd_desc(&hdev->hw.cmq.csq); in hclge_cmd_queue_init()
498 spin_lock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_init()
499 spin_lock(&hdev->hw.cmq.crq.lock); in hclge_cmd_init()
501 hdev->hw.cmq.csq.next_to_clean = 0; in hclge_cmd_init()
502 hdev->hw.cmq.csq.next_to_use = 0; in hclge_cmd_init()
503 hdev->hw.cmq.crq.next_to_clean = 0; in hclge_cmd_init()
504 hdev->hw.cmq.crq.next_to_use = 0; in hclge_cmd_init()
508 spin_unlock(&hdev->hw.cmq.crq.lock); in hclge_cmd_init()
509 spin_unlock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_init()
583 spin_lock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_uninit()
584 spin_lock(&hdev->hw.cmq.crq.lock); in hclge_cmd_uninit()
586 spin_unlock(&hdev->hw.cmq.crq.lock); in hclge_cmd_uninit()
587 spin_unlock_bh(&hdev->hw.cmq.csq.lock); in hclge_cmd_uninit()
589 hclge_free_cmd_desc(&hdev->hw.cmq.csq); in hclge_cmd_uninit()
590 hclge_free_cmd_desc(&hdev->hw.cmq.crq); in hclge_cmd_uninit()