virtio-comment.lists.oasis-open.org archive mirror
 help / color / mirror / Atom feed
From: Parav Pandit <parav@nvidia.com>
To: <virtio-comment@lists.oasis-open.org>, <mst@redhat.com>,
	<cohuck@redhat.com>
Cc: <sburla@marvell.com>, <shahafs@nvidia.com>, <maorg@nvidia.com>,
	<yishaih@nvidia.com>, <lingshan.zhu@intel.com>,
	<jasowang@redhat.com>, "Parav Pandit" <parav@nvidia.com>
Subject: [virtio-comment] [PATCH v1] virtio-net: Add device migration context fields
Date: Fri, 3 Nov 2023 14:16:24 +0200	[thread overview]
Message-ID: <20231103121624.1901509-1-parav@nvidia.com> (raw)

Expand device migration context for fields such as
mac table, vlan table, mq config, rss config.

All of them utilizes already defined infrastructure.

This patch is on top of [1].

[1] https://lists.oasis-open.org/archives/virtio-comment/202310/msg00469.html

Signed-off-by: Parav Pandit <parav@nvidia.com>
---
changelog:
v0->v1:
- addressed comments from Michael for vlan to explain
- avoided new file of device-context.tex
- dropped adding the description to vlan section of net specification as
  entries are added one by one in cvq command.
- extend further for vq notifications coalescing context
- fix label with reference
- added num_entries to self describe the structure
---
 device-context.tex               |  2 +-
 device-types/net/description.tex | 82 ++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/device-context.tex b/device-context.tex
index ab19fc9..348bb25 100644
--- a/device-context.tex
+++ b/device-context.tex
@@ -57,7 +57,7 @@ \section{Device Context}\label{sec:Basic Facilities of a Virtio Device / Device
 \hline
 0x1000 & VIRTIO_DEV_CTX_DEV_CFG & Provides device specific configuration \\
 \hline
-0x1001 - 0x1FFF & - & Device type specific range reserved for future \\
+0x1001 - 0x1FFF & - & Device type specific range defined by the specific device type \\
 \hline
 \hline
 0x2000 - 0xFFFF & - & Reserved for future \\
diff --git a/device-types/net/description.tex b/device-types/net/description.tex
index 76585b0..8c7e626 100644
--- a/device-types/net/description.tex
+++ b/device-types/net/description.tex
@@ -1805,6 +1805,88 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
 
 Upon reset, a device MUST initialize all coalescing parameters to 0.
 
+\subsection{Device Context}\label{sec:Device Types / Network Device / Device Operation / Device Context}
+
+\begin{table}
+\caption{\label{tab:Network Device Context Fields} Network Device Context Fields}
+\begin{tabularx}{\textwidth}{ |l||l|X| }
+\hline
+Type & Name & Description \\
+\hline \hline
+\hline
+0x1001 & VIRTIO_DEV_CTX_NET_MAC_ADDR_FILTER_TABLE & Provides MAC Address filter table \\
+\hline
+0x1002 & VIRTIO_DEV_CTX_NET_VLAN_FILTER_TABLE & Provides VLAN filter table \\
+\hline
+0x1003 & VIRTIO_DEV_CTX_NET_MQ_PAIRS & Provides multi queue configuration \\
+\hline
+0x1004 & VIRTIO_DEV_CTX_NET_RSS_CONFIG & Provides RSS configuration \\
+\hline
+0x1005 & VIRTIO_DEV_CTX_VQ_NC & Provides virtqueue notifications Coalescing context \\
+\hline
+0x1006 - 0x1FFF & - & reserved for future \\
+\hline
+\hline
+\end{tabularx}
+\end{table}
+
+\subsubsection{MAC Address Filter Table Context}\label{sec:Device Types / Network Device / Device Operation / Device Context / MAC Address Filter Table Context}
+
+For the field VIRTIO_DEV_CTX_NET_MAC_TABLE, \field{type} is set to 0x1001.
+The \field{value} is in format of \field{struct virtio_net_ctrl_mac} as listed
+in section
+\ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Setting MAC Address Filtering}.
+The \field{length} is the length of \field{struct virtio_net_ctrl_mac} in bytes.
+
+\subsubsection{VLAN Filter Table Context}\label{sec:Device Types / Network Device / Device Operation / Device Context / VLAN Filter Table Context}
+
+For the field VIRTIO_DEV_CTX_NET_VLAN_FILTER_TABLE, \field{type} is set to 0x1002.
+The \field{value} is in format of \field{struct virtio_dev_ctx_net_vlan_table}.
+The \field{length} is the length of \field{struct virtio_dev_ctx_net_vlan_table} in bytes.
+
+\begin{lstlisting}
+struct virtio_dev_ctx_net_vlan_table {
+        le16 num_entries;
+        u8 reserved[6];
+        le16 vlan[];
+};
+\end{lstlisting}
+
+Each \field{vlan} entry corresponds to the VLAN added using the command VIRTIO_NET_CTRL_VLAN_ADD
+described in section \ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}.
+
+The \field{num_entries} indicates number of valid \field{vlan} entries.
+
+\subsubsection{Multiqueue Pairs Context}\label{sec:Device Types / Network Device / Device Operation / Device Context / Multiqueue Pairs Context}
+
+For the field VIRTIO_DEV_CTX_NET_MQ_PAIRS, \field{type} is set to 0x1003.
+The \field{value} is in format of \field{struct virtio_net_ctrl_mq_pairs_set} as listed
+in section
+\ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Automatic receive steering in multiqueue mode}.
+The \field{length} is the length of \field{struct virtio_net_ctrl_mq_pairs_set} in bytes.
+
+\subsubsection{Receive Side Scaling Context}\label{sec:Device Types / Network Device / Device Operation / Device Context / Receive Side Scaling Context}
+
+For the field VIRTIO_DEV_CTX_NET_RSS_CONFIG, \field{type} is set to 0x1004.
+The \field{value} is in format of \field{struct virtio_net_rss_config} as listed
+in section
+\ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Receive-side scaling (RSS) / Setting RSS parameters}.
+The \field{length} is the length of \field{struct virtio_net_rss_config} in bytes.
+
+\subsubsection{Virtqueue Notifications Coalescing Context}\label{sec:Device Types / Network Device / Device Operation / Device Context / Virtqueue Notifications Coalescing Context}
+
+For the field VIRTIO_DEV_CTX_NET_VQ_NC, \field{type} is set to 0x1005.
+The \field{value} is in format of \field{struct struct virtio_net_ctrl_coal_vq} as listed
+in section
+\ref{sec:Device Types / Network Device / Device Operation / Control Virtqueue / Notifications Coalescing}.
+The \field{length} is the length of \field{struct virtio_net_rss_config} in bytes.
+
+The device context may contain one or multiple entries of \field{VIRTIO_DEV_CTX_NET_VQ_NC}.
+
+For each of the enabled transmit and receive virtqueue the device context contains individual
+entry identified by its unique \field{vq_index} within
+\field{struct virtio_net_ctrl_coal_vq}.
+
 \subsubsection{Legacy Interface: Framing Requirements}\label{sec:Device
 Types / Network Device / Legacy Interface: Framing Requirements}
 
-- 
2.34.1


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: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
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/


                 reply	other threads:[~2023-11-03 12:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231103121624.1901509-1-parav@nvidia.com \
    --to=parav@nvidia.com \
    --cc=cohuck@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=maorg@nvidia.com \
    --cc=mst@redhat.com \
    --cc=sburla@marvell.com \
    --cc=shahafs@nvidia.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=yishaih@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).