aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rxe/rxe_qp.c
diff options
context:
space:
mode:
authorBob Pearson <rpearsonhpe@gmail.com>2022-01-27 15:37:33 -0600
committerJason Gunthorpe <jgg@nvidia.com>2022-01-28 14:33:28 -0400
commitf9f484605779fbdc1dcbb820834ace80d8211cad (patch)
tree38d23c59b6e00453b58eb1d94be078168d151871 /drivers/infiniband/sw/rxe/rxe_qp.c
parentRDMA/rxe: Rename rxe_mc_grp and rxe_mc_elem (diff)
downloadlinux-dev-f9f484605779fbdc1dcbb820834ace80d8211cad.tar.xz
linux-dev-f9f484605779fbdc1dcbb820834ace80d8211cad.zip
RDMA/rxe: Enforce IBA o10-2.2.3
Add code to check if a QP is attached to one or more multicast groups when destroy_qp is called and return an error if so. Link: https://lore.kernel.org/r/20220127213755.31697-5-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_qp.c')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_qp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index 5018b9387694..3325c2400e2f 100644
--- a/drivers/infiniband/sw/rxe/rxe_qp.c
+++ b/drivers/infiniband/sw/rxe/rxe_qp.c
@@ -770,6 +770,20 @@ int rxe_qp_to_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask)
return 0;
}
+int rxe_qp_chk_destroy(struct rxe_qp *qp)
+{
+ /* See IBA o10-2.2.3
+ * An attempt to destroy a QP while attached to a mcast group
+ * will fail immediately.
+ */
+ if (atomic_read(&qp->mcg_num)) {
+ pr_debug("Attempt to destroy QP while attached to multicast group\n");
+ return -EBUSY;
+ }
+
+ return 0;
+}
+
/* called by the destroy qp verb */
void rxe_qp_destroy(struct rxe_qp *qp)
{