]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.14.41/ib-mlx4-fix-wqe-lso-segment-calculation.patch
Linux 4.14.107
[thirdparty/kernel/stable-queue.git] / releases / 3.14.41 / ib-mlx4-fix-wqe-lso-segment-calculation.patch
1 From ca9b590caa17bcbbea119594992666e96cde9c2f Mon Sep 17 00:00:00 2001
2 From: Erez Shitrit <erezsh@mellanox.com>
3 Date: Thu, 2 Apr 2015 13:39:05 +0300
4 Subject: IB/mlx4: Fix WQE LSO segment calculation
5
6 From: Erez Shitrit <erezsh@mellanox.com>
7
8 commit ca9b590caa17bcbbea119594992666e96cde9c2f upstream.
9
10 The current code decreases from the mss size (which is the gso_size
11 from the kernel skb) the size of the packet headers.
12
13 It shouldn't do that because the mss that comes from the stack
14 (e.g IPoIB) includes only the tcp payload without the headers.
15
16 The result is indication to the HW that each packet that the HW sends
17 is smaller than what it could be, and too many packets will be sent
18 for big messages.
19
20 An easy way to demonstrate one more aspect of the problem is by
21 configuring the ipoib mtu to be less than 2*hlen (2*56) and then
22 run app sending big TCP messages. This will tell the HW to send packets
23 with giant (negative value which under unsigned arithmetics becomes
24 a huge positive one) length and the QP moves to SQE state.
25
26 Fixes: b832be1e4007 ('IB/mlx4: Add IPoIB LSO support')
27 Reported-by: Matthew Finlay <matt@mellanox.com>
28 Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
29 Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
30 Signed-off-by: Doug Ledford <dledford@redhat.com>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32
33 ---
34 drivers/infiniband/hw/mlx4/qp.c | 3 +--
35 1 file changed, 1 insertion(+), 2 deletions(-)
36
37 --- a/drivers/infiniband/hw/mlx4/qp.c
38 +++ b/drivers/infiniband/hw/mlx4/qp.c
39 @@ -2274,8 +2274,7 @@ static int build_lso_seg(struct mlx4_wqe
40
41 memcpy(wqe->header, wr->wr.ud.header, wr->wr.ud.hlen);
42
43 - *lso_hdr_sz = cpu_to_be32((wr->wr.ud.mss - wr->wr.ud.hlen) << 16 |
44 - wr->wr.ud.hlen);
45 + *lso_hdr_sz = cpu_to_be32(wr->wr.ud.mss << 16 | wr->wr.ud.hlen);
46 *lso_seg_len = halign;
47 return 0;
48 }