From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSo3M-0008D9-5j for qemu-devel@nongnu.org; Wed, 26 Mar 2014 09:39:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSo3H-00024M-5Y for qemu-devel@nongnu.org; Wed, 26 Mar 2014 09:39:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSo3G-00023z-S4 for qemu-devel@nongnu.org; Wed, 26 Mar 2014 09:39:31 -0400 Message-ID: <5332D88C.7030704@redhat.com> Date: Wed, 26 Mar 2014 09:39:24 -0400 From: Vlad Yasevich MIME-Version: 1.0 References: <1395829792-14301-1-git-send-email-akong@redhat.com> In-Reply-To: <1395829792-14301-1-git-send-email-akong@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 for 2.0] virtio-net: Do not filter VLANs without F_CTRL_VLAN Reply-To: vyasevic@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong , qemu-devel@nongnu.org Cc: sf@sfritsch.de, stefanha@redhat.com, aliguori@amazon.com, mst@redhat.com On 03/26/2014 06:29 AM, Amos Kong wrote: > From: Stefan Fritsch > > If VIRTIO_NET_F_CTRL_VLAN is not negotiated, do not filter out all > VLAN-tagged packets but send them to the guest. > > This fixes VLANs with OpenBSD guests (and probably NetBSD, too, because > the OpenBSD driver started as a port from NetBSD). > > Signed-off-by: Stefan Fritsch > Signed-off-by: Amos Kong > --- > V2: it's not good to check guest features at reset time, > so reset vlan table in setting features > --- > hw/net/virtio-net.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index 43b4eda..439477b 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -530,6 +530,12 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint32_t features) > } > vhost_net_ack_features(tap_get_vhost_net(nc->peer), features); > } > + > + if ((1 << VIRTIO_NET_F_CTRL_VLAN) & features) { > + memset(n->vlans, 0, MAX_VLAN >> 3); > + } else { > + memset(n->vlans, 0xff, MAX_VLAN >> 3); > + } > } > > static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd, > Reviewed-by: Vlad Yasevich -vlad