]> git.itanic.dy.fi Git - linux-stable/commit
IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM
authorBrian Welty <brian.welty@intel.com>
Thu, 17 Jan 2019 20:41:32 +0000 (12:41 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:03:11 +0000 (14:03 -0700)
commit3162d8af3f5d89141843a4f6bfd6a749ddbbe08d
treea69bfac84dd09a21d438d43d50d366c6cac139d2
parent01b094e3c2c5e00a74abd9a978e0ce6c3b5e68a4
IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM

[ Upstream commit 904bba211acc2112fdf866e5a2bc6cd9ecd0de1b ]

The work completion length for a receiving a UD send with immediate is
short by 4 bytes causing application using this opcode to fail.

The UD receive logic incorrectly subtracts 4 bytes for immediate
value. These bytes are already included in header length and are used to
calculate header/payload split, so the result is these 4 bytes are
subtracted twice, once when the header length subtracted from the overall
length and once again in the UD opcode specific path.

Remove the extra subtraction when handling the opcode.

Fixes: 7724105686e7 ("IB/hfi1: add driver files")
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hfi1/ud.c
drivers/infiniband/hw/qib/qib_ud.c