From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Harpreet Singh Anand <hanand@xilinx.com>,
Cindy Lu <lulu@redhat.com>,
Liuxiangdong <liuxiangdong5@huawei.com>,
Stefano Garzarella <sgarzare@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Zhu Lingshan <lingshan.zhu@intel.com>,
Gautam Dawar <gdawar@xilinx.com>,
Si-Wei Liu <si-wei.liu@oracle.com>, Eli Cohen <eli@mellanox.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
Laurent Vivier <lvivier@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Parav Pandit <parav@mellanox.com>,
Jason Wang <jasowang@redhat.com>
Subject: [PATCH 3/3] vdpa: Support VLAN on nic control shadow virtqueue
Date: Tue, 6 Sep 2022 18:36:21 +0200 [thread overview]
Message-ID: <20220906163621.1144675-4-eperezma@redhat.com> (raw)
In-Reply-To: <20220906163621.1144675-1-eperezma@redhat.com>
Update the virtio-net device model with each guest's update of vlan
through control virtqueue, and accept creating a SVQ with a device
exposing vlan feature bit.
Done in the same commit since a malicious guest could send vlan
commands otherwise.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
net/vhost-vdpa.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index ecbfd08eb9..40f7c60399 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -94,6 +94,7 @@ static const uint64_t vdpa_svq_device_features =
BIT_ULL(VIRTIO_NET_F_MRG_RXBUF) |
BIT_ULL(VIRTIO_NET_F_STATUS) |
BIT_ULL(VIRTIO_NET_F_CTRL_VQ) |
+ BIT_ULL(VIRTIO_NET_F_CTRL_VLAN) |
BIT_ULL(VIRTIO_NET_F_MQ) |
BIT_ULL(VIRTIO_F_ANY_LAYOUT) |
BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR) |
@@ -538,6 +539,16 @@ static bool vhost_vdpa_net_cvq_validate_cmd(const void *out_buf, size_t len)
__func__, ctrl.cmd);
};
break;
+ case VIRTIO_NET_CTRL_VLAN:
+ switch (ctrl->cmd) {
+ case VIRTIO_NET_CTRL_VLAN_ADD:
+ case VIRTIO_NET_CTRL_VLAN_DEL:
+ return true;
+ default:
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid vlan cmd %u\n",
+ __func__, ctrl->cmd);
+ };
+ break;
default:
qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid control class %u\n",
__func__, ctrl.class);
--
2.31.1
next prev parent reply other threads:[~2022-09-06 16:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 16:36 [PATCH 0/3] Vhost-vdpa Shadow Virtqueue VLAN support Eugenio Pérez
2022-09-06 16:36 ` [PATCH 1/3] virtio-net: do not reset vlan filtering at set_features Eugenio Pérez
2022-09-06 16:36 ` [PATCH 2/3] vdpa: load vlan configuration at NIC startup Eugenio Pérez
2022-09-09 6:38 ` Jason Wang
2022-09-09 6:40 ` Jason Wang
2022-09-09 8:01 ` Eugenio Perez Martin
2022-09-09 8:38 ` Michael S. Tsirkin
2022-09-14 2:22 ` Jason Wang
2022-09-14 11:11 ` Eugenio Perez Martin
2022-09-14 2:20 ` Jason Wang
2022-09-14 11:01 ` Eugenio Perez Martin
2022-09-14 11:32 ` Si-Wei Liu
2022-09-14 13:57 ` Eugenio Perez Martin
2022-09-14 15:43 ` Si-Wei Liu
2022-09-15 2:45 ` Jason Wang
2022-09-16 13:45 ` Eugenio Perez Martin
2022-09-21 23:00 ` Si-Wei Liu
2022-09-29 7:13 ` Michael S. Tsirkin
2022-10-04 22:33 ` Si-Wei Liu
2022-09-15 2:40 ` Jason Wang
2022-09-06 16:36 ` Eugenio Pérez [this message]
2022-09-09 6:39 ` [PATCH 3/3] vdpa: Support VLAN on nic control shadow virtqueue Jason Wang
2022-09-09 7:57 ` Eugenio Perez Martin
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=20220906163621.1144675-4-eperezma@redhat.com \
--to=eperezma@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=cohuck@redhat.com \
--cc=eli@mellanox.com \
--cc=gdawar@xilinx.com \
--cc=hanand@xilinx.com \
--cc=jasowang@redhat.com \
--cc=lingshan.zhu@intel.com \
--cc=liuxiangdong5@huawei.com \
--cc=lulu@redhat.com \
--cc=lvivier@redhat.com \
--cc=mst@redhat.com \
--cc=parav@mellanox.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=si-wei.liu@oracle.com \
--cc=stefanha@redhat.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 NNTP newsgroup(s).