Skip to content

Commit e5bff43

Browse files
brianweltygregkh
authored andcommitted
IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM
[ Upstream commit 904bba2 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent aa7fb40 commit e5bff43

2 files changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/infiniband/hw/qib/qib_ud.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
515515
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
516516
wc.ex.imm_data = ohdr->u.ud.imm_data;
517517
wc.wc_flags = IB_WC_WITH_IMM;
518-
tlen -= sizeof(u32);
519518
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
520519
wc.ex.imm_data = 0;
521520
wc.wc_flags = 0;

drivers/staging/rdma/hfi1/ud.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
793793
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
794794
wc.ex.imm_data = ohdr->u.ud.imm_data;
795795
wc.wc_flags = IB_WC_WITH_IMM;
796-
tlen -= sizeof(u32);
797796
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
798797
wc.ex.imm_data = 0;
799798
wc.wc_flags = 0;

0 commit comments

Comments
 (0)