]>
Commit | Line | Data |
---|---|---|
1981af9d SL |
1 | From e3a2df6cfc85b1156274ebe4640917fec3bd0417 Mon Sep 17 00:00:00 2001 |
2 | From: Brian Welty <brian.welty@intel.com> | |
3 | Date: Thu, 17 Jan 2019 12:41:32 -0800 | |
4 | Subject: IB/{hfi1, qib}: Fix WC.byte_len calculation for UD_SEND_WITH_IMM | |
5 | ||
6 | [ Upstream commit 904bba211acc2112fdf866e5a2bc6cd9ecd0de1b ] | |
7 | ||
8 | The work completion length for a receiving a UD send with immediate is | |
9 | short by 4 bytes causing application using this opcode to fail. | |
10 | ||
11 | The UD receive logic incorrectly subtracts 4 bytes for immediate | |
12 | value. These bytes are already included in header length and are used to | |
13 | calculate header/payload split, so the result is these 4 bytes are | |
14 | subtracted twice, once when the header length subtracted from the overall | |
15 | length and once again in the UD opcode specific path. | |
16 | ||
17 | Remove the extra subtraction when handling the opcode. | |
18 | ||
19 | Fixes: 7724105686e7 ("IB/hfi1: add driver files") | |
20 | Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com> | |
21 | Signed-off-by: Brian Welty <brian.welty@intel.com> | |
22 | Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> | |
23 | Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> | |
24 | Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> | |
25 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
26 | --- | |
27 | drivers/infiniband/hw/qib/qib_ud.c | 1 - | |
28 | drivers/staging/rdma/hfi1/ud.c | 1 - | |
29 | 2 files changed, 2 deletions(-) | |
30 | ||
31 | diff --git a/drivers/infiniband/hw/qib/qib_ud.c b/drivers/infiniband/hw/qib/qib_ud.c | |
32 | index 59193f67ea78..56bd59bc08b5 100644 | |
33 | --- a/drivers/infiniband/hw/qib/qib_ud.c | |
34 | +++ b/drivers/infiniband/hw/qib/qib_ud.c | |
35 | @@ -515,7 +515,6 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr, | |
36 | opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) { | |
37 | wc.ex.imm_data = ohdr->u.ud.imm_data; | |
38 | wc.wc_flags = IB_WC_WITH_IMM; | |
39 | - tlen -= sizeof(u32); | |
40 | } else if (opcode == IB_OPCODE_UD_SEND_ONLY) { | |
41 | wc.ex.imm_data = 0; | |
42 | wc.wc_flags = 0; | |
43 | diff --git a/drivers/staging/rdma/hfi1/ud.c b/drivers/staging/rdma/hfi1/ud.c | |
44 | index 5a9c784bec04..a88e37444be0 100644 | |
45 | --- a/drivers/staging/rdma/hfi1/ud.c | |
46 | +++ b/drivers/staging/rdma/hfi1/ud.c | |
47 | @@ -793,7 +793,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) | |
48 | opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) { | |
49 | wc.ex.imm_data = ohdr->u.ud.imm_data; | |
50 | wc.wc_flags = IB_WC_WITH_IMM; | |
51 | - tlen -= sizeof(u32); | |
52 | } else if (opcode == IB_OPCODE_UD_SEND_ONLY) { | |
53 | wc.ex.imm_data = 0; | |
54 | wc.wc_flags = 0; | |
55 | -- | |
56 | 2.19.1 | |
57 |