[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [PATCH v2 07/11] transport-fabrics: introduce opcodes
Define opcode with this rule: The Virtio-oF transport layer commands use 0x0000-0x0fff, and the device layer commands use 0x1000-0xffff. get/set status/feature/ config use consecutive number. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> --- transport-fabrics.tex | 134 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/transport-fabrics.tex b/transport-fabrics.tex index 37f57c6..026ff5f 100644 --- a/transport-fabrics.tex +++ b/transport-fabrics.tex @@ -704,3 +704,137 @@ \subsubsection{Commands Definition}\label{sec:Virtio Transport Options / Virtio Note that Virtio Over Fabrics does not define an interrupt mechanism, generally the initiator receives a Completion, it SHOULD generate a host interrupt (if no interrupt suspending on device). + +\subsubsection{Opcodes Definition}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition} +This section defines command opcodes for Virtio Over Fabrics: + +\begin{lstlisting} +#define virtio_of_op_connect 0x0000 +#define virtio_of_op_discconnect 0x0001 +#define virtio_of_op_get_feature 0x0002 +#define virtio_of_op_set_feature 0x0003 +#define virtio_of_op_keepalive 0x0004 +#define virtio_of_op_vring 0x0fff +#define virtio_of_op_get_vendor_id 0x1000 +#define virtio_of_op_get_device_id 0x1001 +#define virtio_of_op_get_generation 0x1002 +#define virtio_of_op_get_status 0x1004 +#define virtio_of_op_set_status 0x1005 +#define virtio_of_op_get_device_feature 0x1006 +#define virtio_of_op_set_driver_feature 0x1007 +#define virtio_of_op_get_num_queues 0x1008 +#define virtio_of_op_get_queue_size 0x100a +#define virtio_of_op_get_config 0x100c +#define virtio_of_op_set_config 0x100d +\end{lstlisting} + +\paragraph{virtio_of_op_connect}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_connect} + +virtio_of_op_connect is used to connect a target for both control queue and virtqueue. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Connect Command} +and specify the ndesc field as 1, also contains 1 structure virtio_of_vring_desc +filled by structure virtio_of_command_status. + +\paragraph{virtio_of_op_discconnect}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_discconnect} + +virtio_of_op_discconnect is used to disconnect a target for both control queue and virtqueue. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}. + +\paragraph{virtio_of_op_get_feature}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_feature} + +virtio_of_op_get_feature is used to get features of target for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Feature Command}. + +\begin{tabular}{ |l|l|l| } +\hline +Feature Select & Value & Description \\ +\hline +virtio_of_feature_max_segment & 0x0 & Get the maximum segments within a Vring Command supported by target \\ +\hline +\end{tabular} + +\paragraph{virtio_of_op_set_feature}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_set_feature} + +virtio_of_op_set_feature is used to set features of initiator for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Feature Command}. + +\paragraph{virtio_of_op_keepalive}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_keepalive} + +virtio_of_op_keepalive is used to keep alive with the target for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}. + +\paragraph{virtio_of_op_vring}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_vring} + +virtio_of_op_vring is used to transmit buffer for both control queue and virtqueue. +The initiator MUST issues \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Vring Command} +and specify the ndesc field as the number of buffer segments, +also contains ndesc structure virtio_of_vring_desc. +Each structure virtio_of_vring_desc is filled by each buffer segment one by one. + +\paragraph{virtio_of_op_get_vendor_id}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_vendor_id} + +virtio_of_op_get_vendor_id is used to get vendor id for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}, +and reads from value field of Completion as le32. + +\paragraph{virtio_of_op_get_device_id}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_device_id} + +virtio_of_op_get_device_id is used to get device id for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}, +and reads from value field of Completion as le32. + +\paragraph{virtio_of_op_get_generation}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_generation} + +virtio_of_op_get_generation is used to get config generation for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}, +and reads from value field of Completion as le32. + +\paragraph{virtio_of_op_get_status}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_status} + +virtio_of_op_get_status is used to get device status for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}, +and reads from value field of Completion as le32. + +\paragraph{virtio_of_op_set_status}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_set_status} + +virtio_of_op_set_status is used to set device status for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}, +and specify the value field of Common Command as le32. + +\paragraph{virtio_of_op_get_device_feature}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_device_feature} + +virtio_of_op_get_device_feature is used to get device feature for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Feature Command}, +and reads from value field of Completion as le64. + +\paragraph{virtio_of_op_set_driver_feature}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_set_driver_feature} + +virtio_of_op_set_driver_feature is used to set driver feature for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Feature Command}, +and specify the value field of Common Command as le64. + +The initiator uses feature_select field to select which feature bits to set. +Value 0x0 selects Feature Bits 0 to 63, 0x1 selects Feature Bits 64 to 128, etc. + +\paragraph{virtio_of_op_get_num_queues}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_num_queues} + +virtio_of_op_get_num_queues is used to get the number of queues for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Common Command}, +and reads from value field of Completion as le16. + +\paragraph{virtio_of_op_get_queue_size}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_queue_size} + +virtio_of_op_get_queue_size is used to get the size of a specified queue for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Queue Command} with specified queue_id, +and reads from value field of Completion as le16. + +\paragraph{virtio_of_op_get_config}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_get_config} + +virtio_of_op_get_config is used to get the config of a device for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Config Command} with specified offset and bytes, +and reads from value field of Completion. + +\paragraph{virtio_of_op_set_config}\label{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Opcodes Definition / virtio_of_op_set_config} + +virtio_of_op_set_config is used to set the config of a device for control queue only. +The initiator MUST issue a \nameref{sec:Virtio Transport Options / Virtio Over Fabrics / Transmission Protocol / Commands Definition / Config Command} with specified offset and bytes and value fields. -- 2.25.1
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]