Skip to contentSkip to conversation

blkif.h: document blkif multi-queue/ring extension

PATCH Superseded Bob Liu 2 participants 2 messages Oct 29, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 blkif.h: document blkif multi-queue/ring extension

Document the multi-queue/ring feature in terms of XenStore keys to be written by the backend and by the frontend.

---
 xen/include/public/io/blkif.h |   48 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
xen/include/public/io/blkif.h +48 -0
index 8f0f9a6..f7823bb 100644
@@ -394,6 +394,54 @@
  */
 
 /*
+ * Multiple hardware queues/rings:
+ * If supported, the backend will write the key "multi-queue-max-queues" to
+ * the directory for that vbd, and set its value to the maximum supported
+ * number of queues.
+ * Frontends that are aware of this feature and wish to use it can write the
+ * key "multi-queue-num-queues" with the number they wish to use, which must be
+ * greater than zero, and no more than the value reported by the backend in
+ * "multi-queue-max-queues".
+ *
+ * For frontends requesting just one queue, the usual event-channel and
+ * ring-ref keys are written as before, simplifying the backend processing
+ * to avoid distinguishing between a frontend that doesn't understand the
+ * multi-queue feature, and one that does, but requested only one queue.
+ *
+ * Frontends requesting two or more queues must not write the toplevel
+ * event-channel and ring-ref keys, instead writing those keys under sub-keys
+ * having the name "queue-N" where N is the integer ID of the queue/ring for
+ * which those keys belong. Queues are indexed from zero.
+ * For example, a frontend with two queues must write the following set of
+ * queue-related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref = "<ring-ref>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref = "<ring-ref>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn>"
+ *
+ * It is also possible to use multiple queues/rings together with
+ * feature multi-page ring buffer.
+ * For example, a frontend requests two queues/rings and the size of each ring
+ * buffer is two pages must write the following set of related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/ring-page-order = "1"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref0 = "<ring-ref0>"
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref1 = "<ring-ref1>"
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn>"
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref0 = "<ring-ref0>"
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref1 = "<ring-ref1>"
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn>"
+ *
+ */
+
+/*
  * STATE DIAGRAMS
  *
  *****************************************************************************
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 30 lines · Bob Liu

Document the multi-queue/ring feature in terms of XenStore keys to be written by the backend and by the frontend.

---
 xen/include/public/io/blkif.h |   48 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
xen/include/public/io/blkif.h +14 -0
index 8f0f9a6..f7823bb 100644
@@ -394,6 +394,54 @@
  */
 
 /*
+ * Multiple hardware queues/rings:
+ * If supported, the backend will write the key "multi-queue-max-queues" to
+ * the directory for that vbd, and set its value to the maximum supported
+ * number of queues.
+ * Frontends that are aware of this feature and wish to use it can write the
+ * key "multi-queue-num-queues" with the number they wish to use, which must be
+ * greater than zero, and no more than the value reported by the backend in
+ * "multi-queue-max-queues".
+ *
+ * For frontends requesting just one queue, the usual event-channel and
+ * ring-ref keys are written as before, simplifying the backend processing
+ * to avoid distinguishing between a frontend that doesn't understand the
+ * multi-queue feature, and one that does, but requested only one queue.
+ *

xen/include/public/io/blkif.h line 420

Quoted 10 lines
xen/include/public/io/blkif.h +10 -0
+ * Frontends requesting two or more queues must not write the toplevel
+ * event-channel and ring-ref keys, instead writing those keys under sub-keys
+ * having the name "queue-N" where N is the integer ID of the queue/ring for
+ * which those keys belong. Queues are indexed from zero.
+ * For example, a frontend with two queues must write the following set of
+ * queue-related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref = "<ring-ref>"

<ring-ref#0>

xen/include/public/io/blkif.h line 421

Quoted 1 line
xen/include/public/io/blkif.h +1 -0
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn>"

<evtchn#0>

xen/include/public/io/blkif.h line 423

Quoted 2 lines
xen/include/public/io/blkif.h +2 -0
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref = "<ring-ref>"

<ring-ref#1>

xen/include/public/io/blkif.h line 424

Quoted 1 line
xen/include/public/io/blkif.h +1 -0
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn>"

<evtchn#1>

So that one can distinguish that the ring-reg / event channel for each queue MUST not be the same. Maybe even spell it out.

xen/include/public/io/blkif.h line 434

Quoted 10 lines
xen/include/public/io/blkif.h +10 -0
+ *
+ * It is also possible to use multiple queues/rings together with
+ * feature multi-page ring buffer.
+ * For example, a frontend requests two queues/rings and the size of each ring
+ * buffer is two pages must write the following set of related keys:
+ *
+ * /local/domain/1/device/vbd/0/multi-queue-num-queues = "2"
+ * /local/domain/1/device/vbd/0/ring-page-order = "1"
+ * /local/domain/1/device/vbd/0/queue-0 = ""
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref0 = "<ring-ref0>"

s/ref0/ref#0

xen/include/public/io/blkif.h line 435

Quoted 1 line
xen/include/public/io/blkif.h +1 -0
+ * /local/domain/1/device/vbd/0/queue-0/ring-ref1 = "<ring-ref1>"

s/ref1/ref#1

xen/include/public/io/blkif.h line 436

Quoted 1 line
xen/include/public/io/blkif.h +1 -0
+ * /local/domain/1/device/vbd/0/queue-0/event-channel = "<evtchn>"

evtchn#0

xen/include/public/io/blkif.h line 438

Quoted 2 lines
xen/include/public/io/blkif.h +2 -0
+ * /local/domain/1/device/vbd/0/queue-1 = ""
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref0 = "<ring-ref0>"

s/ref0/ref#2/

xen/include/public/io/blkif.h line 439

Quoted 1 line
xen/include/public/io/blkif.h +1 -0
+ * /local/domain/1/device/vbd/0/queue-1/ring-ref1 = "<ring-ref1>"

s/ref1/ref#3/

xen/include/public/io/blkif.h line 440

Quoted 1 line
xen/include/public/io/blkif.h +1 -0
+ * /local/domain/1/device/vbd/0/queue-1/event-channel = "<evtchn>"

s/evtchn/evtchn#1/

Quoted 10 lines
xen/include/public/io/blkif.h +4 -0
+ *
+ */
+
+/*
  * STATE DIAGRAMS
  *
  *****************************************************************************
Signature · 1 line
1.7.10.4