Commit aa75b07b authored by Yonatan Cohen's avatar Yonatan Cohen Committed by Doug Ledford

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: 8700e3e7 ("Soft RoCE driver")
Signed-off-by: default avatarYonatan Cohen <yonatanc@mellanox.com>
Reviewed-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 002e062e
...@@ -522,6 +522,7 @@ static void rxe_qp_reset(struct rxe_qp *qp) ...@@ -522,6 +522,7 @@ static void rxe_qp_reset(struct rxe_qp *qp)
if (qp->sq.queue) { if (qp->sq.queue) {
__rxe_do_task(&qp->comp.task); __rxe_do_task(&qp->comp.task);
__rxe_do_task(&qp->req.task); __rxe_do_task(&qp->req.task);
rxe_queue_reset(qp->sq.queue);
} }
/* cleanup attributes */ /* cleanup attributes */
......
...@@ -84,6 +84,15 @@ int do_mmap_info(struct rxe_dev *rxe, ...@@ -84,6 +84,15 @@ int do_mmap_info(struct rxe_dev *rxe,
return -EINVAL; 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, struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe,
int *num_elem, int *num_elem,
unsigned int elem_size) unsigned int elem_size)
......
...@@ -84,6 +84,8 @@ int do_mmap_info(struct rxe_dev *rxe, ...@@ -84,6 +84,8 @@ int do_mmap_info(struct rxe_dev *rxe,
size_t buf_size, size_t buf_size,
struct rxe_mmap_info **ip_p); struct rxe_mmap_info **ip_p);
void rxe_queue_reset(struct rxe_queue *q);
struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe, struct rxe_queue *rxe_queue_init(struct rxe_dev *rxe,
int *num_elem, int *num_elem,
unsigned int elem_size); unsigned int elem_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment