qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/block/nvme: remove redundant invalid_lba_range trace
       [not found] <CGME20210414070803epcas5p32e695f55e3421e0af51ba6adfd157cc6@epcas5p3.samsung.com>
@ 2021-04-14  7:04 ` Gollu Appalanaidu
  2021-04-14 12:38   ` Philippe Mathieu-Daudé
  2021-04-15  6:15   ` Klaus Jensen
  0 siblings, 2 replies; 3+ messages in thread
From: Gollu Appalanaidu @ 2021-04-14  7:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, kwolf, qemu-block, Gollu Appalanaidu, mreitz, its, stefanha, kbusch

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;
     }
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/block/nvme: remove redundant invalid_lba_range trace
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-14 12:38 UTC (permalink / raw)
  To: Gollu Appalanaidu, qemu-devel
  Cc: fam, kwolf, qemu-block, mreitz, kbusch, stefanha, its

On 4/14/21 9:04 AM, Gollu Appalanaidu wrote:
> Currently pci_nvme_err_invalid_lba_range tace being called indvidually

Typos "trace", "individually".

> 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(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/block/nvme: remove redundant invalid_lba_range trace
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Klaus Jensen @ 2021-04-15  6:15 UTC (permalink / raw)
  To: Gollu Appalanaidu
  Cc: fam, kwolf, qemu-block, qemu-devel, mreitz, stefanha, kbusch

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-15  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 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).