]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.7.7/ib-mlx4-fix-code-indentation-in-qp1-mad-flow.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.7.7 / ib-mlx4-fix-code-indentation-in-qp1-mad-flow.patch
CommitLineData
937cd4b4
GKH
1From baa0be7026e2f7d1d40bfd45909044169e9e3c68 Mon Sep 17 00:00:00 2001
2From: Jack Morgenstein <jackm@dev.mellanox.co.il>
3Date: Mon, 12 Sep 2016 19:16:19 +0300
4Subject: IB/mlx4: Fix code indentation in QP1 MAD flow
5
6From: Jack Morgenstein <jackm@dev.mellanox.co.il>
7
8commit baa0be7026e2f7d1d40bfd45909044169e9e3c68 upstream.
9
10The indentation in the QP1 GRH flow in procedure build_mlx_header is
11really confusing. Fix it, in preparation for a commit which touches
12this code.
13
14Fixes: 1ffeb2eb8be9 ("IB/mlx4: SR-IOV IB context objects and proxy/tunnel SQP support")
15Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
16Signed-off-by: Leon Romanovsky <leon@kernel.org>
17Signed-off-by: Doug Ledford <dledford@redhat.com>
18Signed-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);