From: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: virtio-comment@lists.linux.dev, mst@redhat.com,
cohuck@redhat.com, shahafs@nvidia.com
Subject: Re: [PATCH 3/3] virtio-net: Define cvq configuration related device parts
Date: Fri, 18 Oct 2024 18:24:45 +0200 [thread overview]
Message-ID: <ZxKLzVV94VW3utAh@fedora> (raw)
In-Reply-To: <20241018131741.443635-4-parav@nvidia.com>
On Fri, Oct 18, 2024 at 04:17:41PM +0300, Parav Pandit wrote:
> virtio net driver sends the control virtqueue commands for
> device configuration. Such driver configuration is currently
> not captured in the device parts.
>
> This series adds several of such device parts which represents
> the network device specific configuration.
>
> It is done by utilizing the existing device parts structure.
> A new generic selector format is added to enable device type
> specific device parts.
>
> This series also reuses the existing control virtqueue command
> structures, fields, and values to define the network device parts.
>
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/209
> Signed-off-by: Parav Pandit <parav@nvidia.com>
> ---
> device-types/net/description.tex | 90 ++++++++++++++++++++++++++++++++
> 1 file changed, 90 insertions(+)
>
> diff --git a/device-types/net/description.tex b/device-types/net/description.tex
> index e45ecbd..a5c6975 100644
> --- a/device-types/net/description.tex
> +++ b/device-types/net/description.tex
> @@ -433,6 +433,96 @@ \subsection{Device resource objects}\label{sec:Device Types / Network Device / D
> \hline
> \end{tabularx}
>
> +\subsection{Device parts}\label{sec:Device Types / Network Device / Device parts}
> +
> +Network device parts represent the configuration done by the driver using control
> +virtqueue commands. Network device part is in the format of
> +\field{struct virtio_dev_part}.
> +
> +\begin{tabularx}{\textwidth}{ |l||l|X| }
> +\hline
> +Type & Name & Description \\
> +\hline \hline
> +0x200 & VIRTIO_NET_DEV_PART_CVQ_CFG_PART & Represents device configuration done through a control virtqueue command, see \ref{sec:Device Types / Network Device / Device parts / VIRTIO-NET-DEV-PART-CVQ-CFG-PART} \\
> +\hline
> +0x201 - 0x5FF & - & reserved for future \\
> +\hline
> +\hline
> +\end{tabularx}
> +
> +\subsubsection{VIRTIO_NET_DEV_PART_CVQ_CFG_PART}\label{sec:Device Types / Network Device / Device parts / VIRTIO-NET-DEV-PART-CVQ-CFG-PART}
> +
> +For VIRTIO_NET_DEV_PART_CVQ_CFG_PART, \field{part_type} is set to 0x200. The
> +VIRTIO_NET_DEV_PART_CVQ_CFG_PART part indicates configuration performed by the
> +driver using a control virtqueue command.
> +
> +\begin{lstlisting}
> +struct virtio_net_dev_part_cvq_selector {
> + u8 class;
> + u8 command;
> + u8 reserved[6];
> +};
> +\end{lstlisting}
> +
> +There is one device part of type VIRTIO_NET_DEV_PART_CVQ_CFG_PART for each
> +individual configuration. Each part is identified by a unique selector value.
> +The selector, \field{device_type_raw}, is in the format
> +\field{struct virtio_net_dev_part_cvq_selector}.
> +
> +The selector consists of two fields: \field{class} and \field{command}. These
> +fields correspond to the \field{class} and \field{command} defined in
> +\field{struct virtio_net_ctrl}, as described in the relevant sections of
> +\ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue}.
> +
> +The value corresponding to each part’s selector follows the same format as the
> +respective \field{command-specific-data} described in the relevant sections of
> +\ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue}.
> +
> +For example, when the \field{class} is VIRTIO_NET_CTRL_MAC, the \field{command}
> +can be either VIRTIO_NET_CTRL_MAC_TABLE_SET or VIRTIO_NET_CTRL_MAC_ADDR_SET;
> +when \field{command} is set to VIRTIO_NET_CTRL_MAC_TABLE_SET, \field{value}
> +is in the format of \field{struct virtio_net_ctrl_mac}.
> +
> +Supported selctors are listed in the table:
s/selctors/selectors
> +
> +\begin{tabularx}{\textwidth}{ |l|X| }
> +\hline
> +Class selector & Command selector \\
> +\hline \hline
> +VIRTIO_NET_CTRL_RX & VIRTIO_NET_CTRL_RX_PROMISC \\
> +\hline
> +VIRTIO_NET_CTRL_RX & VIRTIO_NET_CTRL_RX_ALLMULTI \\
> +\hline
> +VIRTIO_NET_CTRL_RX & VIRTIO_NET_CTRL_RX_ALLUNI \\
> +\hline
> +VIRTIO_NET_CTRL_RX & VIRTIO_NET_CTRL_RX_NOMULTI \\
> +\hline
> +VIRTIO_NET_CTRL_RX & VIRTIO_NET_CTRL_RX_NOUNI \\
> +\hline
> +VIRTIO_NET_CTRL_RX & VIRTIO_NET_CTRL_RX_NOBCAST \\
> +\hline
> +VIRTIO_NET_CTRL_MAC & VIRTIO_NET_CTRL_MAC_TABLE_SET \\
> +\hline
> +VIRTIO_NET_CTRL_MAC & VIRTIO_NET_CTRL_MAC_ADDR_SET \\
> +\hline
> +VIRTIO_NET_CTRL_VLAN & VIRTIO_NET_CTRL_VLAN_ADD \\
> +\hline
> +VIRTIO_NET_CTRL_ANNOUNCE & VIRTIO_NET_CTRL_ANNOUNCE_ACK \\
> +\hline
> +VIRTIO_NET_CTRL_MQ & VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET \\
> +\hline
> +VIRTIO_NET_CTRL_MQ & VIRTIO_NET_CTRL_MQ_RSS_CONFIG \\
> +\hline
> +VIRTIO_NET_CTRL_MQ & VIRTIO_NET_CTRL_MQ_HASH_CONFIG \\
> +\hline
> +\hline
> +\end{tabularx}
> +
> +For command selector VIRTIO_NET_CTRL_VLAN_ADD, device part consists of a whole
> +VLAN table.
> +
> +\field{reserved} is reserved and set to zero.
> +
> \subsection{Device Operation}\label{sec:Device Types / Network Device / Device Operation}
>
> Packets are transmitted by placing them in the
> --
> 2.34.1
>
Reviewed-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
next prev parent reply other threads:[~2024-10-18 16:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 13:17 [PATCH 0/3] virtio-net: Define cvq configuration related device parts Parav Pandit
2024-10-18 13:17 ` [PATCH 1/3] device-parts: editorial: Replace duplicated part type Parav Pandit
2024-10-18 15:57 ` Matias Ezequiel Vara Larsen
2024-10-18 13:17 ` [PATCH 2/3] device-parts: Add device type specific raw selector Parav Pandit
2024-10-18 16:13 ` Matias Ezequiel Vara Larsen
2024-10-18 16:52 ` Parav Pandit
2024-10-21 17:58 ` Matias Ezequiel Vara Larsen
2024-10-18 13:17 ` [PATCH 3/3] virtio-net: Define cvq configuration related device parts Parav Pandit
2024-10-18 16:24 ` Matias Ezequiel Vara Larsen [this message]
2024-10-18 16:54 ` Parav Pandit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZxKLzVV94VW3utAh@fedora \
--to=mvaralar@redhat.com \
--cc=cohuck@redhat.com \
--cc=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=virtio-comment@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.