Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7150bf8a authored by Jack Morgenstein's avatar Jack Morgenstein Committed by Roland Dreier
Browse files

[IB] mthca: Don't enter QP into MCG more than once.



Avoid entering a QP as member of a multicast group multiple times.

Signed-off-by: default avatarJack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent ba8e9310
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -185,7 +185,12 @@ int mthca_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
	}

	for (i = 0; i < MTHCA_QP_PER_MGM; ++i)
		if (!(mgm->qp[i] & cpu_to_be32(1 << 31))) {
		if (mgm->qp[i] == cpu_to_be32(ibqp->qp_num | (1 << 31))) {
			mthca_dbg(dev, "QP %06x already a member of MGM\n", 
				  ibqp->qp_num);
			err = 0;
			goto out;
		} else if (!(mgm->qp[i] & cpu_to_be32(1 << 31))) {
			mgm->qp[i] = cpu_to_be32(ibqp->qp_num | (1 << 31));
			break;
		}