From: "Michael S. Tsirkin" <mst@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Jason Wang <jasowang@redhat.com>,
Andrew Melnychenko <andrew@daynix.com>,
Yuri Benditovich <yuri.benditovich@daynix.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] virtio-net: Fix vhost virtqueue notifiers for RSS
Date: Mon, 8 Apr 2024 06:13:20 -0400 [thread overview]
Message-ID: <20240408061306-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20240326-vhost-v1-1-09bd85b1ba2c@daynix.com>
On Tue, Mar 26, 2024 at 07:06:29PM +0900, Akihiko Odaki wrote:
> virtio_net_guest_notifier_pending() and virtio_net_guest_notifier_mask()
> checked VIRTIO_NET_F_MQ to know there are multiple queues, but
> VIRTIO_NET_F_RSS also enables multiple queues. Refer to n->multiqueue,
> which is set to true either of VIRTIO_NET_F_MQ or VIRTIO_NET_F_RSS is
> enabled.
>
> Fixes: 68b0a6395f36 ("virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Jason, are you merging this?
> ---
> hw/net/virtio-net.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 9959f1932b1b..a6ff000cd9d3 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3426,7 +3426,7 @@ static bool virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx)
> VirtIONet *n = VIRTIO_NET(vdev);
> NetClientState *nc;
> assert(n->vhost_started);
> - if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MQ) && idx == 2) {
> + if (!n->multiqueue && idx == 2) {
> /* Must guard against invalid features and bogus queue index
> * from being set by malicious guest, or penetrated through
> * buggy migration stream.
> @@ -3458,7 +3458,7 @@ static void virtio_net_guest_notifier_mask(VirtIODevice *vdev, int idx,
> VirtIONet *n = VIRTIO_NET(vdev);
> NetClientState *nc;
> assert(n->vhost_started);
> - if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MQ) && idx == 2) {
> + if (!n->multiqueue && idx == 2) {
> /* Must guard against invalid features and bogus queue index
> * from being set by malicious guest, or penetrated through
> * buggy migration stream.
>
> --
> 2.44.0
next prev parent reply other threads:[~2024-04-08 10:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-26 10:06 [PATCH 0/2] virtio-net: Fix RSS Akihiko Odaki
2024-03-26 10:06 ` [PATCH 1/2] virtio-net: Fix vhost virtqueue notifiers for RSS Akihiko Odaki
2024-04-08 10:13 ` Michael S. Tsirkin [this message]
2024-04-09 3:40 ` Jason Wang
2024-03-26 10:06 ` [PATCH 2/2] ebpf: Fix indirections table setting Akihiko Odaki
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=20240408061306-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=andrew@daynix.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yuri.benditovich@daynix.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).