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()
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()
242 hw->cmq.last_status = desc_ret; in hclge_cmd_check_retval()
259 struct hclge_cmq_ring *csq = &hw->cmq.csq; in hclge_cmd_send()
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()
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()
312 } while (timeout < hw->cmq.tx_timeout); 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()
395 spin_lock_init(&hdev->hw.cmq.crq.lock); in hclge_cmd_queue_init()
398 hdev->hw.cmq.csq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; in hclge_cmd_queue_init()
399 hdev->hw.cmq.crq.desc_num = HCLGE_NIC_CMQ_DESC_NUM; in hclge_cmd_queue_init()
402 hdev->hw.cmq.tx_timeout = HCLGE_CMDQ_TX_TIMEOUT; 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()
447 spin_lock(&hdev->hw.cmq.crq.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()
451 hdev->hw.cmq.crq.next_to_clean = 0; in hclge_cmd_init()
452 hdev->hw.cmq.crq.next_to_use = 0; in hclge_cmd_init()
456 spin_unlock(&hdev->hw.cmq.crq.lock); 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()
525 spin_lock(&hdev->hw.cmq.crq.lock); in hclge_cmd_uninit()
528 spin_unlock(&hdev->hw.cmq.crq.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()
532 hclge_free_cmd_desc(&hdev->hw.cmq.crq); in hclge_cmd_uninit()