]>
Commit | Line | Data |
---|---|---|
937cd4b4 GKH |
1 | From baa0be7026e2f7d1d40bfd45909044169e9e3c68 Mon Sep 17 00:00:00 2001 |
2 | From: Jack Morgenstein <jackm@dev.mellanox.co.il> | |
3 | Date: Mon, 12 Sep 2016 19:16:19 +0300 | |
4 | Subject: IB/mlx4: Fix code indentation in QP1 MAD flow | |
5 | ||
6 | From: Jack Morgenstein <jackm@dev.mellanox.co.il> | |
7 | ||
8 | commit baa0be7026e2f7d1d40bfd45909044169e9e3c68 upstream. | |
9 | ||
10 | The indentation in the QP1 GRH flow in procedure build_mlx_header is | |
11 | really confusing. Fix it, in preparation for a commit which touches | |
12 | this code. | |
13 | ||
14 | Fixes: 1ffeb2eb8be9 ("IB/mlx4: SR-IOV IB context objects and proxy/tunnel SQP support") | |
15 | Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> | |
16 | Signed-off-by: Leon Romanovsky <leon@kernel.org> | |
17 | Signed-off-by: Doug Ledford <dledford@redhat.com> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/infiniband/hw/mlx4/qp.c | 36 +++++++++++++++++++----------------- | |
22 | 1 file changed, 19 insertions(+), 17 deletions(-) | |
23 | ||
24 | --- a/drivers/infiniband/hw/mlx4/qp.c | |
25 | +++ b/drivers/infiniband/hw/mlx4/qp.c | |
26 | @@ -2492,24 +2492,26 @@ static int build_mlx_header(struct mlx4_ | |
27 | sqp->ud_header.grh.flow_label = | |
28 | ah->av.ib.sl_tclass_flowlabel & cpu_to_be32(0xfffff); | |
29 | sqp->ud_header.grh.hop_limit = ah->av.ib.hop_limit; | |
30 | - if (is_eth) | |
31 | + if (is_eth) { | |
32 | memcpy(sqp->ud_header.grh.source_gid.raw, sgid.raw, 16); | |
33 | - else { | |
34 | - if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { | |
35 | - /* When multi-function is enabled, the ib_core gid | |
36 | - * indexes don't necessarily match the hw ones, so | |
37 | - * we must use our own cache */ | |
38 | - sqp->ud_header.grh.source_gid.global.subnet_prefix = | |
39 | - to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | |
40 | - subnet_prefix; | |
41 | - sqp->ud_header.grh.source_gid.global.interface_id = | |
42 | - to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | |
43 | - guid_cache[ah->av.ib.gid_index]; | |
44 | - } else | |
45 | - ib_get_cached_gid(ib_dev, | |
46 | - be32_to_cpu(ah->av.ib.port_pd) >> 24, | |
47 | - ah->av.ib.gid_index, | |
48 | - &sqp->ud_header.grh.source_gid, NULL); | |
49 | + } else { | |
50 | + if (mlx4_is_mfunc(to_mdev(ib_dev)->dev)) { | |
51 | + /* When multi-function is enabled, the ib_core gid | |
52 | + * indexes don't necessarily match the hw ones, so | |
53 | + * we must use our own cache | |
54 | + */ | |
55 | + sqp->ud_header.grh.source_gid.global.subnet_prefix = | |
56 | + to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | |
57 | + subnet_prefix; | |
58 | + sqp->ud_header.grh.source_gid.global.interface_id = | |
59 | + to_mdev(ib_dev)->sriov.demux[sqp->qp.port - 1]. | |
60 | + guid_cache[ah->av.ib.gid_index]; | |
61 | + } else { | |
62 | + ib_get_cached_gid(ib_dev, | |
63 | + be32_to_cpu(ah->av.ib.port_pd) >> 24, | |
64 | + ah->av.ib.gid_index, | |
65 | + &sqp->ud_header.grh.source_gid, NULL); | |
66 | + } | |
67 | } | |
68 | memcpy(sqp->ud_header.grh.destination_gid.raw, | |
69 | ah->av.ib.dgid, 16); |