From: Hawkins Jiawei <yin31149@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>,
jasowang@redhat.com, mst@redhat.com, eperezma@redhat.com
Cc: qemu-stable@nongnu.org, qemu-devel@nongnu.org, 18801353760@163.com
Subject: Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR
Date: Sat, 5 Aug 2023 17:28:44 +0800 [thread overview]
Message-ID: <CAKrof1NXV22zdjww=+P2NybZCyoNBOdahDMLrJfTDmK0Xa5BEA@mail.gmail.com> (raw)
In-Reply-To: <86a640b2-a9f8-5b62-349c-c0927c2a013b@tls.msk.ru>
On 2023/8/5 14:15, Michael Tokarev wrote:
> 04.07.2023 06:34, Hawkins Jiawei wrote:
>> According to VirtIO standard, "The class, command and
>> command-specific-data are set by the driver,
>> and the device sets the ack byte.
>> There is little it can do except issue a diagnostic
>> if ack is not VIRTIO_NET_OK."
>>
>> Therefore, QEMU should stop sending the queued SVQ commands and
>> cancel the device startup if the device's ack is not VIRTIO_NET_OK.
>>
>> Yet the problem is that, vhost_vdpa_net_load_x() returns 1 based on
>> `*s->status != VIRTIO_NET_OK` when the device's ack is VIRTIO_NET_ERR.
>> As a result, net->nc->info->load() also returns 1, this makes
>> vhost_net_start_one() incorrectly assume the device state is
>> successfully loaded by vhost_vdpa_net_load() and return 0, instead of
>> goto `fail` label to cancel the device startup, as vhost_net_start_one()
>> only cancels the device startup when net->nc->info->load() returns a
>> negative value.
>>
>> This patchset fixes this problem by returning -EIO when the device's
>> ack is not VIRTIO_NET_OK.
>>
>> Changelog
>> =========
>> v3:
>> - split the fixes suggested by Eugenio
>> - return -EIO suggested by Michael
>>
>> v2:
>> https://lore.kernel.org/all/69010e9ebb5e3729aef595ed92840f43e48e53e5.1687875592.git.yin31149@gmail.com/
>> - fix the same bug in vhost_vdpa_net_load_offloads()
>>
>> v1: https://lore.kernel.org/all/cover.1686746406.git.yin31149@gmail.com/
>>
>> Hawkins Jiawei (3):
>> vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac()
>> vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq()
>> vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_offloads()
>
> Hi!
>
> I don't remember why, but this patch series is marked as "check later" in
> my qemu-stable-to-apply email folder. Does it make sense to back-port this
> series to stable-8.0?
>
> 6f34807116 vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in
> _load_offloads()
> f45fd95ec9 vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq()
> b479bc3c9d vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac()
>
Hi Michael,
Yes, this bug exists in stable-8.0, so it makes sense to back-port this
series.
Commit f45fd95ec9("vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in
_load_mq()") and
commit b479bc3c9d("vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in
_load_mac()") can be back-ported directly.
> Patch 6f34807116 also needs
>
> b58d3686a0 vdpa: Add vhost_vdpa_net_load_offloads()
As you point out, patch 6f34807116("vdpa: Return -EIO if device ack is
VIRTIO_NET_ERR in _load_offloads()") is a fix to the commit
b58d3686a0("vdpa: Add vhost_vdpa_net_load_offloads()"), which was
introduced by patch series "Vhost-vdpa Shadow Virtqueue Offloads
support" at [1].
This mentioned patch series introduces a new feature for QEMU and
has not been merged into stable-8.0 yet, so I think we do not need to
apply the
patch 6f34807116("vdpa: Return -EIO if device ack is
VIRTIO_NET_ERR in _load_offloads()") to stable-8.0.
Sorry for not mentioning this information in the cover letter.
Thanks!
[1]. https://lore.kernel.org/all/cover.1685704856.git.yin31149@gmail.com/
>
> for 8.0.
>
> Thanks,
>
> /mjt
next prev parent reply other threads:[~2023-08-05 9:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 3:34 [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR Hawkins Jiawei
2023-07-04 3:34 ` [PATCH v3 1/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac() Hawkins Jiawei
2023-07-04 3:34 ` [PATCH v3 2/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq() Hawkins Jiawei
2023-07-04 3:34 ` [PATCH v3 3/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_offloads() Hawkins Jiawei
2023-07-05 7:59 ` [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR Lei Yang
2023-07-05 11:03 ` Hawkins Jiawei
2023-07-06 11:03 ` Lei Yang
2023-08-05 6:15 ` Michael Tokarev
2023-08-05 9:28 ` Hawkins Jiawei [this message]
2023-08-05 9:53 ` Michael Tokarev
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='CAKrof1NXV22zdjww=+P2NybZCyoNBOdahDMLrJfTDmK0Xa5BEA@mail.gmail.com' \
--to=yin31149@gmail.com \
--cc=18801353760@163.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).