Skip to content

Commit 904bba2

Browse files
brianweltyjgunthorpe
authored andcommitted
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: 7724105 ("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>
1 parent f45f8ed commit 904bba2

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

drivers/infiniband/hw/hfi1/ud.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
987987
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
988988
wc.ex.imm_data = packet->ohdr->u.ud.imm_data;
989989
wc.wc_flags = IB_WC_WITH_IMM;
990-
tlen -= sizeof(u32);
991990
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
992991
wc.ex.imm_data = 0;
993992
wc.wc_flags = 0;

drivers/infiniband/hw/qib/qib_ud.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct ib_header *hdr,
512512
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
513513
wc.ex.imm_data = ohdr->u.ud.imm_data;
514514
wc.wc_flags = IB_WC_WITH_IMM;
515-
tlen -= sizeof(u32);
516515
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
517516
wc.ex.imm_data = 0;
518517
wc.wc_flags = 0;

0 commit comments

Comments
 (0)