IB/mlx4: Fix WQE LSO segment calculation
authorErez Shitrit <erezsh@mellanox.com>
Thu, 2 Apr 2015 10:39:05 +0000 (13:39 +0300)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:12:22 +0000 (19:12 -0400)
commit4eb6d476fcf6ac71a0b0528785d2a6807c7f57fd
tree271e4a08a1e974b9bc6d3f0b2ae9cf44044f90aa
parentee4709cebbfc95e30310a6370ace293e6bec1aaa
IB/mlx4: Fix WQE LSO segment calculation

[ Upstream commit ca9b590caa17bcbbea119594992666e96cde9c2f ]

The current code decreases from the mss size (which is the gso_size
from the kernel skb) the size of the packet headers.

It shouldn't do that because the mss that comes from the stack
(e.g IPoIB) includes only the tcp payload without the headers.

The result is indication to the HW that each packet that the HW sends
is smaller than what it could be, and too many packets will be sent
for big messages.

An easy way to demonstrate one more aspect of the problem is by
configuring the ipoib mtu to be less than 2*hlen (2*56) and then
run app sending big TCP messages. This will tell the HW to send packets
with giant (negative value which under unsigned arithmetics becomes
a huge positive one) length and the QP moves to SQE state.

Fixes: b832be1e4007 ('IB/mlx4: Add IPoIB LSO support')
Reported-by: Matthew Finlay <matt@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/infiniband/hw/mlx4/qp.c