From: Klaus Jensen <its@irrelevant.dk>
To: Dmitry Tikhov <d.tihov@yadro.com>
Cc: kbusch@kernel.org, ddtikhov@gmail.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org, linux@yadro.com
Subject: Re: [PATCH v2] hw/nvme: fix copy cmd for pi enabled namespaces
Date: Thu, 28 Apr 2022 22:16:16 +0200 [thread overview]
Message-ID: <Ymr2ENnMLhKqqKe8@apples> (raw)
In-Reply-To: <20220421105158.ufd3wzivaougxokx@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]
On Apr 21 13:51, Dmitry Tikhov wrote:
> Current implementation have problem in the read part of copy command.
> Because there is no metadata mangling before nvme_dif_check invocation,
> reftag error could be thrown for blocks of namespace that have not been
> previously written to.
>
> Signed-off-by: Dmitry Tikhov <d.tihov@yadro.com>
> ---
> v2:
> * remove refactoring
> * remove write part fix
> ---
> hw/nvme/ctrl.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 74540a03d5..08574c4dcb 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -2787,6 +2787,10 @@ static void nvme_copy_in_completed_cb(void *opaque, int ret)
> size_t mlen = nvme_m2b(ns, nlb);
> uint8_t *mbounce = iocb->bounce + nvme_l2b(ns, nlb);
>
> + status = nvme_dif_mangle_mdata(ns, mbounce, mlen, slba);
> + if (status) {
> + goto invalid;
> + }
> status = nvme_dif_check(ns, iocb->bounce, len, mbounce, mlen, prinfor,
> slba, apptag, appmask, &reftag);
> if (status) {
> --
> 2.35.1
>
Thanks Dmitry,
Applied to nvme-next.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2022-04-28 20:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 10:51 [PATCH v2] hw/nvme: fix copy cmd for pi enabled namespaces Dmitry Tikhov
2022-04-28 20:16 ` Klaus Jensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ymr2ENnMLhKqqKe8@apples \
--to=its@irrelevant.dk \
--cc=d.tihov@yadro.com \
--cc=ddtikhov@gmail.com \
--cc=kbusch@kernel.org \
--cc=linux@yadro.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).