Skip to contentSkip to conversation

virtio-network: Clarify VLAN filter table configuration

PATCH Superseded Parav Pandit 2 participants 3 messages Jan 3, 2023 – Jan 4, 2023

v3 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 virtio-network: Clarify VLAN filter table configuration

The filtering behavior of the VLAN filter commands is not very clear as discussed in thread [1].

Hence, add the command description and device requirements for it.

[1] https://www.mail-archive.com/[email protected]/msg912392.html

---
changelog:
v2->v3:
- corrected grammar
- simplified description for untagged packets
v1->v2:
- adapt to new file path
v0->v1:
- added missing conformance section link

---
 .../virtio-network/device-conformance.tex      |  1 +
 device-types/virtio-network/device.tex         | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
device-types/virtio-network/device-conformance.tex +1 -0
index c686377..54f6783 100644
@@ -9,6 +9,7 @@
 \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets}
 \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}
 \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Gratuitous Packet Sending}
 \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Automatic receive steering in multiqueue mode}
 \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Receive-side scaling (RSS) / RSS processing}
device-types/virtio-network/device.tex +18 -0
index e7cdd6f..ea4b524 100644
@@ -1210,6 +1210,24 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
 Both the VIRTIO_NET_CTRL_VLAN_ADD and VIRTIO_NET_CTRL_VLAN_DEL
 command take a little-endian 16-bit VLAN id as the command-specific-data.
 
+VIRTIO_NET_CTRL_VLAN_ADD command adds the specified VLAN to the VLAN
+filtering table.
+
+VIRTIO_NET_CTRL_VLAN_DEL command removes specified VLAN from the VLAN
+filtering table which was previously added using
+VIRTIO_NET_CTRL_VLAN_ADD command.
+
+\devicenormative{\subparagraph}{VLAN Filtering}{Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}
+
+When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device starts with
+an empty VLAN filtering table.
+
+When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device accepts all
+VLAN tagged packets whose VLAN tag is found in the VLAN filtering
+table; the device should drop all VLAN tagged packets whose VLAN tag
+is not found in the VLAN filtering table. The VLAN filtering table
+applies only to the VLAN tagged packets.
+
 \subparagraph{Legacy Interface: VLAN Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering / Legacy Interface: VLAN Filtering}
 When using the legacy interface, transitional devices and drivers
 MUST format the VLAN id
Signature · 18 lines
2.26.2


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/
#1 lore raw

Hi Parav,

Great write-up! Just a couple minor suggestions, please see below in line.

Quoted 44 lines · Parav Pandit

The filtering behavior of the VLAN filter commands is not very clear as discussed in thread [1].

Hence, add the command description and device requirements for it.

[1] https://www.mail-archive.com/[email protected]/msg912392.html

---
changelog:
v2->v3:
- corrected grammar
- simplified description for untagged packets
v1->v2:
- adapt to new file path
v0->v1:
- added missing conformance section link

---
  .../virtio-network/device-conformance.tex      |  1 +
  device-types/virtio-network/device.tex         | 18 ++++++++++++++++++
  2 files changed, 19 insertions(+)
device-types/virtio-network/device-conformance.tex +1 -0
index c686377..54f6783 100644
@@ -9,6 +9,7 @@
  \item \ref{devicenormative:Device Types / Network Device / Device Operation / Processing of Incoming Packets}
  \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}
  \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Gratuitous Packet Sending}
  \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Automatic receive steering in multiqueue mode}
  \item \ref{devicenormative:Device Types / Network Device / Device Operation / Control Virtqueue / Receive-side scaling (RSS) / RSS processing}
device-types/virtio-network/device.tex +1 -0
index e7cdd6f..ea4b524 100644
@@ -1210,6 +1210,24 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
  Both the VIRTIO_NET_CTRL_VLAN_ADD and VIRTIO_NET_CTRL_VLAN_DEL
  command take a little-endian 16-bit VLAN id as the command-specific-data.
 
+VIRTIO_NET_CTRL_VLAN_ADD command adds the specified VLAN to the VLAN

device-types/virtio-network/device.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 1223

Quoted 10 lines
device-types/virtio-network/device.tex +10 -0
+filtering table.
+
+VIRTIO_NET_CTRL_VLAN_DEL command removes specified VLAN from the VLAN
+filtering table which was previously added using
+VIRTIO_NET_CTRL_VLAN_ADD command.
+
+\devicenormative{\subparagraph}{VLAN Filtering}{Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering}
+
+When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device starts with
+an empty VLAN filtering table.

Should we mention this VLAN filtering table gets emptied on device reset?

device-types/virtio-network/device.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 1229

Quoted 6 lines
device-types/virtio-network/device.tex +6 -0
+
+When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device accepts all
+VLAN tagged packets whose VLAN tag is found in the VLAN filtering
+table; the device should drop all VLAN tagged packets whose VLAN tag
+is not found in the VLAN filtering table. The VLAN filtering table
+applies only to the VLAN tagged packets.

I know what you want to convey with simplified wording. Since VLAN filter table works differently with MAC address table (VIRTIO_NET_F_CTRL_MAC_ADDR), should we explicitly state that the assumed action without VLAN filter table is to pass VLAN tagged packet when the specific feature is not negotiated? Like:

...; if VIRTIO_NET_F_CTRL_VLAN is not negotiated, device does not have a VLAN filter table thus MUST NOT specifically drop VLAN tagged packets.

Regards,
-Siwei

device-types/virtio-network/device.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi · line 1233

Quoted 4 lines
device-types/virtio-network/device.tex +1 -0
+
  \subparagraph{Legacy Interface: VLAN Filtering}\label{sec:Device Types / Network Device / Device Operation / Control Virtqueue / VLAN Filtering / Legacy Interface: VLAN Filtering}
  When using the legacy interface, transitional devices and drivers
  MUST format the VLAN id

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

#2 lore raw
Quoted 71 lines

From: Si-Wei Liu <[email protected]>
Sent: Tuesday, January 3, 2023 8:49 PM

Hi Parav,

Great write-up! Just a couple minor suggestions, please see below in line.

Quoted 6 lines · Parav Pandit

The filtering behavior of the VLAN filter commands is not very clear as discussed in thread [1].

Hence, add the command description and device requirements for it.

[1] https://www.mail-archive.com/qemu-

[email protected]/msg912392.html

Quoted 23 lines

---
changelog:
v2->v3:
- corrected grammar
- simplified description for untagged packets
v1->v2:
- adapt to new file path
v0->v1:
- added missing conformance section link

---
  .../virtio-network/device-conformance.tex      |  1 +
  device-types/virtio-network/device.tex         | 18 ++++++++++++++++++
  2 files changed, 19 insertions(+)
device-types/virtio-network/device-conformance.tex +0 -0
index c686377..54f6783 100644

device-types/virtio-network/device-conformance.tex line 9

Quoted 1 line
device-types/virtio-network/device-conformance.tex +0 -0
@@ -9,6 +9,7 @@
  \item \ref{devicenormative:Device Types / Network Device / Device

Operation / Processing of Incoming Packets}

device-types/virtio-network/device-conformance.tex line 10

Quoted 1 line
device-types/virtio-network/device-conformance.tex +0 -0
  \item \ref{devicenormative:Device Types / Network Device / Device

Operation / Control Virtqueue / Packet Receive Filtering}

device-types/virtio-network/device-conformance.tex line 15

Quoted 5 lines
device-types/virtio-network/device-conformance.tex +2 -0
  \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}
  \item \ref{devicenormative:Device Types / Network Device / Device

Operation / Control Virtqueue / Gratuitous Packet Sending}

Quoted 1 line

\item \ref{devicenormative:Device Types / Network Device / Device

Operation / Control Virtqueue / Automatic receive steering in multiqueue mode}

device-types/virtio-network/device.tex \subsubsection{Control

Quoted 8 lines

\item \ref{devicenormative:Device Types / Network Device / Device
Operation / Control Virtqueue / Receive-side scaling (RSS) / RSS processing} diff --git a/device-types/virtio-network/device.tex b/device-types/virtio-network/device.tex
index e7cdd6f..ea4b524 100644

device-types/virtio-network/device.tex +0 -0
@@ -1210,6 +1210,24 @@ \subsubsection{Control

Virtqueue}\label{sec:Device Types / Network Device / Devi

device-types/virtio-network/device.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi

Quoted 4 lines
device-types/virtio-network/device.tex +1 -0
  Both the VIRTIO_NET_CTRL_VLAN_ADD and VIRTIO_NET_CTRL_VLAN_DEL
  command take a little-endian 16-bit VLAN id as the command-specific-data.
 
+VIRTIO_NET_CTRL_VLAN_ADD command adds the specified VLAN to the

VLAN

device-types/virtio-network/device.tex \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi

Quoted 3 lines
device-types/virtio-network/device.tex +3 -0
+filtering table.
+
+VIRTIO_NET_CTRL_VLAN_DEL command removes specified VLAN from the

VLAN

Quoted 11 lines

device-types/virtio-network/device.tex \subsubsection{Control · line 1225

Quoted 9 lines
device-types/virtio-network/device.tex +9 -0
+filtering table which was previously added using
+VIRTIO_NET_CTRL_VLAN_ADD command.
+
+\devicenormative{\subparagraph}{VLAN Filtering}{Device Types /
+Network Device / Device Operation / Control Virtqueue / VLAN
+Filtering}
+
+When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device starts with an
+empty VLAN filtering table.

Should we mention this VLAN filtering table gets emptied on device reset?

Good point. When a device is reset all the configuration of the driver gets cleared.
So instead of explicitly mentioning in each ctrl field, lets do this in generic place in the "Device Cleanup" section.

Currently device cleanup section only explicitly talks about virtio operation. Will do in follow up patch in common section.

Quoted 2 lines

...; if VIRTIO_NET_F_CTRL_VLAN is not negotiated, device does not have a VLAN filter table thus MUST NOT specifically drop VLAN tagged packets.

Ah yes, from v0 to v3, this part of the text got lost. I will add it back. Thanks.