virtio-net: support the outer source port hash for UDP-encapsulated packets
PATCH 1/1 virtio-net: support the outer source port hash for UDP-encapsulated packets
UDP tunneling protocols usually identify a flow using the outer source UDP port, which is useful for processing UDP-encapsulated packets, such as increasing entropy for RSS queue selection or hashing the same flow to the same receive queue. Therefore, we extend it as a new RSS configuration.
--- device-types/net/description.tex | 49 ++++++++++++++++++++++++- device-types/net/device-conformance.tex | 1 + 2 files changed, 48 insertions(+), 2 deletions(-)
device-types/net/description.tex +47 -2
@@ -88,6 +88,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT(50)] Device supports outer source port hash + for UDP-encapsulated packets. + \item[VIRTIO_NET_F_HASH_TUNNEL(51)] Device supports inner header hash for encapsulated packets. \item[VIRTIO_NET_F_VQ_NOTF_COAL(52)] Device supports virtqueue notification coalescing.
@@ -150,6 +153,7 @@ \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device \item[VIRTIO_NET_F_RSS] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_VQ_NOTF_COAL] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_HASH_TUNNEL] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. \end{description} \subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Network Device / Feature bits / Legacy Interface: Feature bits}
@@ -927,11 +931,29 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_TYPE_UDP_EX (1 << 8) \end{lstlisting} +A UDP-encapsulated packet uses UDP as the transport protocol in the outer header +\ref{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / Encapsulated packet}. +UDP tunneling protocols usually use the outer source UDP port to identify a specific flow. +The hash calculated over the outer source UDP port can thus be used by the device to queue these different flows +on different receive queues or queue the same specific flow on the same receive queue. + +If additionally the feature VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated, +the following hash types are applicable for UDP-encapsulated packets: +\begin{lstlisting} +#define VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT (1 << 9) +#define VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT (1 << 10) +\end{lstlisting} + \subparagraph{IPv4 packets} \label{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / IPv4 packets} The device calculates the hash on IPv4 packets according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv4 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has a TCP header, the hash is calculated over the following fields: \begin{itemize} \item Source IP address
@@ -961,7 +983,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets without extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize} \item Source IPv6 address
@@ -991,6 +1018,11 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets with extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} \item If VIRTIO_NET_HASH_TYPE_TCP_EX is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize}
@@ -1139,8 +1171,21 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 #define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 #define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 +#define VIRTIO_NET_HASH_REPORT_UDPv4_TUNNEL_SRCPORT 10 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ +#define VIRTIO_NET_HASH_REPORT_UDPv6_TUNNEL_SRCPORT 11 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ \end{lstlisting} +\devicenormative{\subparagraph}{Outer Source UDP Port}{Device Types / Network Device / Device Operation / Outer Source UDP Port} + +When all the following cases occur: +\begin{itemize} +\item Both VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT and VIRTIO_NET_F_HASH_TUNNEL are negotiated. +\item A received UDP-encapsulated packet's outer header matches one of the encapsulation types enabled in \field{enabled_tunnel_types}. +\item VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv4 header or + VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv6 header. +\end{itemize} +the device MUST calculate the hash over the inner header rather than the outer source UDP port. + \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ is
device-types/net/device-conformance.tex +1 -0
@@ -7,6 +7,7 @@ \item \ref{devicenormative:Device Types / Network Device / Device Operation / Packet Transmission} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Setting Up Receive Buffers} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets} +\item \ref{devicenormative:Device Types / Network Device / Device Operation / Outer Source UDP Port} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}
Signature · 18 lines
2.19.1.6.gb485710b This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: [email protected] Unsubscribe: [email protected] List help: [email protected] List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/
Quoted 7 lines · Heng Qi
UDP tunneling protocols usually identify a flow using the outer source UDP port, which is useful for processing UDP-encapsulated packets, such as increasing entropy for RSS queue selection or hashing the same flow to the same receive queue. Therefore, we extend it as a new RSS configuration.
Signed-off-by Heng Qi <[email protected]>Reviewed-by Xuan Zhuo <[email protected]>
Oh, Michael. This proposal is from you, sorry I forgot to tag:
I will add this in the next version.
Thanks.
Quoted 111 lines
--- device-types/net/description.tex | 49 ++++++++++++++++++++++++- device-types/net/device-conformance.tex | 1 + 2 files changed, 48 insertions(+), 2 deletions(-)device-types/net/description.tex +47
-2@@ -88,6 +88,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT(50)] Device supports outer source port hash + for UDP-encapsulated packets. + \item[VIRTIO_NET_F_HASH_TUNNEL(51)] Device supports inner header hash for encapsulated packets. \item[VIRTIO_NET_F_VQ_NOTF_COAL(52)] Device supports virtqueue notification coalescing.@@ -150,6 +153,7 @@ \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device \item[VIRTIO_NET_F_RSS] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_VQ_NOTF_COAL] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_HASH_TUNNEL] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. \end{description} \subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Network Device / Feature bits / Legacy Interface: Feature bits}@@ -927,11 +931,29 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_TYPE_UDP_EX (1 << 8) \end{lstlisting} +A UDP-encapsulated packet uses UDP as the transport protocol in the outer header +\ref{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / Encapsulated packet}. +UDP tunneling protocols usually use the outer source UDP port to identify a specific flow. +The hash calculated over the outer source UDP port can thus be used by the device to queue these different flows +on different receive queues or queue the same specific flow on the same receive queue. + +If additionally the feature VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated, +the following hash types are applicable for UDP-encapsulated packets: +\begin{lstlisting} +#define VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT (1 << 9) +#define VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT (1 << 10) +\end{lstlisting} + \subparagraph{IPv4 packets} \label{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / IPv4 packets} The device calculates the hash on IPv4 packets according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv4 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has a TCP header, the hash is calculated over the following fields: \begin{itemize} \item Source IP address@@ -961,7 +983,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets without extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize} \item Source IPv6 address@@ -991,6 +1018,11 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets with extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} \item If VIRTIO_NET_HASH_TYPE_TCP_EX is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize}@@ -1139,8 +1171,21 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 #define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 #define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 +#define VIRTIO_NET_HASH_REPORT_UDPv4_TUNNEL_SRCPORT 10 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ +#define VIRTIO_NET_HASH_REPORT_UDPv6_TUNNEL_SRCPORT 11 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ \end{lstlisting} +\devicenormative{\subparagraph}{Outer Source UDP Port}{Device Types / Network Device / Device Operation / Outer Source UDP Port} + +When all the following cases occur: +\begin{itemize} +\item Both VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT and VIRTIO_NET_F_HASH_TUNNEL are negotiated. +\item A received UDP-encapsulated packet's outer header matches one of the encapsulation types enabled in \field{enabled_tunnel_types}. +\item VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv4 header or + VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv6 header. +\end{itemize} +the device MUST calculate the hash over the inner header rather than the outer source UDP port. + \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ isdevice-types/net/device-conformance.tex +0
-0
device-types/net/device-conformance.tex line 13
Quoted 7 lines
device-types/net/device-conformance.tex +1
-0@@ -7,6 +7,7 @@ \item \ref{devicenormative:Device Types / Network Device / Device Operation / Packet Transmission} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Setting Up Receive Buffers} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets} +\item \ref{devicenormative:Device Types / Network Device / Device Operation / Outer Source UDP Port} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Quoted 4 lines · Heng Qi
UDP tunneling protocols usually identify a flow using the outer source UDP port, which is useful for processing UDP-encapsulated packets, such as increasing entropy for RSS queue selection or hashing the same flow to the same receive queue. Therefore, we extend it as a new RSS configuration.
Hi Michael. Any comments on this please?
Thanks!
Quoted 113 lines
Signed-off-by Heng Qi <[email protected]>Reviewed-by Xuan Zhuo <[email protected]>--- device-types/net/description.tex | 49 ++++++++++++++++++++++++- device-types/net/device-conformance.tex | 1 + 2 files changed, 48 insertions(+), 2 deletions(-)device-types/net/description.tex +47
-2@@ -88,6 +88,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT(50)] Device supports outer source port hash + for UDP-encapsulated packets. + \item[VIRTIO_NET_F_HASH_TUNNEL(51)] Device supports inner header hash for encapsulated packets. \item[VIRTIO_NET_F_VQ_NOTF_COAL(52)] Device supports virtqueue notification coalescing.@@ -150,6 +153,7 @@ \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device \item[VIRTIO_NET_F_RSS] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_VQ_NOTF_COAL] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_HASH_TUNNEL] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. \end{description} \subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Network Device / Feature bits / Legacy Interface: Feature bits}@@ -927,11 +931,29 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_TYPE_UDP_EX (1 << 8) \end{lstlisting} +A UDP-encapsulated packet uses UDP as the transport protocol in the outer header +\ref{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / Encapsulated packet}. +UDP tunneling protocols usually use the outer source UDP port to identify a specific flow. +The hash calculated over the outer source UDP port can thus be used by the device to queue these different flows +on different receive queues or queue the same specific flow on the same receive queue. + +If additionally the feature VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated, +the following hash types are applicable for UDP-encapsulated packets: +\begin{lstlisting} +#define VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT (1 << 9) +#define VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT (1 << 10) +\end{lstlisting} + \subparagraph{IPv4 packets} \label{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / IPv4 packets} The device calculates the hash on IPv4 packets according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv4 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has a TCP header, the hash is calculated over the following fields: \begin{itemize} \item Source IP address@@ -961,7 +983,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets without extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize} \item Source IPv6 address@@ -991,6 +1018,11 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets with extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} \item If VIRTIO_NET_HASH_TYPE_TCP_EX is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize}@@ -1139,8 +1171,21 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 #define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 #define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 +#define VIRTIO_NET_HASH_REPORT_UDPv4_TUNNEL_SRCPORT 10 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ +#define VIRTIO_NET_HASH_REPORT_UDPv6_TUNNEL_SRCPORT 11 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ \end{lstlisting} +\devicenormative{\subparagraph}{Outer Source UDP Port}{Device Types / Network Device / Device Operation / Outer Source UDP Port} + +When all the following cases occur: +\begin{itemize} +\item Both VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT and VIRTIO_NET_F_HASH_TUNNEL are negotiated. +\item A received UDP-encapsulated packet's outer header matches one of the encapsulation types enabled in \field{enabled_tunnel_types}. +\item VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv4 header or + VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv6 header. +\end{itemize} +the device MUST calculate the hash over the inner header rather than the outer source UDP port. + \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ isdevice-types/net/device-conformance.tex +0
-0
device-types/net/device-conformance.tex line 13
Quoted 7 lines
device-types/net/device-conformance.tex +1
-0@@ -7,6 +7,7 @@ \item \ref{devicenormative:Device Types / Network Device / Device Operation / Packet Transmission} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Setting Up Receive Buffers} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets} +\item \ref{devicenormative:Device Types / Network Device / Device Operation / Outer Source UDP Port} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Quoted 5 lines · Heng Qi
UDP tunneling protocols usually identify a flow using the outer source UDP port, which is useful for processing UDP-encapsulated packets, such as increasing entropy for RSS queue selection or hashing the same flow to the same receive queue. Therefore, we extend it as a new RSS configuration.
that's not a real motivation is it? it's already included for increasing entropy.
the real motivation is ignoring source and destination ip because they can change if tunneling gateway changes, right?
Quoted 37 lines
Signed-off-by Heng Qi <[email protected]>Reviewed-by Xuan Zhuo <[email protected]>--- device-types/net/description.tex | 49 ++++++++++++++++++++++++- device-types/net/device-conformance.tex | 1 + 2 files changed, 48 insertions(+), 2 deletions(-)device-types/net/description.tex +8
-0@@ -88,6 +88,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT(50)] Device supports outer source port hash + for UDP-encapsulated packets. + \item[VIRTIO_NET_F_HASH_TUNNEL(51)] Device supports inner header hash for encapsulated packets. \item[VIRTIO_NET_F_VQ_NOTF_COAL(52)] Device supports virtqueue notification coalescing.@@ -150,6 +153,7 @@ \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device \item[VIRTIO_NET_F_RSS] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_VQ_NOTF_COAL] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_HASH_TUNNEL] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. \end{description} \subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Network Device / Feature bits / Legacy Interface: Feature bits}@@ -927,11 +931,29 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_TYPE_UDP_EX (1 << 8) \end{lstlisting} +A UDP-encapsulated packet uses UDP as the transport protocol in the outer header +\ref{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / Encapsulated packet}. +UDP tunneling protocols usually use the outer source UDP port to identify a specific flow. +The hash calculated over the outer source UDP port
Quoted 1 line
can thus be used by the device to queue these different flows
what does this "can be used" mean here is unclear.
Quoted 1 line
+on different receive queues or queue the same specific flow on the same receive queue.
different from what? same as what?
Quoted 4 lines
device-types/net/description.tex +4
-0+ +If additionally the feature VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated, +the following hash types are applicable for UDP-encapsulated packets: +\begin{lstlisting}
device-types/net/description.tex \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network · line 951
Quoted 10 lines
device-types/net/description.tex +5
-1+#define VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT (1 << 9) +#define VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT (1 << 10) +\end{lstlisting} + \subparagraph{IPv4 packets} \label{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / IPv4 packets} The device calculates the hash on IPv4 packets according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set and a received encapsulated
what makes the packet "encapsulated" here is unclear.
Quoted 70 lines
device-types/net/description.tex +29
-1+packet has an outer UDPv4 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has a TCP header, the hash is calculated over the following fields: \begin{itemize} \item Source IP address@@ -961,7 +983,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets without extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize} \item Source IPv6 address@@ -991,6 +1018,11 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets with extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} \item If VIRTIO_NET_HASH_TYPE_TCP_EX is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize}@@ -1139,8 +1171,21 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 #define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 #define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 +#define VIRTIO_NET_HASH_REPORT_UDPv4_TUNNEL_SRCPORT 10 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ +#define VIRTIO_NET_HASH_REPORT_UDPv6_TUNNEL_SRCPORT 11 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ \end{lstlisting} +\devicenormative{\subparagraph}{Outer Source UDP Port}{Device Types / Network Device / Device Operation / Outer Source UDP Port} + +When all the following cases occur: +\begin{itemize} +\item Both VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT and VIRTIO_NET_F_HASH_TUNNEL are negotiated. +\item A received UDP-encapsulated packet's outer header matches one of the encapsulation types enabled in \field{enabled_tunnel_types}. +\item VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv4 header or + VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv6 header. +\end{itemize} +the device MUST calculate the hash over the inner header rather than the outer source UDP port. + \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ isdevice-types/net/device-conformance.tex +1
-0@@ -7,6 +7,7 @@ \item \ref{devicenormative:Device Types / Network Device / Device Operation / Packet Transmission} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Setting Up Receive Buffers} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets} +\item \ref{devicenormative:Device Types / Network Device / Device Operation / Outer Source UDP Port} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}Signature · 1 line
2.19.1.6.gb485710b
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
Quoted 7 lines · Michael S. Tsirkin
Quoted 5 lines · Heng Qi
UDP tunneling protocols usually identify a flow using the outer source UDP port, which is useful for processing UDP-encapsulated packets, such as increasing entropy for RSS queue selection or hashing the same flow to the same receive queue. Therefore, we extend it as a new RSS configuration.
Quoted 5 lines
that's not a real motivation is it? it's already included for increasing entropy.
the real motivation is ignoring source and destination ip because they can change if tunneling gateway changes, right?
Yes, I will rewrite the commit log with your comments.
Quoted 35 lines
Quoted 35 lines
Signed-off-by Heng Qi <[email protected]>Reviewed-by Xuan Zhuo <[email protected]>--- device-types/net/description.tex | 49 ++++++++++++++++++++++++- device-types/net/device-conformance.tex | 1 + 2 files changed, 48 insertions(+), 2 deletions(-)device-types/net/description.tex +4
-0@@ -88,6 +88,9 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits \item[VIRTIO_NET_F_CTRL_MAC_ADDR(23)] Set MAC address through control channel. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT(50)] Device supports outer source port hash + for UDP-encapsulated packets. + \item[VIRTIO_NET_F_HASH_TUNNEL(51)] Device supports inner header hash for encapsulated packets. \item[VIRTIO_NET_F_VQ_NOTF_COAL(52)] Device supports virtqueue notification coalescing.@@ -150,6 +153,7 @@ \subsubsection{Feature bit requirements}\label{sec:Device Types / Network Device \item[VIRTIO_NET_F_RSS] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_VQ_NOTF_COAL] Requires VIRTIO_NET_F_CTRL_VQ. \item[VIRTIO_NET_F_HASH_TUNNEL] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. +\item[VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT] Requires VIRTIO_NET_F_CTRL_VQ along with VIRTIO_NET_F_RSS or VIRTIO_NET_F_HASH_REPORT. \end{description} \subsubsection{Legacy Interface: Feature bits}\label{sec:Device Types / Network Device / Feature bits / Legacy Interface: Feature bits}@@ -927,11 +931,29 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_TYPE_UDP_EX (1 << 8) \end{lstlisting}
Quoted 7 lines
Quoted 5 lines
device-types/net/description.tex +4
-0+A UDP-encapsulated packet uses UDP as the transport protocol in the outer header +\ref{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / Encapsulated packet}. +UDP tunneling protocols usually use the outer source UDP port to identify a specific flow. +The hash calculated over the outer source UDP portcan thus be used by the device to queue these different flows
what does this "can be used" mean here is unclear.
For example, "can be used" when the same flow traverses different tunnels and has different outer source IPs.
Quoted 4 lines
Quoted 2 lines
+on different receive queues or queue the same specific flow on the same receive queue.
different from what? same as what?
different flows -> different queues, not different from something.
I'll rewrite this paragraph for more clarity.
Quoted 18 lines
Quoted 6 lines
device-types/net/description.tex +4
-0+ +If additionally the feature VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated, +the following hash types are applicable for UDP-encapsulated packets: +\begin{lstlisting}device-types/net/description.tex \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network · line 951
Quoted 10 lines
device-types/net/description.tex +5
-1+#define VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT (1 << 9) +#define VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT (1 << 10) +\end{lstlisting} + \subparagraph{IPv4 packets} \label{sec:Device Types / Network Device / Device Operation / Processing of Incoming Packets / Hash calculation for incoming packets / IPv4 packets} The device calculates the hash on IPv4 packets according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set and a received encapsulatedwhat makes the packet "encapsulated" here is unclear.
UDP tunneling protocols makes the packet "encapsulated".
Will modify in the next version.
Thanks!
Quoted 80 lines
Quoted 71 lines
device-types/net/description.tex +29
-1+packet has an outer UDPv4 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv4 is set and the packet has a TCP header, the hash is calculated over the following fields: \begin{itemize} \item Source IP address@@ -961,7 +983,12 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets without extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} -\item If VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} +\item Else if VIRTIO_NET_HASH_TYPE_TCPv6 is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize} \item Source IPv6 address@@ -991,6 +1018,11 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network The device calculates the hash on IPv6 packets with extension headers according to 'Enabled hash types' bitmask as follows: \begin{itemize} +\item If additionally VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set and a received encapsulated +packet has an outer UDPv6 header, the hash is calculated over the following fields: +\begin{itemize} +\item Outer source UDP port +\end{itemize} \item If VIRTIO_NET_HASH_TYPE_TCP_EX is set and the packet has a TCPv6 header, the hash is calculated over the following fields: \begin{itemize}@@ -1139,8 +1171,21 @@ \subsubsection{Processing of Incoming Packets}\label{sec:Device Types / Network #define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 #define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 #define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 +#define VIRTIO_NET_HASH_REPORT_UDPv4_TUNNEL_SRCPORT 10 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ +#define VIRTIO_NET_HASH_REPORT_UDPv6_TUNNEL_SRCPORT 11 /* Only if additionally VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT was negotiated */ \end{lstlisting} +\devicenormative{\subparagraph}{Outer Source UDP Port}{Device Types / Network Device / Device Operation / Outer Source UDP Port} + +When all the following cases occur: +\begin{itemize} +\item Both VIRTIO_NET_F_HASH_UDP_TUNNEL_SRCPORT and VIRTIO_NET_F_HASH_TUNNEL are negotiated. +\item A received UDP-encapsulated packet's outer header matches one of the encapsulation types enabled in \field{enabled_tunnel_types}. +\item VIRTIO_NET_HASH_TYPE_UDPv4_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv4 header or + VIRTIO_NET_HASH_TYPE_UDPv6_TUNNEL_SRCPORT is set in \field{hash_types} and a received encapsulated packet has an outer UDPv6 header. +\end{itemize} +the device MUST calculate the hash over the inner header rather than the outer source UDP port. + \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue} The driver uses the control virtqueue (if VIRTIO_NET_F_CTRL_VQ isdevice-types/net/device-conformance.tex +1
-0@@ -7,6 +7,7 @@ \item \ref{devicenormative:Device Types / Network Device / Device Operation / Packet Transmission} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Setting Up Receive Buffers} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets} +\item \ref{devicenormative:Device Types / Network Device / Device Operation / Outer Source UDP Port} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Packet Receive Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering} \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}Signature · 1 line
2.19.1.6.gb485710bThis publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Quoted 8 lines
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.
Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/