Lines Matching refs:grp
14 struct rxe_mc_grp *grp; in rxe_mcast_get_grp() local
21 grp = rxe_pool_get_key(&rxe->mc_grp_pool, mgid); in rxe_mcast_get_grp()
22 if (grp) in rxe_mcast_get_grp()
25 grp = rxe_alloc(&rxe->mc_grp_pool); in rxe_mcast_get_grp()
26 if (!grp) { in rxe_mcast_get_grp()
31 INIT_LIST_HEAD(&grp->qp_list); in rxe_mcast_get_grp()
32 spin_lock_init(&grp->mcg_lock); in rxe_mcast_get_grp()
33 grp->rxe = rxe; in rxe_mcast_get_grp()
35 rxe_add_key(grp, mgid); in rxe_mcast_get_grp()
42 *grp_p = grp; in rxe_mcast_get_grp()
46 rxe_drop_ref(grp); in rxe_mcast_get_grp()
52 struct rxe_mc_grp *grp) in rxe_mcast_add_grp_elem() argument
59 spin_lock_bh(&grp->mcg_lock); in rxe_mcast_add_grp_elem()
60 list_for_each_entry(elem, &grp->qp_list, qp_list) { in rxe_mcast_add_grp_elem()
67 if (grp->num_qp >= rxe->attr.max_mcast_qp_attach) { in rxe_mcast_add_grp_elem()
79 rxe_add_ref(grp); in rxe_mcast_add_grp_elem()
81 grp->num_qp++; in rxe_mcast_add_grp_elem()
83 elem->grp = grp; in rxe_mcast_add_grp_elem()
85 list_add(&elem->qp_list, &grp->qp_list); in rxe_mcast_add_grp_elem()
90 spin_unlock_bh(&grp->mcg_lock); in rxe_mcast_add_grp_elem()
98 struct rxe_mc_grp *grp; in rxe_mcast_drop_grp_elem() local
101 grp = rxe_pool_get_key(&rxe->mc_grp_pool, mgid); in rxe_mcast_drop_grp_elem()
102 if (!grp) in rxe_mcast_drop_grp_elem()
106 spin_lock_bh(&grp->mcg_lock); in rxe_mcast_drop_grp_elem()
108 list_for_each_entry_safe(elem, tmp, &grp->qp_list, qp_list) { in rxe_mcast_drop_grp_elem()
112 grp->num_qp--; in rxe_mcast_drop_grp_elem()
114 spin_unlock_bh(&grp->mcg_lock); in rxe_mcast_drop_grp_elem()
117 rxe_drop_ref(grp); /* ref held by QP */ in rxe_mcast_drop_grp_elem()
118 rxe_drop_ref(grp); /* ref from get_key */ in rxe_mcast_drop_grp_elem()
123 spin_unlock_bh(&grp->mcg_lock); in rxe_mcast_drop_grp_elem()
125 rxe_drop_ref(grp); /* ref from get_key */ in rxe_mcast_drop_grp_elem()
132 struct rxe_mc_grp *grp; in rxe_drop_all_mcast_groups() local
146 grp = elem->grp; in rxe_drop_all_mcast_groups()
147 spin_lock_bh(&grp->mcg_lock); in rxe_drop_all_mcast_groups()
149 grp->num_qp--; in rxe_drop_all_mcast_groups()
150 spin_unlock_bh(&grp->mcg_lock); in rxe_drop_all_mcast_groups()
151 rxe_drop_ref(grp); in rxe_drop_all_mcast_groups()
158 struct rxe_mc_grp *grp = container_of(arg, typeof(*grp), pelem); in rxe_mc_cleanup() local
159 struct rxe_dev *rxe = grp->rxe; in rxe_mc_cleanup()
161 rxe_drop_key(grp); in rxe_mc_cleanup()
162 rxe_mcast_delete(rxe, &grp->mgid); in rxe_mc_cleanup()