Lines Matching refs:com
109 struct res_common com; member
144 struct res_common com; member
157 struct res_common com; member
169 struct res_common com; member
180 struct res_common com; member
192 struct res_common com; member
204 struct res_common com; member
214 struct res_common com; member
224 struct res_common com; member
989 counter = container_of(r, struct res_counter, com); in handle_existing_counter()
1013 counter = container_of(tmp, struct res_counter, com); in handle_unexisting_counter()
1015 qpc->pri_path.counter_index = counter->com.res_id; in handle_unexisting_counter()
1058 ret->com.res_id = id; in alloc_qp_tr()
1059 ret->com.state = RES_QP_RESERVED; in alloc_qp_tr()
1065 return &ret->com; in alloc_qp_tr()
1076 ret->com.res_id = id; in alloc_mtt_tr()
1078 ret->com.state = RES_MTT_ALLOCATED; in alloc_mtt_tr()
1081 return &ret->com; in alloc_mtt_tr()
1092 ret->com.res_id = id; in alloc_mpt_tr()
1093 ret->com.state = RES_MPT_RESERVED; in alloc_mpt_tr()
1096 return &ret->com; in alloc_mpt_tr()
1107 ret->com.res_id = id; in alloc_eq_tr()
1108 ret->com.state = RES_EQ_RESERVED; in alloc_eq_tr()
1110 return &ret->com; in alloc_eq_tr()
1121 ret->com.res_id = id; in alloc_cq_tr()
1122 ret->com.state = RES_CQ_ALLOCATED; in alloc_cq_tr()
1125 return &ret->com; in alloc_cq_tr()
1136 ret->com.res_id = id; in alloc_srq_tr()
1137 ret->com.state = RES_SRQ_ALLOCATED; in alloc_srq_tr()
1140 return &ret->com; in alloc_srq_tr()
1151 ret->com.res_id = id; in alloc_counter_tr()
1152 ret->com.state = RES_COUNTER_ALLOCATED; in alloc_counter_tr()
1155 return &ret->com; in alloc_counter_tr()
1166 ret->com.res_id = id; in alloc_xrcdn_tr()
1167 ret->com.state = RES_XRCD_ALLOCATED; in alloc_xrcdn_tr()
1169 return &ret->com; in alloc_xrcdn_tr()
1180 ret->com.res_id = id; in alloc_fs_rule_tr()
1181 ret->com.state = RES_FS_RULE_ALLOCATED; in alloc_fs_rule_tr()
1183 return &ret->com; in alloc_fs_rule_tr()
1252 counter = container_of(tmp, struct res_counter, com); in mlx4_calc_vf_counters()
1338 if (res->com.state == RES_QP_BUSY || atomic_read(&res->ref_count) || in remove_qp_ok()
1341 res->com.state, atomic_read(&res->ref_count)); in remove_qp_ok()
1343 } else if (res->com.state != RES_QP_RESERVED) { in remove_qp_ok()
1352 if (res->com.state == RES_MTT_BUSY || in remove_mtt_ok()
1356 mtt_states_str(res->com.state), in remove_mtt_ok()
1359 } else if (res->com.state != RES_MTT_ALLOCATED) in remove_mtt_ok()
1369 if (res->com.state == RES_MPT_BUSY) in remove_mpt_ok()
1371 else if (res->com.state != RES_MPT_RESERVED) in remove_mpt_ok()
1379 if (res->com.state == RES_MPT_BUSY) in remove_eq_ok()
1381 else if (res->com.state != RES_MPT_RESERVED) in remove_eq_ok()
1389 if (res->com.state == RES_COUNTER_BUSY) in remove_counter_ok()
1391 else if (res->com.state != RES_COUNTER_ALLOCATED) in remove_counter_ok()
1399 if (res->com.state == RES_XRCD_BUSY) in remove_xrcdn_ok()
1401 else if (res->com.state != RES_XRCD_ALLOCATED) in remove_xrcdn_ok()
1409 if (res->com.state == RES_FS_RULE_BUSY) in remove_fs_rule_ok()
1411 else if (res->com.state != RES_FS_RULE_ALLOCATED) in remove_fs_rule_ok()
1419 if (res->com.state == RES_CQ_BUSY) in remove_cq_ok()
1421 else if (res->com.state != RES_CQ_ALLOCATED) in remove_cq_ok()
1429 if (res->com.state == RES_SRQ_BUSY) in remove_srq_ok()
1431 else if (res->com.state != RES_SRQ_ALLOCATED) in remove_srq_ok()
1517 else if (r->com.owner != slave) in qp_res_start_move_to()
1523 __func__, r->com.res_id); in qp_res_start_move_to()
1528 if (r->com.state == RES_QP_MAPPED && !alloc) in qp_res_start_move_to()
1531 mlx4_dbg(dev, "failed RES_QP, 0x%llx\n", r->com.res_id); in qp_res_start_move_to()
1536 if ((r->com.state == RES_QP_RESERVED && alloc) || in qp_res_start_move_to()
1537 r->com.state == RES_QP_HW) in qp_res_start_move_to()
1541 r->com.res_id); in qp_res_start_move_to()
1548 if (r->com.state != RES_QP_MAPPED) in qp_res_start_move_to()
1556 r->com.from_state = r->com.state; in qp_res_start_move_to()
1557 r->com.to_state = state; in qp_res_start_move_to()
1558 r->com.state = RES_QP_BUSY; in qp_res_start_move_to()
1581 else if (r->com.owner != slave) in mr_res_start_move_to()
1590 if (r->com.state != RES_MPT_MAPPED) in mr_res_start_move_to()
1595 if (r->com.state != RES_MPT_RESERVED && in mr_res_start_move_to()
1596 r->com.state != RES_MPT_HW) in mr_res_start_move_to()
1601 if (r->com.state != RES_MPT_MAPPED) in mr_res_start_move_to()
1609 r->com.from_state = r->com.state; in mr_res_start_move_to()
1610 r->com.to_state = state; in mr_res_start_move_to()
1611 r->com.state = RES_MPT_BUSY; in mr_res_start_move_to()
1634 else if (r->com.owner != slave) in eq_res_start_move_to()
1643 if (r->com.state != RES_EQ_HW) in eq_res_start_move_to()
1648 if (r->com.state != RES_EQ_RESERVED) in eq_res_start_move_to()
1657 r->com.from_state = r->com.state; in eq_res_start_move_to()
1658 r->com.to_state = state; in eq_res_start_move_to()
1659 r->com.state = RES_EQ_BUSY; in eq_res_start_move_to()
1683 } else if (r->com.owner != slave) { in cq_res_start_move_to()
1686 if (r->com.state != RES_CQ_HW) in cq_res_start_move_to()
1692 } else if (state != RES_CQ_HW || r->com.state != RES_CQ_ALLOCATED) { in cq_res_start_move_to()
1699 r->com.from_state = r->com.state; in cq_res_start_move_to()
1700 r->com.to_state = state; in cq_res_start_move_to()
1701 r->com.state = RES_CQ_BUSY; in cq_res_start_move_to()
1723 } else if (r->com.owner != slave) { in srq_res_start_move_to()
1726 if (r->com.state != RES_SRQ_HW) in srq_res_start_move_to()
1730 } else if (state != RES_SRQ_HW || r->com.state != RES_SRQ_ALLOCATED) { in srq_res_start_move_to()
1735 r->com.from_state = r->com.state; in srq_res_start_move_to()
1736 r->com.to_state = state; in srq_res_start_move_to()
1737 r->com.state = RES_SRQ_BUSY; in srq_res_start_move_to()
2747 int res_start = mtt->com.res_id; in check_mtt_range()
2823 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_MPT_wrapper()
2831 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_MPT_wrapper()
2886 if (mpt->com.from_state == RES_MPT_MAPPED) { in mlx4_QUERY_MPT_wrapper()
2907 } else if (mpt->com.from_state == RES_MPT_HW) { in mlx4_QUERY_MPT_wrapper()
3129 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_EQ_wrapper()
3134 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_EQ_wrapper()
3169 com.list) { in get_containing_mtt()
3172 mtt->com.from_state = mtt->com.state; in get_containing_mtt()
3173 mtt->com.state = RES_MTT_BUSY; in get_containing_mtt()
3296 put_res(dev, slave, rmtt->com.res_id, RES_MTT); in mlx4_WRITE_MTT_wrapper()
3316 err = get_res(dev, slave, eq->mtt->com.res_id, RES_MTT, NULL); in mlx4_HW2SW_EQ_wrapper()
3325 put_res(dev, slave, eq->mtt->com.res_id, RES_MTT); in mlx4_HW2SW_EQ_wrapper()
3332 put_res(dev, slave, eq->mtt->com.res_id, RES_MTT); in mlx4_HW2SW_EQ_wrapper()
3370 if (req->com.from_state != RES_EQ_HW) { in mlx4_GEN_EQE()
3422 if (eq->com.from_state != RES_EQ_HW) { in mlx4_QUERY_EQ_wrapper()
3461 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_CQ_wrapper()
3466 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_CQ_wrapper()
3511 if (cq->com.from_state != RES_CQ_HW) in mlx4_QUERY_CQ_wrapper()
3534 err = get_res(dev, slave, cq->mtt->com.res_id, RES_MTT, &orig_mtt); in handle_resize()
3554 put_res(dev, slave, orig_mtt->com.res_id, RES_MTT); in handle_resize()
3557 put_res(dev, slave, mtt->com.res_id, RES_MTT); in handle_resize()
3561 put_res(dev, slave, mtt->com.res_id, RES_MTT); in handle_resize()
3563 put_res(dev, slave, orig_mtt->com.res_id, RES_MTT); in handle_resize()
3583 if (cq->com.from_state != RES_CQ_HW) in mlx4_MODIFY_CQ_wrapper()
3643 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_SRQ_wrapper()
3648 put_res(dev, slave, mtt->com.res_id, RES_MTT); in mlx4_SW2HW_SRQ_wrapper()
3697 if (srq->com.from_state != RES_SRQ_HW) { in mlx4_QUERY_SRQ_wrapper()
3721 if (srq->com.from_state != RES_SRQ_HW) { in mlx4_ARM_SRQ_wrapper()
3745 if (qp->com.from_state != RES_QP_HW) { in mlx4_GEN_QP_wrapper()
3855 if (qp->com.from_state != RES_QP_HW) { in mlx4_INIT2RTR_QP_wrapper()
4489 err = rem_res_range(dev, fs_rule->com.owner, fs_rule->com.res_id, 1, RES_FS_RULE, 0); in mlx4_undo_mirror_rule()
4495 mlx4_cmd(dev, fs_rule->com.res_id, 0, 0, MLX4_QP_FLOW_STEERING_DETACH, in mlx4_undo_mirror_rule()
4679 list_for_each_entry_safe(qp, tmp, qp_list, com.list) { in rem_slave_qps()
4681 if (qp->com.owner == slave) { in rem_slave_qps()
4682 qpn = qp->com.res_id; in rem_slave_qps()
4684 state = qp->com.from_state; in rem_slave_qps()
4689 rb_erase(&qp->com.node, in rem_slave_qps()
4691 list_del(&qp->com.list); in rem_slave_qps()
4752 list_for_each_entry_safe(srq, tmp, srq_list, com.list) { in rem_slave_srqs()
4754 if (srq->com.owner == slave) { in rem_slave_srqs()
4755 srqn = srq->com.res_id; in rem_slave_srqs()
4756 state = srq->com.from_state; in rem_slave_srqs()
4762 rb_erase(&srq->com.node, in rem_slave_srqs()
4764 list_del(&srq->com.list); in rem_slave_srqs()
4817 list_for_each_entry_safe(cq, tmp, cq_list, com.list) { in rem_slave_cqs()
4819 if (cq->com.owner == slave && !atomic_read(&cq->ref_count)) { in rem_slave_cqs()
4820 cqn = cq->com.res_id; in rem_slave_cqs()
4821 state = cq->com.from_state; in rem_slave_cqs()
4827 rb_erase(&cq->com.node, in rem_slave_cqs()
4829 list_del(&cq->com.list); in rem_slave_cqs()
4879 list_for_each_entry_safe(mpt, tmp, mpt_list, com.list) { in rem_slave_mrs()
4881 if (mpt->com.owner == slave) { in rem_slave_mrs()
4882 mptn = mpt->com.res_id; in rem_slave_mrs()
4883 state = mpt->com.from_state; in rem_slave_mrs()
4889 rb_erase(&mpt->com.node, in rem_slave_mrs()
4891 list_del(&mpt->com.list); in rem_slave_mrs()
4946 list_for_each_entry_safe(mtt, tmp, mtt_list, com.list) { in rem_slave_mtts()
4948 if (mtt->com.owner == slave) { in rem_slave_mtts()
4949 base = mtt->com.res_id; in rem_slave_mtts()
4950 state = mtt->com.from_state; in rem_slave_mtts()
4957 rb_erase(&mtt->com.node, in rem_slave_mtts()
4959 list_del(&mtt->com.list); in rem_slave_mtts()
5002 err = add_res_range(dev, fs_rule->com.owner, reg_id, 1, RES_FS_RULE, fs_rule->qpn); in mlx4_do_mirror_rule()
5006 err = get_res(dev, fs_rule->com.owner, reg_id, RES_FS_RULE, &mirr_rule); in mlx4_do_mirror_rule()
5014 put_res(dev, fs_rule->com.owner, reg_id, RES_FS_RULE); in mlx4_do_mirror_rule()
5018 rem_res_range(dev, fs_rule->com.owner, reg_id, 1, RES_FS_RULE, 0); in mlx4_do_mirror_rule()
5038 fs_rule = rb_entry(p, struct res_fs_rule, com.node); in mlx4_mirror_fs_rules()
5082 list_for_each_entry_safe(fs_rule, tmp, fs_rule_list, com.list) { in rem_slave_fs_rule()
5084 if (fs_rule->com.owner == slave) { in rem_slave_fs_rule()
5085 base = fs_rule->com.res_id; in rem_slave_fs_rule()
5086 state = fs_rule->com.from_state; in rem_slave_fs_rule()
5097 rb_erase(&fs_rule->com.node, in rem_slave_fs_rule()
5099 list_del(&fs_rule->com.list); in rem_slave_fs_rule()
5134 list_for_each_entry_safe(eq, tmp, eq_list, com.list) { in rem_slave_eqs()
5136 if (eq->com.owner == slave) { in rem_slave_eqs()
5137 eqn = eq->com.res_id; in rem_slave_eqs()
5138 state = eq->com.from_state; in rem_slave_eqs()
5143 rb_erase(&eq->com.node, in rem_slave_eqs()
5145 list_del(&eq->com.list); in rem_slave_eqs()
5199 list_for_each_entry_safe(counter, tmp, counter_list, com.list) { in rem_slave_counters()
5200 if (counter->com.owner == slave) { in rem_slave_counters()
5201 counters_arr[i++] = counter->com.res_id; in rem_slave_counters()
5202 rb_erase(&counter->com.node, in rem_slave_counters()
5204 list_del(&counter->com.list); in rem_slave_counters()
5236 list_for_each_entry_safe(xrcd, tmp, xrcdn_list, com.list) { in rem_slave_xrcdns()
5237 if (xrcd->com.owner == slave) { in rem_slave_xrcdns()
5238 xrcdn = xrcd->com.res_id; in rem_slave_xrcdns()
5239 rb_erase(&xrcd->com.node, &tracker->res_tree[RES_XRCD]); in rem_slave_xrcdns()
5240 list_del(&xrcd->com.list); in rem_slave_xrcdns()
5341 list_for_each_entry_safe(qp, tmp, qp_list, com.list) { in mlx4_vf_immed_vlan_work_handler()
5343 if (qp->com.owner == work->slave) { in mlx4_vf_immed_vlan_work_handler()
5344 if (qp->com.from_state != RES_QP_HW || in mlx4_vf_immed_vlan_work_handler()