]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.6.5/ib-mlx4-properly-initialize-grh-tclass-and-flowlabel-in-ahs.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.5 / ib-mlx4-properly-initialize-grh-tclass-and-flowlabel-in-ahs.patch
CommitLineData
700b5fa6
GKH
1From 8c5122e45a10a9262f872b53f151a592e870f905 Mon Sep 17 00:00:00 2001
2From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
3Date: Wed, 8 Jun 2016 17:28:29 -0600
4Subject: IB/mlx4: Properly initialize GRH TClass and FlowLabel in AHs
5
6From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
7
8commit 8c5122e45a10a9262f872b53f151a592e870f905 upstream.
9
10When this code was reworked for IBoE support the order of assignments
11for the sl_tclass_flowlabel got flipped around resulting in
12TClass & FlowLabel being permanently set to 0 in the packet headers.
13
14This breaks IB routers that rely on these headers, but only affects
15kernel users - libmlx4 does this properly for user space.
16
17Fixes: fa417f7b520e ("IB/mlx4: Add support for IBoE")
18Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
19Signed-off-by: Doug Ledford <dledford@redhat.com>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22---
23 drivers/infiniband/hw/mlx4/ah.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26--- a/drivers/infiniband/hw/mlx4/ah.c
27+++ b/drivers/infiniband/hw/mlx4/ah.c
28@@ -47,6 +47,7 @@ static struct ib_ah *create_ib_ah(struct
29
30 ah->av.ib.port_pd = cpu_to_be32(to_mpd(pd)->pdn | (ah_attr->port_num << 24));
31 ah->av.ib.g_slid = ah_attr->src_path_bits;
32+ ah->av.ib.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28);
33 if (ah_attr->ah_flags & IB_AH_GRH) {
34 ah->av.ib.g_slid |= 0x80;
35 ah->av.ib.gid_index = ah_attr->grh.sgid_index;
36@@ -64,7 +65,6 @@ static struct ib_ah *create_ib_ah(struct
37 !(1 << ah->av.ib.stat_rate & dev->caps.stat_rate_support))
38 --ah->av.ib.stat_rate;
39 }
40- ah->av.ib.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28);
41
42 return &ah->ibah;
43 }