aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/ud.c
diff options
context:
space:
mode:
authorBrian Welty <brian.welty@intel.com>2019-01-17 15:41:32 -0500
committerJason Gunthorpe <jgg@mellanox.com>2019-01-21 16:20:08 -0500
commit904bba211acc2112fdf866e5a2bc6cd9ecd0de1b (patch)
tree101781a8c2fbf766daa22c4d9200b68601c4142e /drivers/infiniband/hw/hfi1/ud.c
parentf45f8edbe1d345273ba0d8d8a9872bb30966869b (diff)
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>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/ud.c')
-rw-r--r--drivers/infiniband/hw/hfi1/ud.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c
index 88242fe95eaa..bf96067876c9 100644
--- a/drivers/infiniband/hw/hfi1/ud.c
+++ b/drivers/infiniband/hw/hfi1/ud.c
@@ -987,7 +987,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
987 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) { 987 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
988 wc.ex.imm_data = packet->ohdr->u.ud.imm_data; 988 wc.ex.imm_data = packet->ohdr->u.ud.imm_data;
989 wc.wc_flags = IB_WC_WITH_IMM; 989 wc.wc_flags = IB_WC_WITH_IMM;
990 tlen -= sizeof(u32);
991 } else if (opcode == IB_OPCODE_UD_SEND_ONLY) { 990 } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
992 wc.ex.imm_data = 0; 991 wc.ex.imm_data = 0;
993 wc.wc_flags = 0; 992 wc.wc_flags = 0;