diff mbox series

[04/13] hw/pvrdma: Clean CQE before use

Message ID 20180716074038.3364-5-yuval.shaia@oracle.com
State New
Headers show
Series Misc fixes for pvrdma device | expand

Commit Message

Yuval Shaia July 16, 2018, 7:40 a.m. UTC
Next CQE is fetched from CQ ring, clean it before usage as it still
carries old CQE values.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 hw/rdma/vmw/pvrdma_qp_ops.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Marcel Apfelbaum July 16, 2018, 10:41 a.m. UTC | #1
On 07/16/2018 10:40 AM, Yuval Shaia wrote:
> Next CQE is fetched from CQ ring, clean it before usage as it still
> carries old CQE values.
>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
>   hw/rdma/vmw/pvrdma_qp_ops.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
> index 99bb51111e..a8664f40c8 100644
> --- a/hw/rdma/vmw/pvrdma_qp_ops.c
> +++ b/hw/rdma/vmw/pvrdma_qp_ops.c
> @@ -69,6 +69,7 @@ static int pvrdma_post_cqe(PVRDMADev *dev, uint32_t cq_handle,
>           return -EINVAL;
>       }
>   
> +    memset(cqe1, 0, sizeof(*cqe1));
>       cqe1->wr_id = cqe->wr_id;
>       cqe1->qp = cqe->qp;
>       cqe1->opcode = cqe->opcode;

Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com>



Thanks,

Marcel
diff mbox series

Patch

diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c
index 99bb51111e..a8664f40c8 100644
--- a/hw/rdma/vmw/pvrdma_qp_ops.c
+++ b/hw/rdma/vmw/pvrdma_qp_ops.c
@@ -69,6 +69,7 @@  static int pvrdma_post_cqe(PVRDMADev *dev, uint32_t cq_handle,
         return -EINVAL;
     }
 
+    memset(cqe1, 0, sizeof(*cqe1));
     cqe1->wr_id = cqe->wr_id;
     cqe1->qp = cqe->qp;
     cqe1->opcode = cqe->opcode;