qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hawkins Jiawei <yin31149@gmail.com>
To: jasowang@redhat.com, mst@redhat.com, eperezma@redhat.com
Cc: qemu-devel@nongnu.org, 18801353760@163.com
Subject: Re: [PATCH v2 1/4] virtio-net: do not reset vlan filtering at set_features
Date: Sun, 23 Jul 2023 17:42:19 +0800	[thread overview]
Message-ID: <CAKrof1P+eEAArdYT+Qb0xMozpG_uPbU6GoWvm-grYOhHAq689A@mail.gmail.com> (raw)
In-Reply-To: <95af0d013281282f48ad3f47f6ad1ac4ca9e52eb.1690100802.git.yin31149@gmail.com>

On 2023/7/23 17:26, Hawkins Jiawei wrote:
> From: Eugenio Pérez <eperezma@redhat.com>

There was a wrong "From" line by mistake, I will send the v3 patch to
fix this.

Thanks!


>
> This function is called after virtio_load, so all vlan configuration is
> lost in migration case.
>
> Just allow all the vlan-tagged packets if vlan is not configured, and
> trust device reset to clear all filtered vlans.
>
> Fixes: 0b1eaa8803 ("virtio-net: Do not filter VLANs without F_CTRL_VLAN")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> Reviewed-by: Hawkins Jiawei <yin31149@gmail.com>
> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
> ---
>   hw/net/virtio-net.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 7102ec4817..d20d5a63cd 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1006,9 +1006,7 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)
>           vhost_net_save_acked_features(nc->peer);
>       }
>
> -    if (virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {
> -        memset(n->vlans, 0, MAX_VLAN >> 3);
> -    } else {
> +    if (!virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {
>           memset(n->vlans, 0xff, MAX_VLAN >> 3);
>       }
>


  reply	other threads:[~2023-07-23  9:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23  9:26 [PATCH v2 0/4] Vhost-vdpa Shadow Virtqueue VLAN support Hawkins Jiawei
2023-07-23  9:26 ` [PATCH v2 1/4] virtio-net: do not reset vlan filtering at set_features Hawkins Jiawei
2023-07-23  9:42   ` Hawkins Jiawei [this message]
2023-07-25  6:43   ` Jason Wang
2023-07-23  9:26 ` [PATCH v2 2/4] virtio-net: Expose MAX_VLAN Hawkins Jiawei
2023-07-25  6:47   ` Jason Wang
2023-07-23  9:26 ` [PATCH v2 3/4] vdpa: Restore vlan filtering state Hawkins Jiawei
2023-07-25  6:47   ` Jason Wang
2023-07-25  7:48     ` Hawkins Jiawei
2023-07-26  2:18       ` Jason Wang
2023-07-23  9:26 ` [PATCH v2 4/4] vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ Hawkins Jiawei
2023-07-25  6:47   ` Jason Wang

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=CAKrof1P+eEAArdYT+Qb0xMozpG_uPbU6GoWvm-grYOhHAq689A@mail.gmail.com \
    --to=yin31149@gmail.com \
    --cc=18801353760@163.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).