From: "Michael S. Tsirkin" <mst@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
"virtio-dev@lists.oasis-open.org"
<virtio-dev@lists.oasis-open.org>,
"virtio-comment@lists.oasis-open.org"
<virtio-comment@lists.oasis-open.org>,
"si-wei.liu@oracle.com" <si-wei.liu@oracle.com>
Subject: [virtio-dev] Re: [virtio-comment] [PATCH v10] virtio-net: Clarify VLAN filter table configuration
Date: Wed, 25 Jan 2023 15:31:55 -0500 [thread overview]
Message-ID: <20230125152146-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <PH0PR12MB548193F9D20E6C75CE29E3B4DCCE9@PH0PR12MB5481.namprd12.prod.outlook.com>
On Wed, Jan 25, 2023 at 07:09:28PM +0000, Parav Pandit wrote:
>
> > From: Halil Pasic <pasic@linux.ibm.com>
> > Sent: Wednesday, January 25, 2023 1:05 PM
> >
> > On Thu, 12 Jan 2023 23:25:50 +0200
> > Parav Pandit <parav@nvidia.com> wrote:
> >
> > > 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://lists.oasis-open.org/archives/virtio-dev/202301/msg00210.html
> >
> > Reference is wrong. This links an unrelated thread.
> >
> > For reference see:
> >
> > https://www.mail-archive.com/virtio-dev@lists.oasis-open.org/msg09424.html
> >
> In the commit log the right reference to the discussion should be,
>
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg912392.html
>
> More below whether we need v11 or not.
>
> > [..]
> > @ -1194,7 +1194,11 @@ \subsubsection{Control Virtqueue}\label{sec:Device
> > Types / Network Device / Devi
> > > \paragraph{VLAN Filtering}\label{sec:Device Types / Network Device /
> > > Device Operation / Control Virtqueue / VLAN Filtering}
> > >
> > > If the driver negotiates the VIRTIO_NET_F_CTRL_VLAN feature, it -can
> > > control a VLAN filter table in the device.
> > > +can control a VLAN filter table in the device. The VLAN filter table
> > > +applies only to VLAN tagged packets.
> > > +
> > > +When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device starts with an
> > > +empty VLAN filter table.
> > >
> > > \begin{note}
> > > Similar to the MAC address based filtering, the VLAN filtering @@
> > > -1210,6 +1214,22 @@ \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.
> > >
> > [..]
> > > +
> > > +\devicenormative{\subparagraph}{VLAN Filtering}{Device Types /
> > > +Network Device / Device Operation / Control Virtqueue / VLAN
> > > +Filtering}
> > > +
> > > +When VIRTIO_NET_F_CTRL_VLAN is not negotiated, the device MUST accept
> > > +all VLAN tagged packets as per the device configuration.
> >
> >
> > The story so far (other thread):
> >
> > > > I find "as per the device configuration" difficult to comprehend.
> > > > Maybe we can work on this with an editorial. What are you trying to
> > > > express here? On one hand you say "the device MUST accept all VLAN
> > > > tagged packets" on the other hand "per the device configuration" may
> > > > explain, or may relativize and restrict that statement.
> > > >
> > > From VLAN filtering perspective, it should accept all packets, but this is
> > subject to other device configuration such as MAC programming.
> > > The current one is fine that cover both the aspects to VLAN specific and other
> > config.
> >
> > IMHO you need to be explicit about this "From the VLAN filtering perspective".
> > A sub-case of "not negotiated" is "not offered because the device does not
> > support it" and in that case there is conceptually no "VLAN filtering
> > perspective".
> >
> Not negotiated covers two conditions.
> 1. device offered, but driver choose to keep it disabled.
> 2. device didn't offer, so driver didn't enable it
>
> This section talks about VLAN filtering, so context is VLAN filtering and no need to bring other context.
> I tend to agree that we can drop the line "per device configuration".
>
> > > > Would
> > > > "When VIRTIO_NET_F_CTRL_VLAN is not negotiated, VLAN filtering is
> > > > not applied. I.e. VLAN tags are ignored by the device."
> > > > also work?
> > > >
> > > No. its not about ignoring "VLAN tags". Its about dealing with "packets" that
> > starts with the VLAN tag.
> >
> > I'm not sure I understand the difference.
> >
> > Would just
> > "When VIRTIO_NET_F_CTRL_VLAN is not negotiated, no VLAN filtering is done
> > by the device."
> > work?
> >
> This is also fine.
> However, I prefer the current spec terminology used in mac, promiscuous etc area such as "receive/accept/drop".
> It is lot clearer to understand in steering world.
> And it also aligns to the steering tools such as tc [3] which defines the action as "drop/mirred/redirect" etc.
>
> Hence, lets keep
> "When VIRTIO_NET_F_CTRL_VLAN is not negotiated, the device MUST accept all VLAN tagged packets"
>
> This way spec language is same for negotiated/non-negotiated case of accept/drop etc.
>
> > I don't like this "as per device configuration" formulation. If you have multiple
> > filtering mechanisms, like VLAN and MAC, and describe all of these using this
> > "as per device configuration", you would end up with statements like:
> > "When feature F_X is not negotiated, the device MUST accept all P_X packets as
> > the per device configuration."
> > Where as per device configuration is supposed to cover all other active filtering
> > mechanisms except the one that is tied to F_X, but exclude the mechanism that
> > is tied to the feature F_X.
> >
> > I'm also not convinced about the information content of "as per device
> > configuration". Kind of the complementer would be "contrary to the device
> > configuration" which does not make much sense. I would also argue that we
> > can add "as per device configuration" to most of our device normative
> > statements. It would IMHO only decrease clarity and increase the confusion.
> > But if you ask yourself is the behavior prescribed by an arbitrary device
> > normative statemen "as per device configuration" or not, I don't think one
> > would ever answer "no" to that question.
> >
> I am ok to drop the "per device configuration" given filtering is contextual to the section.
>
> So far I see two comments in version v10 that needs to be addressed.
> 1. Correct the link the commit message to some past discussion.
> 2. Drop "as per device configuration"
>
> Do you suggest V11?
> Or it its ok, I prefer to write follow up "Fixes" patch to drop the per device configuration part.
> Given that we are closed to voting deadline, and change is not breaking the spec.
> Usually in other projects for minor things like above #1, maintainer applies the local change to commit log before applying the patch to avoid unnecessary churn of people's time.
>
> Please suggest next step on resolving it.
Yea #1 does not matter much.
This ballot
https://lists.oasis-open.org/archives/virtio-dev/202301/msg00231.html
is likely set to approve v10.
If you really want to withdraw it you can request that.
Alternatively post a patch on top, if it's a minor cleanup it can be applied
without a vote. I'd say removing "as per device configuration" is
probably a minor cleanup.
> > > +
> > > +When VIRTIO_NET_F_CTRL_VLAN is negotiated, the device MUST accept all
> > > +VLAN tagged packets whose VLAN tag is present in the VLAN filter
> > > +table and SHOULD drop all VLAN tagged packets whose VLAN tag is
> > > +absent in the VLAN filter table.
> >
> > We could also add "as per device configuration" here as well...
> >
> Yeah, lets keep it the way it is. It is easy to understand. :)
>
> > From the other thread
> >
> > On Mon, 23 Jan 2023 12:41:16 +0000
> > Parav Pandit <parav@nvidia.com> wrote:
> >
> > > > BTW why SHOULD drop?
> > > This is the offload feature to drop such packets so that OS driver
> > > doesn't need to do the filtering work. :)
> >
> > Why not MUST drop? If the device is allowed to produce false negatives, then I
> > think the OS probably wants to check again to filter out those.
> > Can we change SHOULD to MUST, so the conforming device is guaranteed to do
> > the filtering, and the OS can rely on it?
>
> In this patch we are not changing the spec.
Well yes we do :) I think you mean we are not adding new features.
> It is done on a best effort basis based on existing implementation.
> Hence, its is SHOULD.
> Refer to the github issue [1], which you didn't vote in [2].
>
> [1] https://github.com/oasis-tcs/virtio-spec/issues/47
> [2] https://www.oasis-open.org/committees/ballot.php?id=3419
> [3] https://man7.org/linux/man-pages/man8/tc-actions.8.html
>
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
next prev parent reply other threads:[~2023-01-25 20:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 21:25 [virtio-comment] [PATCH v10] virtio-net: Clarify VLAN filter table configuration Parav Pandit
2023-01-19 18:35 ` [virtio-comment] " Parav Pandit
2023-01-25 18:04 ` [virtio-comment] " Halil Pasic
2023-01-25 19:09 ` [virtio-dev] " Parav Pandit
2023-01-25 20:31 ` Michael S. Tsirkin [this message]
2023-01-25 20:36 ` Parav Pandit
2023-01-26 11:48 ` Halil Pasic
2023-01-26 16:17 ` [virtio-dev] " Parav Pandit
2023-01-26 16:27 ` Michael S. Tsirkin
2023-01-25 20:55 ` Michael S. Tsirkin
2023-01-25 23:30 ` Parav Pandit
2023-01-25 23:46 ` Parav Pandit
2023-01-26 0:46 ` [virtio-dev] " Si-Wei Liu
2023-01-26 5:01 ` Michael S. Tsirkin
2023-01-26 5:07 ` Michael S. Tsirkin
2023-01-26 16:27 ` Parav Pandit
2023-01-26 16:31 ` Michael S. Tsirkin
2023-01-26 16:42 ` Parav Pandit
2023-01-26 17:15 ` Michael S. Tsirkin
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=20230125152146-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=pasic@linux.ibm.com \
--cc=si-wei.liu@oracle.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=virtio-dev@lists.oasis-open.org \
/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