Skip to content

Commit

Permalink
[IB] mthca: Don't enter QP into MCG more than once.
Browse files Browse the repository at this point in the history
Avoid entering a QP as member of a multicast group multiple times.

Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Jack Morgenstein authored and Roland Dreier committed Oct 18, 2005
1 parent ba8e931 commit 7150bf8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/infiniband/hw/mthca/mthca_mcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7150bf8

Please sign in to comment.