]>
Commit | Line | Data |
---|---|---|
1 | From 8c5122e45a10a9262f872b53f151a592e870f905 Mon Sep 17 00:00:00 2001 | |
2 | From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | |
3 | Date: Wed, 8 Jun 2016 17:28:29 -0600 | |
4 | Subject: IB/mlx4: Properly initialize GRH TClass and FlowLabel in AHs | |
5 | ||
6 | From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | |
7 | ||
8 | commit 8c5122e45a10a9262f872b53f151a592e870f905 upstream. | |
9 | ||
10 | When this code was reworked for IBoE support the order of assignments | |
11 | for the sl_tclass_flowlabel got flipped around resulting in | |
12 | TClass & FlowLabel being permanently set to 0 in the packet headers. | |
13 | ||
14 | This breaks IB routers that rely on these headers, but only affects | |
15 | kernel users - libmlx4 does this properly for user space. | |
16 | ||
17 | Fixes: fa417f7b520e ("IB/mlx4: Add support for IBoE") | |
18 | Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | |
19 | Signed-off-by: Doug Ledford <dledford@redhat.com> | |
20 | Signed-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 | } |