RDMA/rxe: Remove qp->grp_lock and qp->grp_list
Since it is no longer required to cleanup attachments to multicast groups when a QP is destroyed qp->grp_lock and qp->grp_list are no longer needed and are removed. Link: https://lore.kernel.org/r/20220127213755.31697-7-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
Родитель
8a7fa872ff
Коммит
d3f6899b0b
|
@ -88,7 +88,6 @@ static int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
struct rxe_mca *elem;
|
||||
|
||||
/* check to see of the qp is already a member of the group */
|
||||
spin_lock_bh(&qp->grp_lock);
|
||||
spin_lock_bh(&grp->mcg_lock);
|
||||
list_for_each_entry(elem, &grp->qp_list, qp_list) {
|
||||
if (elem->qp == qp) {
|
||||
|
@ -113,16 +112,13 @@ static int rxe_mcast_add_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
|
||||
grp->num_qp++;
|
||||
elem->qp = qp;
|
||||
elem->grp = grp;
|
||||
atomic_inc(&qp->mcg_num);
|
||||
|
||||
list_add(&elem->qp_list, &grp->qp_list);
|
||||
list_add(&elem->grp_list, &qp->grp_list);
|
||||
|
||||
err = 0;
|
||||
out:
|
||||
spin_unlock_bh(&grp->mcg_lock);
|
||||
spin_unlock_bh(&qp->grp_lock);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -136,18 +132,15 @@ static int rxe_mcast_drop_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
if (!grp)
|
||||
goto err1;
|
||||
|
||||
spin_lock_bh(&qp->grp_lock);
|
||||
spin_lock_bh(&grp->mcg_lock);
|
||||
|
||||
list_for_each_entry_safe(elem, tmp, &grp->qp_list, qp_list) {
|
||||
if (elem->qp == qp) {
|
||||
list_del(&elem->qp_list);
|
||||
list_del(&elem->grp_list);
|
||||
grp->num_qp--;
|
||||
atomic_dec(&qp->mcg_num);
|
||||
|
||||
spin_unlock_bh(&grp->mcg_lock);
|
||||
spin_unlock_bh(&qp->grp_lock);
|
||||
rxe_drop_ref(elem);
|
||||
rxe_drop_ref(grp); /* ref held by QP */
|
||||
rxe_drop_ref(grp); /* ref from get_key */
|
||||
|
@ -156,7 +149,6 @@ static int rxe_mcast_drop_grp_elem(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
}
|
||||
|
||||
spin_unlock_bh(&grp->mcg_lock);
|
||||
spin_unlock_bh(&qp->grp_lock);
|
||||
rxe_drop_ref(grp); /* ref from get_key */
|
||||
err1:
|
||||
return -EINVAL;
|
||||
|
|
|
@ -188,9 +188,6 @@ static void rxe_qp_init_misc(struct rxe_dev *rxe, struct rxe_qp *qp,
|
|||
break;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&qp->grp_list);
|
||||
|
||||
spin_lock_init(&qp->grp_lock);
|
||||
spin_lock_init(&qp->state_lock);
|
||||
|
||||
atomic_set(&qp->ssn, 0);
|
||||
|
|
|
@ -232,9 +232,6 @@ struct rxe_qp {
|
|||
struct rxe_av pri_av;
|
||||
struct rxe_av alt_av;
|
||||
|
||||
/* list of mcast groups qp has joined (for cleanup) */
|
||||
struct list_head grp_list;
|
||||
spinlock_t grp_lock; /* guard grp_list */
|
||||
atomic_t mcg_num;
|
||||
|
||||
struct sk_buff_head req_pkts;
|
||||
|
@ -368,9 +365,7 @@ struct rxe_mcg {
|
|||
struct rxe_mca {
|
||||
struct rxe_pool_elem elem;
|
||||
struct list_head qp_list;
|
||||
struct list_head grp_list;
|
||||
struct rxe_qp *qp;
|
||||
struct rxe_mcg *grp;
|
||||
};
|
||||
|
||||
struct rxe_port {
|
||||
|
|
Загрузка…
Ссылка в новой задаче