diff options
| -rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 768085f59566..e398c04903fa 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
| @@ -2493,24 +2493,26 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_ud_wr *wr, | |||
| 2493 | sqp->ud_header.grh.flow_label = | 2493 | sqp->ud_header.grh.flow_label = |
| 2494 | ah->av.ib.sl_tclass_flowlabel & cpu_to_be32(0xfffff); | 2494 | ah->av.ib.sl_tclass_flowlabel & cpu_to_be32(0xfffff); |
| 2495 | sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit; | 2495 | sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit; |
| 2496 | if (is_eth) | 2496 | if (is_eth) { |
| 2497 | memcpy(sqp->ud_header.grh.source_gid.raw, sgid.raw, 16); | 2497 | memcpy(sqp->ud_header.grh.source_gid.raw, sgid.raw, 16); |
| 2498 | else { | 2498 | } else { |
| 2499 | if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { | 2499 | if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { |
| 2500 | /* When multi-function is enabled, the ib_core gid | 2500 | /* When multi-function is enabled, the ib_core gid |
| 2501 | * indexes don't necessarily match the hw ones, so | 2501 | * indexes don't necessarily match the hw ones, so |
| 2502 | * we must use our own cache */ | 2502 | * we must use our own cache |
| 2503 | sqp->ud_header.grh.source_gid.global.subnet_prefix = | 2503 | */ |
| 2504 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | 2504 | sqp->ud_header.grh.source_gid.global.subnet_prefix = |
| 2505 | subnet_prefix; | 2505 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. |
| 2506 | sqp->ud_header.grh.source_gid.global.interface_id = | 2506 | subnet_prefix; |
| 2507 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | 2507 | sqp->ud_header.grh.source_gid.global.interface_id = |
| 2508 | guid_cache[ah->av.ib.gid_index]; | 2508 | to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. |
| 2509 | } else | 2509 | guid_cache[ah->av.ib.gid_index]; |
| 2510 | ib_get_cached_gid(ib_dev, | 2510 | } else { |
| 2511 | be32_to_cpu(ah->av.ib.port_pd) >> 24, | 2511 | ib_get_cached_gid(ib_dev, |
| 2512 | ah->av.ib.gid_index, | 2512 | be32_to_cpu(ah->av.ib.port_pd) >> 24, |
| 2513 | &sqp->ud_header.grh.source_gid, NULL); | 2513 | ah->av.ib.gid_index, |
| 2514 | &sqp->ud_header.grh.source_gid, NULL); | ||
| 2515 | } | ||
| 2514 | } | 2516 | } |
| 2515 | memcpy(sqp->ud_header.grh.destination_gid.raw, | 2517 | memcpy(sqp->ud_header.grh.destination_gid.raw, |
| 2516 | ah->av.ib.dgid, 16); | 2518 | ah->av.ib.dgid, 16); |
