aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rxe/rxe_queue.c
diff options
context:
space:
mode:
authorYonatan Cohen <yonatanc@mellanox.com>2016-11-16 10:39:17 +0200
committerDoug Ledford <dledford@redhat.com>2016-11-16 20:03:44 -0500
commitaa75b07b478a774b1432e2df1be5cd8ae834de0f (patch)
tree61258e0d529054999d30e085d1609ed4f4c5e0ba /drivers/infiniband/sw/rxe/rxe_queue.c
parentIB/rxe: Fix handling of erroneous WR (diff)
downloadlinux-dev-aa75b07b478a774b1432e2df1be5cd8ae834de0f.tar.xz
linux-dev-aa75b07b478a774b1432e2df1be5cd8ae834de0f.zip
IB/rxe: Clear queue buffer when modifying QP to reset
RXE resets the send-q only once in rxe_qp_init_req() when QP is created, but when the QP is reused after QP reset, the send-q holds previous garbage data. This garbage data wrongly fails CQEs that otherwise should have completed successfully. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com> Reviewed-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_queue.c')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_queue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_queue.c b/drivers/infiniband/sw/rxe/rxe_queue.c
index 08274254eb88..d14bf496d62d 100644
--- a/drivers/infiniband/sw/rxe/rxe_queue.c
+++ b/drivers/infiniband/sw/rxe/rxe_queue.c
@@ -84,6 +84,15 @@ err1:
return -EINVAL;
}
+inline void rxe_queue_reset(struct rxe_queue *q)
+{
+ /* queue is comprised from header and the memory
+ * of the actual queue. See "struct rxe_queue_buf" in rxe_queue.h
+ * reset only the queue itself and not the management header
+ */
+ memset(q->buf->data, 0, q->buf_size - sizeof(struct rxe_queue_buf));
+}
+
struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe,
int *num_elem,
unsigned int elem_size)