virtio-net: support timestamp received packet
PATCH 1/1 virtio-net: support timestamp received packet
This patch introduces VIRTIO_NET_F_RX_TSTAMP to enhance the observability of network packet delay between virtio device and virtio driver.
We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Thanks and looking forward to your response!
--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
content.tex +3 -0
@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash value and a type of calculated hash. +\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. + \item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact value. Device benefits from knowing the exact header length.
@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:Device Types / Network Device / Device O #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4 +#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1
@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:Device Types / Network Device / Device O le32 hash_value; (Only if VIRTIO_NET_F_HASH_REPORT
negotiated)
le16 hash_report; (Only if VIRTIO_NET_F_HASH_REPORT
negotiated)
le16 padding_reserved; (Only if VIRTIO_NET_F_HASH_REPORT
negotiated)
+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated)
};
\end{lstlisting}
@@ -3809,6 +3813,13 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level
of checksums is validated).
+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}.
+
+If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also
+set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags},
+set \field{tstamp} to time to receive the packet.
+
\drivernormative{\paragraph}{Processing of Incoming
Packets}{Device Types / Network Device / Device Operation /
Processing of Incoming Packets}
@@ -3831,6 +3842,9 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALID is set, the driver MUST NOT
rely on the packet checksum being correct.
+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}.
+
\paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /
Processing of Incoming Packets / Hash calculation for incoming packets}
Signature · 6 lines
2.27.0 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 12 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Quoted 1 line
Thanks and looking forward to your response!
1. Do we need to dynamically turn on and off this function?
2. What is the unit of tstamp here?
Thanks.
Quoted 69 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex +7
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet. + \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
Quoted 8 lines
--
2.27.0---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 13 lines · Xuan Zhuo
Quoted 12 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Quoted 8 lines
Quoted 1 line
Thanks and looking forward to your response!
1. Do we need to dynamically turn on and off this function?
2. What is the unit of tstamp here?Thanks.
1. yes, we could use ethtool to dynamically turn on and off this function.
2. nanosecond precision is ok.
Thanks.
Quoted 74 lines
Quoted 74 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex +7
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet. + \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
--
2.27.0
Quoted 8 lines
Quoted 4 lines
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 19 lines · Shuyi Cheng
Quoted 16 lines · Xuan Zhuo
Quoted 13 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Thanks and looking forward to your response!
Quoted 7 lines
Quoted 5 lines
1. Do we need to dynamically turn on and off this function?
2. What is the unit of tstamp here?Thanks.
1. yes, we could use ethtool to dynamically turn on and off this function.
But at present, you don't support dynamic modification, do you?
Quoted 2 lines
2. nanosecond precision is ok.
Please specify this in the spec.
Thanks.
Quoted 85 lines
Thanks.
Quoted 82 lines
Quoted 70 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex +7
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet. + \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
Quoted 8 lines
--
2.27.0---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 23 lines · Xuan Zhuo
Quoted 22 lines · Shuyi Cheng
Quoted 19 lines · Xuan Zhuo
Quoted 12 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Quoted 1 line
Thanks and looking forward to your response!
1. Do we need to dynamically turn on and off this function?
2. What is the unit of tstamp here?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Thanks.
1. yes, we could use ethtool to dynamically turn on and off this function.
But at present, you don't support dynamic modification, do you?
Yes, i will add it.
Thanks.
Quoted 93 lines
Quoted 2 lines
2. nanosecond precision is ok.
Please specify this in the spec.
Thanks.
Quoted 85 lines
Thanks.
Quoted 82 lines
Quoted 70 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex +7
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet. + \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
Quoted 8 lines
--
2.27.0---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 3 lines
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 13 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Quoted 1 line
Thanks and looking forward to your response!
While at it, do we need a tx timestamp as well?
Quoted 47 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).
content.tex
Quoted 6 lines
content.tex +6
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet.
What kind of time should we use? Willem tried to propose something like this via TAI:
https://lists.linuxfoundation.org/pipermail/virtualization/2021-February/052476.html
Thanks
Quoted 16 lines
content.tex +1
-0+ \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
Quoted 8 lines
--
2.27.0---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 15 lines · Jason Wang
Quoted 13 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Quoted 4 lines
Quoted 1 line
Thanks and looking forward to your response!
While at it, do we need a tx timestamp as well?
We have not encountered network jitter in packets from driver to device. For now, rx timestamp is more valuable.
Quoted 57 lines
Quoted 47 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex
Quoted 6 lines
content.tex +6
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet.What kind of time should we use? Willem tried to propose something like this via TAI:
Quoted 3 lines
https://lists.linuxfoundation.org/pipermail/virtualization/2021-February/052476.html
Thanks
We calculate the jitter by the time difference between the two adjacent packets, that is
jitter = DriverTime(P2) - DriverTime(P1) - (DeviceTime(P2) - DeviceTime(P1))
P1,P2 means packet
DriverTime(Px) means the time from the Px packet to the virtio driver,
DeviceTime (Px) means the time from the Px packet to the virtio device, which is the tstamp field in virtio_net_hdr
Therefore, We may not specify the clock type. If the virtio device is hardware, it may be the hardware's own clock. If the virtio device is qemu, it may be CLOCK_MONOTONIC, TAI or other types.
Quoted 17 lines
Quoted 17 lines
content.tex +1
-0+ \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
Quoted 8 lines
Quoted 8 lines
--
2.27.0---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 19 lines · Shuyi Cheng
Quoted 15 lines · Jason Wang
Quoted 13 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Thanks and looking forward to your response!
While at it, do we need a tx timestamp as well?
We have not encountered network jitter in packets from driver to device. For now, rx timestamp is more valuable.
Well, it doesn't mean it can't happen in other places, I'd suggest adding it for symmetry.
Quoted 58 lines
Quoted 58 lines
Quoted 48 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex
Quoted 6 lines
content.tex +6
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet.What kind of time should we use? Willem tried to propose something like this via TAI:
Quoted 9 lines
Quoted 3 lines
https://lists.linuxfoundation.org/pipermail/virtualization/2021-February/052476.html
Thanks
We calculate the jitter by the time difference between the two adjacent packets, that is
jitter = DriverTime(P2) - DriverTime(P1) -
(DeviceTime(P2) - DeviceTime(P1))
How can you guarantee this works after migration? E.g P2 is received after migration.
And what's more important, let's try to make the feature general by not limiting the use case for jitter calculation only.
Thanks
Quoted 31 lines
P1,P2 means packet
DriverTime(Px) means the time from the Px packet to the virtio driver, DeviceTime (Px) means the time from the Px packet to the virtio device, which is the tstamp field invirtio_net_hdrTherefore, We may not specify the clock type. If the virtio device is hardware, it may be the hardware's own clock. If the virtio device is qemu, it may be
CLOCK_MONOTONIC, TAI or other types.Quoted 21 lines
Quoted 21 lines
content.tex +1
-0+ \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
--
2.27.0
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Quoted 23 lines · Jason Wang
Quoted 21 lines · Shuyi Cheng
Quoted 17 lines · Jason Wang
Quoted 14 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Thanks and looking forward to your response!
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
While at it, do we need a tx timestamp as well?
We have not encountered network jitter in packets from driver to device. For now, rx timestamp is more valuable.
Well, it doesn't mean it can't happen in other places, I'd suggest adding it for symmetry.
Ok, i'm pleasure to add tx tstamp.
Quoted 68 lines
Quoted 58 lines
Quoted 58 lines
Quoted 48 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex
Quoted 6 lines
content.tex +6
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet.What kind of time should we use? Willem tried to propose something like this via TAI:
Quoted 9 lines
Quoted 3 lines
https://lists.linuxfoundation.org/pipermail/virtualization/2021-February/052476.html
Thanks
We calculate the jitter by the time difference between the two adjacent packets, that is
jitter = DriverTime(P2) - DriverTime(P1) -
(DeviceTime(P2) - DeviceTime(P1))
Quoted 7 lines
How can you guarantee this works after migration? E.g P2 is received after migration.
And what's more important, let's try to make the feature general by not limiting the use case for jitter calculation only.
Thanks >
Yes, very convincing, does need to be more generic, i'll look into it.
Thanks.
Quoted 31 lines
Quoted 31 lines
P1,P2 means packet
DriverTime(Px) means the time from the Px packet to the virtio driver, DeviceTime (Px) means the time from the Px packet to the virtio device, which is the tstamp field invirtio_net_hdrTherefore, We may not specify the clock type. If the virtio device is hardware, it may be the hardware's own clock. If the virtio device is qemu, it may be
CLOCK_MONOTONIC, TAI or other types.Quoted 21 lines
Quoted 21 lines
content.tex +1
-0+ \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
--
2.27.0
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
A message that is not in the archive (sent off-list or not yet received): CA+FuTSdg8KZK=4fohHBQx_uyv1bcoU0D2hY1btPM=aPqKNt2vg@mail.gmail.com
Quoted 34 lines · Willem de Bruijn
Quoted 24 lines · Jason Wang
Quoted 21 lines · Shuyi Cheng
Quoted 17 lines · Jason Wang
Quoted 14 lines · Shuyi Cheng
This patch introduces
VIRTIO_NET_F_RX_TSTAMPto enhance the observability of network packet delay between virtio device and virtio driver.We have encountered many network jitter problems from virtio device to virtio driver in the production environment. Due to the lack of relevant indicators in this path, we often spend a lot of energy to locate such problems. If the virtio device can provide the packet receiving timestamp, then we can easily calculate the network jitter index between the virtio device and the virtio driver. When such a problem is encountered again, it is easy to determine the problem boundary.
Thanks and looking forward to your response!
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
While at it, do we need a tx timestamp as well?
We have not encountered network jitter in packets from driver to device. For now, rx timestamp is more valuable.
Well, it doesn't mean it can't happen in other places, I'd suggest adding it for symmetry.
Quoted 6 lines
I included both previously in an RFC patch series:
https://lists.linuxfoundation.org/pipermail/virtualization/2021-February/052424.html
Ended up not sending that for inclusion due to lack of a device support. Maybe it can come in handy now.
Nice work! I studied it carefully, it seems that there are some problems in the implementation of tx tstamp that need to be solved. Do you have any plans to release the third version?
Thanks.
Quoted 107 lines
Quoted 107 lines
Quoted 58 lines
Quoted 58 lines
Quoted 48 lines
Signed-off-by Shuyi Cheng <[email protected]>--- content.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+)content.tex +0
-0@@ -3097,6 +3097,8 @@ \subsection{Feature bits}\label{sec:Device Types /Network Device / Feature bits
\item[VIRTIO_NET_F_HASH_REPORT(57)] Device can report per-packet hash
value and a type of calculated hash.+\item[VIRTIO_NET_F_RX_TSTAMP(58)] Device can timestamp received packet. +
\item[VIRTIO_NET_F_GUEST_HDRLEN(59)] Driver can provide the exact
\field{hdr_len}
value. Device benefits from knowing the exact header length.content.tex +0
-0@@ -3371,6 +3373,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4content.tex +1
-0+#define VIRTIO_NET_HDR_F_TSTAMP 8 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1@@ -3387,6 +3390,7 @@ \subsection{Device Operation}\label{sec:DeviceTypes / Network Device / Device O
le32hash_value; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16hash_report; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)
le16padding_reserved; (Only ifVIRTIO_NET_F_HASH_REPORT
negotiated)content.tex +1
-0+ le64 tstamp; (Only if VIRITO_NET_F_RX_TSTAMP negotiated) }; \end{lstlisting}@@ -3809,6 +3813,13 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
checksum (in case of multiple encapsulated protocols, one level of checksums is validated).content.tex
Quoted 6 lines
content.tex +6
-0+If VIRTIO_NET_F_RX_TSTAMP was not negotiated, the device MUST not set +VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}. + +If VIRTIO_NET_F_RX_TSTAMP was negotiated, the device MUST also +set VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags}, +set \field{tstamp} to time to receive the packet.What kind of time should we use? Willem tried to propose something like this via TAI:
Quoted 9 lines
Quoted 3 lines
https://lists.linuxfoundation.org/pipermail/virtualization/2021-February/052476.html
Thanks
We calculate the jitter by the time difference between the two adjacent packets, that is
jitter = DriverTime(P2) - DriverTime(P1) -
(DeviceTime(P2) - DeviceTime(P1))How can you guarantee this works after migration? E.g P2 is received after migration.
And what's more important, let's try to make the feature general by not limiting the use case for jitter calculation only.
Thanks
Quoted 31 lines
P1,P2 means packet
DriverTime(Px) means the time from the Px packet to the virtio driver, DeviceTime (Px) means the time from the Px packet to the virtio device, which is the tstamp field invirtio_net_hdrTherefore, We may not specify the clock type. If the virtio device is hardware, it may be the hardware's own clock. If the virtio device is qemu, it may be
CLOCK_MONOTONIC, TAI or other types.Quoted 21 lines
Quoted 21 lines
content.tex +1
-0+ \drivernormative{\paragraph}{Processing of Incoming Packets}{Device Types / Network Device / Device Operation / Processing of Incoming Packets}@@ -3831,6 +3842,9 @@ \subsubsection{Processing of IncomingPackets}\label{sec:Device Types / Network
VIRTIO_NET_HDR_F_DATA_VALIDis set, the driver MUST NOT rely on the packet checksum being correct.content.tex +3
-0+If VIRTIO_NET_HDR_F_TSTAMP bit in \field{flags} is not set, the +driver MUST NOT use the \field{tstamp}. + \paragraph{Hash calculation for incoming packets} \label{sec:Device Types / Network Device / Device Operation /Processing of Incoming Packets / Hash calculation for incoming packets}
--
2.27.0
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]