public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvme: add ctrl state machine pdf creator
@ 2022-07-27 21:54 Chaitanya Kulkarni
  2022-07-28 18:40 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Chaitanya Kulkarni @ 2022-07-27 21:54 UTC (permalink / raw)
  To: linux-nvme; +Cc: hch, sagi, kbusch, Chaitanya Kulkarni

It is not always easy to read the NVMe Host controller state machine
quickly written in C when debugging the code for various transports.

This adds a simple dot based state machine for the host controller that
creates pdf. The resulting pdf is easier to understand and process.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 .../nvme/host-ctrl-state-machine/Makefile     |  4 +++
 .../ctrl-state-machine.dot                    | 27 +++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 Documentation/nvme/host-ctrl-state-machine/Makefile
 create mode 100644 Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot

diff --git a/Documentation/nvme/host-ctrl-state-machine/Makefile b/Documentation/nvme/host-ctrl-state-machine/Makefile
new file mode 100644
index 000000000000..916ce24b1b2f
--- /dev/null
+++ b/Documentation/nvme/host-ctrl-state-machine/Makefile
@@ -0,0 +1,4 @@
+all:
+	dot -Tps ctrl-state-machine.dot -o ctrl-state-machine.pdf
+clean:
+	rm -fr ctrl-state-machine.pdf
diff --git a/Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot b/Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot
new file mode 100644
index 000000000000..9c277112c5df
--- /dev/null
+++ b/Documentation/nvme/host-ctrl-state-machine/ctrl-state-machine.dot
@@ -0,0 +1,27 @@
+/*
+ * NVMe Host Controller State transition diagram
+ * dot -Tps nvme-ctrl-state-machine.dot -o nvme-ctrl-state-machine.pdf
+ */
+digraph NVMe_Controller_State_Machine {
+NEW -> LIVE
+NEW -> CONNECTING
+NEW -> RESETTING
+CONNECTING -> LIVE
+CONNECTING -> DELETING
+LIVE -> RESETTING
+LIVE -> DELETING
+RESETTING -> CONNECTING
+RESETTING -> DELETING
+RESETTING -> LIVE
+DEAD -> DELETING_NOIO
+DELETING -> DELETING_NOIO
+DELETING -> DEAD
+
+NEW [shape=polygon,sides=5,peripheries=3,color=lightblue,style=filled]
+LIVE [color=green,style=filled]
+CONNECTING [color=yellow,style=filled]
+RESETTING [color=lightyellow,style=filled]
+DELETING [color=pink,style=filled]
+DEAD [color=red,style=filled]
+DELETING_NOIO [shape=polygon,sides=5,peripheries=3,color=maroon,style=filled]
+}
-- 
2.29.0



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

end of thread, other threads:[~2022-07-28 23:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-27 21:54 [PATCH] nvme: add ctrl state machine pdf creator Chaitanya Kulkarni
2022-07-28 18:40 ` Christoph Hellwig
2022-07-28 23:07   ` Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox