Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Jack Morgenstein <jackm@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Jack Morgenstein and committed by
Roland Dreier
7150bf8a ba8e9310

+6 -1
+6 -1
drivers/infiniband/hw/mthca/mthca_mcg.c
··· 185 185 } 186 186 187 187 for (i = 0; i < MTHCA_QP_PER_MGM; ++i) 188 - if (!(mgm->qp[i] & cpu_to_be32(1 << 31))) { 188 + if (mgm->qp[i] == cpu_to_be32(ibqp->qp_num | (1 << 31))) { 189 + mthca_dbg(dev, "QP %06x already a member of MGM\n", 190 + ibqp->qp_num); 191 + err = 0; 192 + goto out; 193 + } else if (!(mgm->qp[i] & cpu_to_be32(1 << 31))) { 189 194 mgm->qp[i] = cpu_to_be32(ibqp->qp_num | (1 << 31)); 190 195 break; 191 196 }