aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2015-02-08 04:49:33 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-09 17:03:53 -0500
commit824c25c1abe70a527646056f6911d181facde9cc (patch)
tree7d4ea49587626baab5d863717c98504e5cc698e2
parent92e584fe443995bbb84069a4d13ea8ebedb5c5c8 (diff)
IB/mlx4: Always use the correct port for mirrored multicast attachments
When attaching a QP to a multicast address in bonded mode, there was an assumption that the port of the QP must be #1. This assumption isn't the case under the flow which enables maximal usage of the physical ports. Fix it by always checking the port of the original flow and create the mirrored flow on the other port. Fixes: c6215745b66a ('IB/mlx4: Load balance ports in port aggregation mode') Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/infiniband/hw/mlx4/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 2ed5b996b2f4..3140da518a07 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1186,6 +1186,9 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
1186 goto err_create_flow; 1186 goto err_create_flow;
1187 i++; 1187 i++;
1188 if (is_bonded) { 1188 if (is_bonded) {
1189 /* Application always sees one port so the mirror rule
1190 * must be on port #2
1191 */
1189 flow_attr->port = 2; 1192 flow_attr->port = 2;
1190 err = __mlx4_ib_create_flow(qp, flow_attr, 1193 err = __mlx4_ib_create_flow(qp, flow_attr,
1191 domain, type[j], 1194 domain, type[j],
@@ -1286,7 +1289,8 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
1286 1289
1287 reg_id.mirror = 0; 1290 reg_id.mirror = 0;
1288 if (mlx4_is_bonded(dev)) { 1291 if (mlx4_is_bonded(dev)) {
1289 err = mlx4_multicast_attach(mdev->dev, &mqp->mqp, gid->raw, 2, 1292 err = mlx4_multicast_attach(mdev->dev, &mqp->mqp, gid->raw,
1293 (mqp->port == 1) ? 2 : 1,
1290 !!(mqp->flags & 1294 !!(mqp->flags &
1291 MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK), 1295 MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK),
1292 prot, &reg_id.mirror); 1296 prot, &reg_id.mirror);