[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Nbd] [PATCH v3 3/5] doc: Reformat description of Transmission phase



Rearrange a paragraph and add some headings, so that the next
patch adding a Structured Reply has less churn.

Signed-off-by: Eric Blake <eblake@...696...>
---
 doc/proto.md | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/doc/proto.md b/doc/proto.md
index 04d4a13..c1e05c5 100644
--- a/doc/proto.md
+++ b/doc/proto.md
@@ -182,8 +182,22 @@ required to.

 ### Transmission

-There are two message types in the transmission phase: the request, and
-the response.
+There are two message types in the transmission phase: the request,
+and the reply.  The phase consists of a series of transactions, where
+the client submits requests and the server sends corresponding
+replies, with a single reply message per request, and continues until
+either side closes the connection.
+
+Replies need not be sent in the same order as requests (i.e., requests
+may be handled by the server asynchronously).  Clients SHOULD use a
+handle that is distinct from all other currently pending transactions,
+but MAY reuse handles that are no longer in flight; handles need not
+be consecutive.  In each reply, the server MUST use the same value for
+handle as was sent by the client in the corresponding request.  In
+this way, the client can correlate which request is receiving a
+response.
+
+#### Request message

 The request message, sent by the client, looks as follows:

@@ -195,6 +209,8 @@ C: 64 bits, offset (unsigned)
 C: 32 bits, length (unsigned)  
 C: (*length* bytes of data if the request is of type `NBD_CMD_WRITE`)  

+#### Reply message
+
 The server replies with:

 S: 32 bits, 0x67446698, magic (`NBD_REPLY_MAGIC`)  
@@ -202,15 +218,6 @@ S: 32 bits, error
 S: 64 bits, handle  
 S: (*length* bytes of data if the request is of type `NBD_CMD_READ`)  

-Replies need not be sent in the same order as requests (i.e., requests
-may be handled by the server asynchronously).  Clients SHOULD use a
-handle that is distinct from all other currently pending transactions,
-but MAY reuse handles that are no longer in flight; handles need not
-be consecutive.  In each reply, the server MUST use the same value for
-handle as was sent by the client in the corresponding request.  In
-this way, the client can correlate which request is receiving a
-response.
-
 ## Values

 This section describes the value and meaning of constants (other than
-- 
2.5.5




Reply to: