Lines Matching refs:cmq
42 struct hclgevf_cmq_ring *csq = &hw->cmq.csq; in hclgevf_cmd_csq_clean()
69 return head == hw->cmq.csq.next_to_use; in hclgevf_cmd_csq_done()
120 hclgevf_cmd_config_regs(&hw->cmq.csq); in hclgevf_cmd_init_regs()
121 hclgevf_cmd_config_regs(&hw->cmq.crq); in hclgevf_cmd_init_regs()
151 (ring_type == HCLGEVF_TYPE_CSQ) ? &hw->cmq.csq : &hw->cmq.crq; in hclgevf_alloc_cmd_queue()
222 struct hclgevf_cmq_ring *csq = &hw->cmq.csq; in hclgevf_cmd_send()
232 spin_lock_bh(&hw->cmq.csq.lock); in hclgevf_cmd_send()
235 spin_unlock_bh(&hw->cmq.csq.lock); in hclgevf_cmd_send()
239 if (num > hclgevf_ring_space(&hw->cmq.csq)) { in hclgevf_cmd_send()
245 spin_unlock_bh(&hw->cmq.csq.lock); in hclgevf_cmd_send()
252 ntc = hw->cmq.csq.next_to_use; in hclgevf_cmd_send()
255 desc_to_use = &hw->cmq.csq.desc[hw->cmq.csq.next_to_use]; in hclgevf_cmd_send()
257 (hw->cmq.csq.next_to_use)++; in hclgevf_cmd_send()
258 if (hw->cmq.csq.next_to_use == hw->cmq.csq.desc_num) in hclgevf_cmd_send()
259 hw->cmq.csq.next_to_use = 0; in hclgevf_cmd_send()
265 hw->cmq.csq.next_to_use); in hclgevf_cmd_send()
276 } while (timeout < hw->cmq.tx_timeout); in hclgevf_cmd_send()
285 desc_to_use = &hw->cmq.csq.desc[ntc]; in hclgevf_cmd_send()
294 hw->cmq.last_status = (enum hclgevf_cmd_status)retval; in hclgevf_cmd_send()
297 if (ntc == hw->cmq.csq.desc_num) in hclgevf_cmd_send()
311 spin_unlock_bh(&hw->cmq.csq.lock); in hclgevf_cmd_send()
374 spin_lock_init(&hdev->hw.cmq.csq.lock); in hclgevf_cmd_queue_init()
375 spin_lock_init(&hdev->hw.cmq.crq.lock); in hclgevf_cmd_queue_init()
377 hdev->hw.cmq.tx_timeout = HCLGEVF_CMDQ_TX_TIMEOUT; in hclgevf_cmd_queue_init()
378 hdev->hw.cmq.csq.desc_num = HCLGEVF_NIC_CMQ_DESC_NUM; in hclgevf_cmd_queue_init()
379 hdev->hw.cmq.crq.desc_num = HCLGEVF_NIC_CMQ_DESC_NUM; in hclgevf_cmd_queue_init()
397 hclgevf_free_cmd_desc(&hdev->hw.cmq.csq); in hclgevf_cmd_queue_init()
405 spin_lock_bh(&hdev->hw.cmq.csq.lock); in hclgevf_cmd_init()
406 spin_lock(&hdev->hw.cmq.crq.lock); in hclgevf_cmd_init()
413 hdev->hw.cmq.csq.next_to_clean = 0; in hclgevf_cmd_init()
414 hdev->hw.cmq.csq.next_to_use = 0; in hclgevf_cmd_init()
415 hdev->hw.cmq.crq.next_to_clean = 0; in hclgevf_cmd_init()
416 hdev->hw.cmq.crq.next_to_use = 0; in hclgevf_cmd_init()
420 spin_unlock(&hdev->hw.cmq.crq.lock); in hclgevf_cmd_init()
421 spin_unlock_bh(&hdev->hw.cmq.csq.lock); in hclgevf_cmd_init()
475 spin_lock_bh(&hdev->hw.cmq.csq.lock); in hclgevf_cmd_uninit()
476 spin_lock(&hdev->hw.cmq.crq.lock); in hclgevf_cmd_uninit()
479 spin_unlock(&hdev->hw.cmq.crq.lock); in hclgevf_cmd_uninit()
480 spin_unlock_bh(&hdev->hw.cmq.csq.lock); in hclgevf_cmd_uninit()
481 hclgevf_free_cmd_desc(&hdev->hw.cmq.csq); in hclgevf_cmd_uninit()
482 hclgevf_free_cmd_desc(&hdev->hw.cmq.crq); in hclgevf_cmd_uninit()