On Apr 19 15:01, Alexander Mikhalitsyn wrote:
> From: Alexander Mikhalitsyn <[email protected]>
> 
> Instead of filling req->cqe.sq_id in nvme_post_cqes, let's set it earlier
> in nvme_process_sq.
> 
> This shouldn't cause any issues, because req->cqe.sq_id never changes
> during lifetime of req.
> 
> This will help us for migration support.
> 
> Signed-off-by: Alexander Mikhalitsyn <[email protected]>

Reviewed-by: Klaus Jensen <[email protected]>

> ---
>  hw/nvme/ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 191398e700f..d9bf32bff2c 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -1520,7 +1520,6 @@ static void nvme_post_cqes(void *opaque)
>  
>          sq = req->sq;
>          req->cqe.status = cpu_to_le16((req->status << 1) | cq->phase);
> -        req->cqe.sq_id = cpu_to_le16(sq->sqid);
>          req->cqe.sq_head = cpu_to_le16(sq->head);
>          addr = cq->dma_addr + (cq->tail << NVME_CQES);
>          ret = pci_dma_write(PCI_DEVICE(n), addr, (void *)&req->cqe,
> @@ -7848,6 +7847,7 @@ static void nvme_process_sq(void *opaque)
>          QTAILQ_REMOVE(&sq->req_list, req, entry);
>          QTAILQ_INSERT_TAIL(&sq->out_req_list, req, entry);
>          nvme_req_clear(req);
> +        req->cqe.sq_id = cpu_to_le16(sq->sqid);
>          req->cqe.cid = cmd.cid;
>          memcpy(&req->cmd, &cmd, sizeof(NvmeCmd));
>  
> -- 
> 2.47.3
> 
> 

Attachment: signature.asc
Description: PGP signature

Reply via email to