mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM
[ Upstream commit904bba211a
] 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:7724105686
("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>
This commit is contained in:
parent
70ffacb737
commit
8c310cd9fa
2 changed files with 0 additions and 2 deletions
|
@ -772,7 +772,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
|
||||||
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
|
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
|
||||||
wc.ex.imm_data = ohdr->u.ud.imm_data;
|
wc.ex.imm_data = ohdr->u.ud.imm_data;
|
||||||
wc.wc_flags = IB_WC_WITH_IMM;
|
wc.wc_flags = IB_WC_WITH_IMM;
|
||||||
tlen -= sizeof(u32);
|
|
||||||
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
|
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
|
||||||
wc.ex.imm_data = 0;
|
wc.ex.imm_data = 0;
|
||||||
wc.wc_flags = 0;
|
wc.wc_flags = 0;
|
||||||
|
|
|
@ -525,7 +525,6 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct ib_header *hdr,
|
||||||
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
|
opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
|
||||||
wc.ex.imm_data = ohdr->u.ud.imm_data;
|
wc.ex.imm_data = ohdr->u.ud.imm_data;
|
||||||
wc.wc_flags = IB_WC_WITH_IMM;
|
wc.wc_flags = IB_WC_WITH_IMM;
|
||||||
tlen -= sizeof(u32);
|
|
||||||
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
|
} else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
|
||||||
wc.ex.imm_data = 0;
|
wc.ex.imm_data = 0;
|
||||||
wc.wc_flags = 0;
|
wc.wc_flags = 0;
|
||||||
|
|
Loading…
Reference in a new issue