[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [PATCH v2 04/11] transport-fabrics: introduce Stream Transmission
Stream transmission is used for stream oriented communication(Ex TCP), also add virtio-blk read/write 8K example. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> --- transport-fabrics.tex | 229 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) diff --git a/transport-fabrics.tex b/transport-fabrics.tex index b88acfd..c02cf26 100644 --- a/transport-fabrics.tex +++ b/transport-fabrics.tex @@ -88,3 +88,232 @@ \subsubsection{Segment Descriptor Definition}\label{sec:Virtio Transport Options \end{tabular} Depending on the opcode, a Command contains zero or more structure virtio_of_vring_desc. + +\subsubsection{Buffer Mapping Definition}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Buffer Mapping Definition} +Virtio Over Fabrics defines two types of buffer mapping rules. + +\paragraph{Stream Transmission}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Stream Transmission} +Command, Segment Descriptors, and buffer are transmitted in a stream within a +connection. The layout in stream: + +\begin{lstlisting} +CMDx contains 0 descriptor, CMDy contains (n - m + 1) descriptors and buffer: + + +-----+ +-----++-----+ +-----++-----+ + ... | CMDx| ... | CMDy||DESCm| ... |DESCn|| BUF | ... + +-----+ +-----++-----+ +-----++-----+ + +COMPx contains 0 descriptor, COMPy contains (k - j + 1) descriptors and buffer: + + +-----+ +-----++-----+ +-----++-----+ + ... |COMPx| ... |COMPy||DESCj| ... |DESCk|| BUF | ... + +-----+ +-----++-----+ +-----++-----+ +\end{lstlisting} + +An example of a virtio-blk write 8K request(total size: sizeof(Command) + +4 * sizeof(Descriptor) + 8208): +\begin{lstlisting} + COMMAND +------+ + |opcode| -> virtio_of_op_vring + +------+ + |cmd id| -> 10 + +------+ + |length| -> 8208 + +------+ + |ndesc | -> 4 + +------+ + |rsvd | + +------+ + + DESC0 +------+ + +-----|addr | -> 0 + | +------+ + | |length| -> 16 (virtio blk write command) + | +------+ + | |id | -> 0 + | +------+ + | |flags | -> 0 + | +------+ + | + DESC1 | +------+ + | +---|addr | -> 16 + | | +------+ + | | |length| -> 4096 + | | +------+ + | | |id | -> 1 + | | +------+ + | | |flags | -> 0 + | | +------+ + | | + DESC2 | | +------+ + | | +-|addr | -> 4112 + | | | +------+ + | | | |length| -> 4096 + | | | +------+ + | | | |id | -> 2 + | | | +------+ + | | | |flags | -> 0 + | | | +------+ + | | | + DESC3 | | | +------+ + | | | |addr | -> 0 + | | | +------+ + | | | |length| -> 1 + | | | +------+ + | | | |id | -> 3 + | | | +------+ + | | | |flags | -> VIRTIO_OF_DESC_F_WRITE + | | | +------+ + | | | + DATA +-+-+>+------+ -> 0 + | | |......| + +-+>+------+ -> 16 + | |......| + +>+------+ -> 4112 + |......| + +------+ -> 8208 +\end{lstlisting} + +The Completion of this request(total size: sizeof(Completion) + +1 * sizeof(Descriptor) + 1): +\begin{lstlisting} + COMPLETION +------+ + |status| -> VIRTIO_OF_SUCCESS + +------+ + |cmd id| -> 10 + +------+ + |ndesc | -> 1 + +------+ + |rsvd | + +------+ + |value | -> 1 (value.u32) + +------+ + + DESC0 +------+ + +-|addr | -> 0 + | +------+ + | |length| -> 1 + | +------+ + | |id | -> 3 + | +------+ + | |flags | -> VIRTIO_OF_DESC_F_WRITE + | +------+ + | + DATA |>+------+ -> 0 + |......| + +------+ -> 1 +\end{lstlisting} + +Another example of a virtio-blk read 8K request(total size: sizeof(Command) + +4 * sizeof(Descriptor) + 16): +\begin{lstlisting} + COMMAND +------+ + |opcode| -> virtio_of_op_vring + +------+ + |cmd id| -> 14 + +------+ + |length| -> 16 (virtio blk read command) + +------+ + |ndesc | -> 4 + +------+ + |rsvd | + +------+ + + DESC0 +------+ + +-|addr | -> 0 + | +------+ + | |length| -> 16 + | +------+ + | |id | -> 0 + | +------+ + | |flags | -> 0 + | +------+ + | + DESC1 | +------+ + | |addr | -> 0 + | +------+ + | |length| -> 4096 + | +------+ + | |id | -> 1 + | +------+ + | |flags | -> VIRTIO_OF_DESC_F_WRITE + | +------+ + | + DESC2 | +------+ + | |addr | -> 0 + | +------+ + | |length| -> 4096 + | +------+ + | |id | -> 2 + | +------+ + | |flags | -> VIRTIO_OF_DESC_F_WRITE + | +------+ + | + DESC3 | +------+ + | |addr | -> 0 + | +------+ + | |length| -> 1 + | +------+ + | |id | -> 3 + | +------+ + | |flags | -> VIRTIO_OF_DESC_F_WRITE + | +------+ + | + DATA +>+------+ -> 0 + |......| + +------+ -> 16 +\end{lstlisting} + +The Completion of this request(total size: sizeof(Completion) + +3 * sizeof(Descriptor) + 8193): +\begin{lstlisting} + COMPLETION +------+ + |status| -> VIRTIO_OF_SUCCESS + +------+ + |cmd id| -> 14 + +------+ + |ndesc | -> 3 + +------+ + |rsvd | + +------+ + |value | -> 8193 (value.u32) + +------+ + + DESC0 +------+ + +-----|addr | -> 0 + | +------+ + | |length| -> 4096 + | +------+ + | |id | -> 1 + | +------+ + | |flags | -> VIRTIO_OF_DESC_F_WRITE + | +------+ + | + DESC1 | +------+ + | +---|addr | -> 4096 + | | +------+ + | | |length| -> 4096 + | | +------+ + | | |id | -> 2 + | | +------+ + | | |flags | -> VIRTIO_OF_DESC_F_WRITE + | | +------+ + | | + DESC2 | | +------+ + | | +-|addr | -> 8192 + | | | +------+ + | | | |length| -> 1 + | | | +------+ + | | | |id | -> 3 + | | | +------+ + | | | |flags | -> VIRTIO_OF_DESC_F_WRITE + | | | +------+ + | | | + DATA +-+-+>+------+ -> 0 + | | |......| + +-+>+------+ -> 4096 + | |......| + +>+------+ -> 8192 + |......| + +------+ -> 8193 +\end{lstlisting} -- 2.25.1
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]