diff mbox series

[PATCH-for-5.2,v2,12/25] block/nvme: Introduce Completion Queue definitions

Message ID 20201029093306.1063879-13-philmd@redhat.com
State Superseded
Headers show
Series block/nvme: Fix Aarch64 or big-endian hosts | expand

Commit Message

Philippe Mathieu-Daudé Oct. 29, 2020, 9:32 a.m. UTC
Rename Submission Queue flags with 'Sq' to differentiate
submission queue flags from command queue flags, and introduce
Completion Queue flag definitions.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/block/nvme.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Comments

Stefan Hajnoczi Oct. 30, 2020, 2:03 p.m. UTC | #1
On Thu, Oct 29, 2020 at 10:32:53AM +0100, Philippe Mathieu-Daudé wrote:
> Rename Submission Queue flags with 'Sq' to differentiate

> submission queue flags from command queue flags, and introduce

> Completion Queue flag definitions.

> 

> Reviewed-by: Eric Auger <eric.auger@redhat.com>

> Tested-by: Eric Auger <eric.auger@redhat.com>

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

> ---

>  include/block/nvme.h | 18 ++++++++++++------

>  1 file changed, 12 insertions(+), 6 deletions(-)


I mentioned more possible cleanups in the previous revision, but they
are not a blocker:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Philippe Mathieu-Daudé Oct. 30, 2020, 2:52 p.m. UTC | #2
On 10/30/20 3:03 PM, Stefan Hajnoczi wrote:
> On Thu, Oct 29, 2020 at 10:32:53AM +0100, Philippe Mathieu-Daudé wrote:

>> Rename Submission Queue flags with 'Sq' to differentiate

>> submission queue flags from command queue flags, and introduce

>> Completion Queue flag definitions.

>>

>> Reviewed-by: Eric Auger <eric.auger@redhat.com>

>> Tested-by: Eric Auger <eric.auger@redhat.com>

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

>> ---

>>  include/block/nvme.h | 18 ++++++++++++------

>>  1 file changed, 12 insertions(+), 6 deletions(-)

> 

> I mentioned more possible cleanups in the previous revision, but they

> are not a blocker:


Your cleanups haven't been ignored, simply postponed :)

> 

> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

>


Thanks!
diff mbox series

Patch

diff --git a/include/block/nvme.h b/include/block/nvme.h
index 65e68a82c89..c7ab9449125 100644
--- a/include/block/nvme.h
+++ b/include/block/nvme.h
@@ -491,6 +491,11 @@  typedef struct QEMU_PACKED NvmeCreateCq {
 #define NVME_CQ_FLAGS_PC(cq_flags)  (cq_flags & 0x1)
 #define NVME_CQ_FLAGS_IEN(cq_flags) ((cq_flags >> 1) & 0x1)
 
+enum NvmeFlagsCq {
+    NVME_CQ_PC          = 1,
+    NVME_CQ_IEN         = 2,
+};
+
 typedef struct QEMU_PACKED NvmeCreateSq {
     uint8_t     opcode;
     uint8_t     flags;
@@ -508,12 +513,13 @@  typedef struct QEMU_PACKED NvmeCreateSq {
 #define NVME_SQ_FLAGS_PC(sq_flags)      (sq_flags & 0x1)
 #define NVME_SQ_FLAGS_QPRIO(sq_flags)   ((sq_flags >> 1) & 0x3)
 
-enum NvmeQueueFlags {
-    NVME_Q_PC           = 1,
-    NVME_Q_PRIO_URGENT  = 0,
-    NVME_Q_PRIO_HIGH    = 1,
-    NVME_Q_PRIO_NORMAL  = 2,
-    NVME_Q_PRIO_LOW     = 3,
+enum NvmeFlagsSq {
+    NVME_SQ_PC          = 1,
+
+    NVME_SQ_PRIO_URGENT = 0,
+    NVME_SQ_PRIO_HIGH   = 1,
+    NVME_SQ_PRIO_NORMAL = 2,
+    NVME_SQ_PRIO_LOW    = 3,
 };
 
 typedef struct QEMU_PACKED NvmeIdentify {