]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch
Linux 4.19.42
[thirdparty/kernel/stable-queue.git] / queue-5.0 / ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch
1 From a5e08b29a75e5458acdbf67a9d38011ac84211ed Mon Sep 17 00:00:00 2001
2 From: Kaike Wan <kaike.wan@intel.com>
3 Date: Mon, 18 Mar 2019 09:55:39 -0700
4 Subject: IB/hfi1: Eliminate opcode tests on mr deref
5
6 [ Upstream commit a8639a79e85c18c16c10089edd589c7948f19bbd ]
7
8 When an old ack_queue entry is used to store an incoming request, it may
9 need to clean up the old entry if it is still referencing the
10 MR. Originally only RDMA READ request needed to reference MR on the
11 responder side and therefore the opcode was tested when cleaning up the
12 old entry. The introduction of tid rdma specific operations in the
13 ack_queue makes the specific opcode tests wrong. Multiple opcodes (RDMA
14 READ, TID RDMA READ, and TID RDMA WRITE) may need MR ref cleanup.
15
16 Remove the opcode specific tests associated with the ack_queue.
17
18 Fixes: f48ad614c100 ("IB/hfi1: Move driver out of staging")
19 Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
20 Signed-off-by: Kaike Wan <kaike.wan@intel.com>
21 Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
22 Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
23 Signed-off-by: Sasha Levin <sashal@kernel.org>
24 ---
25 drivers/infiniband/hw/hfi1/rc.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28 diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c
29 index be603f35d7e47..cfde43b1df960 100644
30 --- a/drivers/infiniband/hw/hfi1/rc.c
31 +++ b/drivers/infiniband/hw/hfi1/rc.c
32 @@ -2302,7 +2302,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
33 update_ack_queue(qp, next);
34 }
35 e = &qp->s_ack_queue[qp->r_head_ack_queue];
36 - if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {
37 + if (e->rdma_sge.mr) {
38 rvt_put_mr(e->rdma_sge.mr);
39 e->rdma_sge.mr = NULL;
40 }
41 @@ -2376,7 +2376,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
42 update_ack_queue(qp, next);
43 }
44 e = &qp->s_ack_queue[qp->r_head_ack_queue];
45 - if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {
46 + if (e->rdma_sge.mr) {
47 rvt_put_mr(e->rdma_sge.mr);
48 e->rdma_sge.mr = NULL;
49 }
50 --
51 2.20.1
52