Lines Matching refs:iwdev

225 	struct irdma_device *iwdev = rf->iwdev;  in irdma_process_aeq()  local
240 ibdev_dbg(&iwdev->ibdev, in irdma_process_aeq()
252 atomic_dec(&iwdev->vsi.qp_suspend_reqs); in irdma_process_aeq()
253 wake_up(&iwdev->suspend_wq); in irdma_process_aeq()
256 ibdev_dbg(&iwdev->ibdev, "AEQ: qp_id %d is already freed\n", in irdma_process_aeq()
323 if (iwqp->iwdev->vsi.tc_change_pending) { in irdma_process_aeq()
325 wake_up(&iwqp->iwdev->suspend_wq); in irdma_process_aeq()
329 wake_up(&iwqp->iwdev->suspend_wq); in irdma_process_aeq()
339 ibdev_err(&iwdev->ibdev, in irdma_process_aeq()
394 ibdev_err(&iwdev->ibdev, "abnormal ae_id = 0x%x bool qp=%d qp_id = %d, ae_src=%d\n", in irdma_process_aeq()
396 if (rdma_protocol_roce(&iwdev->ibdev, 1)) { in irdma_process_aeq()
1088 static int irdma_alloc_set_mac(struct irdma_device *iwdev) in irdma_alloc_set_mac() argument
1092 status = irdma_alloc_local_mac_entry(iwdev->rf, in irdma_alloc_set_mac()
1093 &iwdev->mac_ip_table_idx); in irdma_alloc_set_mac()
1095 status = irdma_add_local_mac_entry(iwdev->rf, in irdma_alloc_set_mac()
1096 (const u8 *)iwdev->netdev->dev_addr, in irdma_alloc_set_mac()
1097 (u8)iwdev->mac_ip_table_idx); in irdma_alloc_set_mac()
1099 irdma_del_local_mac_entry(iwdev->rf, in irdma_alloc_set_mac()
1100 (u8)iwdev->mac_ip_table_idx); in irdma_alloc_set_mac()
1140 ibdev_dbg(&rf->iwdev->ibdev, "ERR: ceq irq config fail\n"); in irdma_cfg_ceq_vector()
1170 ibdev_dbg(&rf->iwdev->ibdev, "ERR: aeq irq config fail\n"); in irdma_cfg_aeq_vector()
1259 ibdev_dbg(&rf->iwdev->ibdev, "ERR: create ceq status = %d\n", in irdma_setup_ceq_0()
1313 ibdev_dbg(&rf->iwdev->ibdev, in irdma_setup_ceqs()
1473 static int irdma_initialize_ilq(struct irdma_device *iwdev) in irdma_initialize_ilq() argument
1484 info.sq_size = min(iwdev->rf->max_qp / 2, (u32)32768); in irdma_initialize_ilq()
1490 status = irdma_puda_create_rsrc(&iwdev->vsi, &info); in irdma_initialize_ilq()
1492 ibdev_dbg(&iwdev->ibdev, "ERR: ilq create fail\n"); in irdma_initialize_ilq()
1503 static int irdma_initialize_ieq(struct irdma_device *iwdev) in irdma_initialize_ieq() argument
1510 info.qp_id = iwdev->vsi.exception_lan_q; in irdma_initialize_ieq()
1514 info.sq_size = min(iwdev->rf->max_qp / 2, (u32)32768); in irdma_initialize_ieq()
1516 info.buf_size = iwdev->vsi.mtu + IRDMA_IPV4_PAD; in irdma_initialize_ieq()
1518 status = irdma_puda_create_rsrc(&iwdev->vsi, &info); in irdma_initialize_ieq()
1520 ibdev_dbg(&iwdev->ibdev, "ERR: ieq create fail\n"); in irdma_initialize_ieq()
1531 struct irdma_device *iwdev = vsi->back_vsi; in irdma_reinitialize_ieq() local
1532 struct irdma_pci_f *rf = iwdev->rf; in irdma_reinitialize_ieq()
1535 if (irdma_initialize_ieq(iwdev)) { in irdma_reinitialize_ieq()
1536 iwdev->rf->reset = true; in irdma_reinitialize_ieq()
1660 void irdma_rt_deinit_hw(struct irdma_device *iwdev) in irdma_rt_deinit_hw() argument
1662 ibdev_dbg(&iwdev->ibdev, "INIT: state = %d\n", iwdev->init_state); in irdma_rt_deinit_hw()
1664 switch (iwdev->init_state) { in irdma_rt_deinit_hw()
1666 if (iwdev->rf->sc_dev.hw_attrs.uk_attrs.hw_rev == IRDMA_GEN_1) in irdma_rt_deinit_hw()
1667 irdma_del_local_mac_entry(iwdev->rf, in irdma_rt_deinit_hw()
1668 (u8)iwdev->mac_ip_table_idx); in irdma_rt_deinit_hw()
1674 if (!iwdev->roce_mode) in irdma_rt_deinit_hw()
1675 irdma_puda_dele_rsrc(&iwdev->vsi, IRDMA_PUDA_RSRC_TYPE_IEQ, in irdma_rt_deinit_hw()
1676 iwdev->rf->reset); in irdma_rt_deinit_hw()
1679 if (!iwdev->roce_mode) in irdma_rt_deinit_hw()
1680 irdma_puda_dele_rsrc(&iwdev->vsi, in irdma_rt_deinit_hw()
1682 iwdev->rf->reset); in irdma_rt_deinit_hw()
1685 ibdev_warn(&iwdev->ibdev, "bad init_state = %d\n", iwdev->init_state); in irdma_rt_deinit_hw()
1689 irdma_cleanup_cm_core(&iwdev->cm_core); in irdma_rt_deinit_hw()
1690 if (iwdev->vsi.pestat) { in irdma_rt_deinit_hw()
1691 irdma_vsi_stats_free(&iwdev->vsi); in irdma_rt_deinit_hw()
1692 kfree(iwdev->vsi.pestat); in irdma_rt_deinit_hw()
1694 if (iwdev->cleanup_wq) in irdma_rt_deinit_hw()
1695 destroy_workqueue(iwdev->cleanup_wq); in irdma_rt_deinit_hw()
1738 static void irdma_get_used_rsrc(struct irdma_device *iwdev) in irdma_get_used_rsrc() argument
1740 iwdev->rf->used_pds = find_first_zero_bit(iwdev->rf->allocated_pds, in irdma_get_used_rsrc()
1741 iwdev->rf->max_pd); in irdma_get_used_rsrc()
1742 iwdev->rf->used_qps = find_first_zero_bit(iwdev->rf->allocated_qps, in irdma_get_used_rsrc()
1743 iwdev->rf->max_qp); in irdma_get_used_rsrc()
1744 iwdev->rf->used_cqs = find_first_zero_bit(iwdev->rf->allocated_cqs, in irdma_get_used_rsrc()
1745 iwdev->rf->max_cq); in irdma_get_used_rsrc()
1746 iwdev->rf->used_mrs = find_first_zero_bit(iwdev->rf->allocated_mrs, in irdma_get_used_rsrc()
1747 iwdev->rf->max_mr); in irdma_get_used_rsrc()
1781 ibdev_warn(&rf->iwdev->ibdev, "bad init_state = %d\n", rf->init_state); in irdma_ctrl_deinit_hw()
1794 int irdma_rt_init_hw(struct irdma_device *iwdev, in irdma_rt_init_hw() argument
1797 struct irdma_pci_f *rf = iwdev->rf; in irdma_rt_init_hw()
1804 vsi_info.back_vsi = iwdev; in irdma_rt_init_hw()
1806 vsi_info.pf_data_vsi_num = iwdev->vsi_num; in irdma_rt_init_hw()
1810 irdma_sc_vsi_init(&iwdev->vsi, &vsi_info); in irdma_rt_init_hw()
1812 status = irdma_setup_cm_core(iwdev, rf->rdma_ver); in irdma_rt_init_hw()
1818 irdma_cleanup_cm_core(&iwdev->cm_core); in irdma_rt_init_hw()
1822 status = irdma_vsi_stats_init(&iwdev->vsi, &stats_info); in irdma_rt_init_hw()
1824 irdma_cleanup_cm_core(&iwdev->cm_core); in irdma_rt_init_hw()
1830 if (!iwdev->roce_mode) { in irdma_rt_init_hw()
1831 status = irdma_initialize_ilq(iwdev); in irdma_rt_init_hw()
1834 iwdev->init_state = ILQ_CREATED; in irdma_rt_init_hw()
1835 status = irdma_initialize_ieq(iwdev); in irdma_rt_init_hw()
1838 iwdev->init_state = IEQ_CREATED; in irdma_rt_init_hw()
1841 status = irdma_setup_ceqs(rf, &iwdev->vsi); in irdma_rt_init_hw()
1845 iwdev->init_state = CEQS_CREATED; in irdma_rt_init_hw()
1854 iwdev->init_state = PBLE_CHUNK_MEM; in irdma_rt_init_hw()
1862 iwdev->init_state = AEQ_CREATED; in irdma_rt_init_hw()
1866 if (iwdev->rf->sc_dev.hw_attrs.uk_attrs.hw_rev == IRDMA_GEN_1) in irdma_rt_init_hw()
1867 irdma_alloc_set_mac(iwdev); in irdma_rt_init_hw()
1868 irdma_add_ip(iwdev); in irdma_rt_init_hw()
1869 iwdev->init_state = IP_ADDR_REGISTERED; in irdma_rt_init_hw()
1874 iwdev->cleanup_wq = alloc_workqueue("irdma-cleanup-wq", in irdma_rt_init_hw()
1876 if (!iwdev->cleanup_wq) in irdma_rt_init_hw()
1878 irdma_get_used_rsrc(iwdev); in irdma_rt_init_hw()
1879 init_waitqueue_head(&iwdev->suspend_wq); in irdma_rt_init_hw()
1885 status, iwdev->init_state); in irdma_rt_init_hw()
1886 irdma_rt_deinit_hw(iwdev); in irdma_rt_init_hw()
2097 ibdev_err(&rf->iwdev->ibdev, "cqp opcode = 0x%x maj_err_code = 0x%x min_err_code = 0x%x\n", in irdma_cqp_ce_handler()
2186 irdma_hw_modify_qp(iwqp->iwdev, iwqp, &info, 0); in irdma_next_iw_state()
2293 static int irdma_cqp_manage_apbvt_cmd(struct irdma_device *iwdev, in irdma_cqp_manage_apbvt_cmd() argument
2301 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, add_port); in irdma_cqp_manage_apbvt_cmd()
2312 cqp_info->in.u.manage_apbvt_entry.cqp = &iwdev->rf->cqp.sc_cqp; in irdma_cqp_manage_apbvt_cmd()
2314 ibdev_dbg(&iwdev->ibdev, "DEV: %s: port=0x%04x\n", in irdma_cqp_manage_apbvt_cmd()
2317 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_cqp_manage_apbvt_cmd()
2318 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_cqp_manage_apbvt_cmd()
2328 struct irdma_apbvt_entry *irdma_add_apbvt(struct irdma_device *iwdev, u16 port) in irdma_add_apbvt() argument
2330 struct irdma_cm_core *cm_core = &iwdev->cm_core; in irdma_add_apbvt()
2352 if (irdma_cqp_manage_apbvt_cmd(iwdev, port, true)) { in irdma_add_apbvt()
2365 void irdma_del_apbvt(struct irdma_device *iwdev, in irdma_del_apbvt() argument
2368 struct irdma_cm_core *cm_core = &iwdev->cm_core; in irdma_del_apbvt()
2382 irdma_cqp_manage_apbvt_cmd(iwdev, entry->port, false); in irdma_del_apbvt()
2457 int irdma_manage_qhash(struct irdma_device *iwdev, struct irdma_cm_info *cminfo, in irdma_manage_qhash() argument
2463 struct irdma_cqp *iwcqp = &iwdev->rf->cqp; in irdma_manage_qhash()
2476 info->vsi = &iwdev->vsi; in irdma_manage_qhash()
2487 ether_addr_copy(info->mac_addr, iwdev->netdev->dev_addr); in irdma_manage_qhash()
2512 ibdev_dbg(&iwdev->ibdev, in irdma_manage_qhash()
2520 ibdev_dbg(&iwdev->ibdev, in irdma_manage_qhash()
2528 cqp_info->in.u.manage_qhash_table_entry.cqp = &iwdev->rf->cqp.sc_cqp; in irdma_manage_qhash()
2532 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_manage_qhash()
2570 ibdev_err(&iwqp->iwdev->ibdev, "Flush QP[%d] failed, SQ has more work", in irdma_hw_flush_wqes_callback()
2659 ibdev_err(&iwqp->iwdev->ibdev, "fatal QP event: SQ in error but not flushed, qp: %d", in irdma_hw_flush_wqes()
2675 ibdev_dbg(&rf->iwdev->ibdev, in irdma_hw_flush_wqes()
2720 struct irdma_pci_f *rf = iwqp->iwdev->rf; in irdma_flush_wqes()
2750 queue_delayed_work(iwqp->iwdev->cleanup_wq, in irdma_flush_wqes()