aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/qp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index a6d8ea060ea8..f585eddef4b7 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1407,6 +1407,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1407 struct mlx4_wqe_mlx_seg *mlx = wqe; 1407 struct mlx4_wqe_mlx_seg *mlx = wqe;
1408 struct mlx4_wqe_inline_seg *inl = wqe + sizeof *mlx; 1408 struct mlx4_wqe_inline_seg *inl = wqe + sizeof *mlx;
1409 struct mlx4_ib_ah *ah = to_mah(wr->wr.ud.ah); 1409 struct mlx4_ib_ah *ah = to_mah(wr->wr.ud.ah);
1410 struct net_device *ndev;
1410 union ib_gid sgid; 1411 union ib_gid sgid;
1411 u16 pkey; 1412 u16 pkey;
1412 int send_size; 1413 int send_size;
@@ -1483,7 +1484,10 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1483 1484
1484 memcpy(sqp->ud_header.eth.dmac_h, ah->av.eth.mac, 6); 1485 memcpy(sqp->ud_header.eth.dmac_h, ah->av.eth.mac, 6);
1485 /* FIXME: cache smac value? */ 1486 /* FIXME: cache smac value? */
1486 smac = to_mdev(sqp->qp.ibqp.device)->iboe.netdevs[sqp->qp.port - 1]->dev_addr; 1487 ndev = to_mdev(sqp->qp.ibqp.device)->iboe.netdevs[sqp->qp.port - 1];
1488 if (!ndev)
1489 return -ENODEV;
1490 smac = ndev->dev_addr;
1487 memcpy(sqp->ud_header.eth.smac_h, smac, 6); 1491 memcpy(sqp->ud_header.eth.smac_h, smac, 6);
1488 if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6)) 1492 if (!memcmp(sqp->ud_header.eth.smac_h, sqp->ud_header.eth.dmac_h, 6))
1489 mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK); 1493 mlx->flags |= cpu_to_be32(MLX4_WQE_CTRL_FORCE_LOOPBACK);