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)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 21 Jan 2019 21:20:08 +0000 (14:20 -0700)
commit904bba211acc2112fdf866e5a2bc6cd9ecd0de1b
tree101781a8c2fbf766daa22c4d9200b68601c4142e
parentf45f8edbe1d345273ba0d8d8a9872bb30966869b
IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM

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>
drivers/infiniband/hw/hfi1/ud.c
drivers/infiniband/hw/qib/qib_ud.c