From: Klaus Jensen <its@irrelevant.dk>
To: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Cc: fam@euphon.net, kwolf@redhat.com, qemu-block@nongnu.org,
qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com,
kbusch@kernel.org
Subject: Re: [PATCH] hw/block/nvme: remove redundant invalid_lba_range trace
Date: Thu, 15 Apr 2021 08:15:01 +0200 [thread overview]
Message-ID: <YHfZ5Up1HtpLL8a8@apples.localdomain> (raw)
In-Reply-To: <20210414070435.3702-1-anaidu.gollu@samsung.com>
[-- Attachment #1: Type: text/plain, Size: 2833 bytes --]
On Apr 14 12:34, Gollu Appalanaidu wrote:
>Currently pci_nvme_err_invalid_lba_range tace being called indvidually
>at each function, add this in nvme_check_bounds and remove redundant
>usage of it.
>
>Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
>---
> hw/block/nvme.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
>diff --git a/hw/block/nvme.c b/hw/block/nvme.c
>index 6842b01ab5..c67d3315a1 100644
>--- a/hw/block/nvme.c
>+++ b/hw/block/nvme.c
>@@ -1424,6 +1424,7 @@ static inline uint16_t nvme_check_bounds(NvmeNamespace *ns, uint64_t slba,
> uint64_t nsze = le64_to_cpu(ns->id_ns.nsze);
>
> if (unlikely(UINT64_MAX - slba < nlb || slba + nlb > nsze)) {
>+ trace_pci_nvme_err_invalid_lba_range(slba, nlb, nsze);
> return NVME_LBA_RANGE | NVME_DNR;
> }
>
>@@ -2266,7 +2267,6 @@ static void nvme_copy_in_complete(NvmeRequest *req)
>
> status = nvme_check_bounds(ns, sdlba, ctx->nlb);
> if (status) {
>- trace_pci_nvme_err_invalid_lba_range(sdlba, ctx->nlb, ns->id_ns.nsze);
> goto invalid;
> }
>
>@@ -2528,8 +2528,6 @@ static uint16_t nvme_dsm(NvmeCtrl *n, NvmeRequest *req)
> uint32_t nlb = le32_to_cpu(range[i].nlb);
>
> if (nvme_check_bounds(ns, slba, nlb)) {
>- trace_pci_nvme_err_invalid_lba_range(slba, nlb,
>- ns->id_ns.nsze);
> continue;
> }
>
>@@ -2602,7 +2600,6 @@ static uint16_t nvme_verify(NvmeCtrl *n, NvmeRequest *req)
>
> status = nvme_check_bounds(ns, slba, nlb);
> if (status) {
>- trace_pci_nvme_err_invalid_lba_range(slba, nlb, ns->id_ns.nsze);
> return status;
> }
>
>@@ -2687,7 +2684,6 @@ static uint16_t nvme_copy(NvmeCtrl *n, NvmeRequest *req)
>
> status = nvme_check_bounds(ns, slba, _nlb);
> if (status) {
>- trace_pci_nvme_err_invalid_lba_range(slba, _nlb, ns->id_ns.nsze);
> goto out;
> }
>
>@@ -2816,7 +2812,6 @@ static uint16_t nvme_compare(NvmeCtrl *n, NvmeRequest *req)
>
> status = nvme_check_bounds(ns, slba, nlb);
> if (status) {
>- trace_pci_nvme_err_invalid_lba_range(slba, nlb, ns->id_ns.nsze);
> return status;
> }
>
>@@ -2935,7 +2930,6 @@ static uint16_t nvme_read(NvmeCtrl *n, NvmeRequest *req)
>
> status = nvme_check_bounds(ns, slba, nlb);
> if (status) {
>- trace_pci_nvme_err_invalid_lba_range(slba, nlb, ns->id_ns.nsze);
> goto invalid;
> }
>
>@@ -3015,7 +3009,6 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequest *req, bool append,
>
> status = nvme_check_bounds(ns, slba, nlb);
> if (status) {
>- trace_pci_nvme_err_invalid_lba_range(slba, nlb, ns->id_ns.nsze);
> goto invalid;
> }
>
Thanks. Applied to nvme-next!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2021-04-15 6:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210414070803epcas5p32e695f55e3421e0af51ba6adfd157cc6@epcas5p3.samsung.com>
2021-04-14 7:04 ` [PATCH] hw/block/nvme: remove redundant invalid_lba_range trace Gollu Appalanaidu
2021-04-14 12:38 ` Philippe Mathieu-Daudé
2021-04-15 6:15 ` 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=YHfZ5Up1HtpLL8a8@apples.localdomain \
--to=its@irrelevant.dk \
--cc=anaidu.gollu@samsung.com \
--cc=fam@euphon.net \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).