From: Hawkins Jiawei <yin31149@gmail.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: jasowang@redhat.com, mst@redhat.com, qemu-devel@nongnu.org,
18801353760@163.com
Subject: Re: [PATCH v3 4/6] virtio-net: expose virtio_net_supported_guest_offloads()
Date: Fri, 2 Jun 2023 13:59:54 +0800 [thread overview]
Message-ID: <CAKrof1OBqkQwpk1araC8wZ+m4G_rRhfFz3MUx-aBantzpirUaw@mail.gmail.com> (raw)
In-Reply-To: <CAJaqyWcE0UgUYL8hwGNFNTOvqa8aSYF-_FoTc4+dYC0j+A5LwQ@mail.gmail.com>
On 2023/6/1 22:37, Eugenio Perez Martin wrote:
> On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei <yin31149@gmail.com> wrote:
>>
>> To support restoring offloads state in vdpa, need to expose
>> the function virtio_net_supported_guest_offloads().
>> QEMU uses this function to get the guest supported offloads
>> and no needs to send the corresponding CVQ command if guest
>
> doesn't need to send?
I will correct it in the v4 patch.
>
>> enables all supported features.
>>
>
> Good! I'd add the same message as the next patch's comment, to signal
> it is because the device has already enabled by default:
>
> + * According to VirtIO standard, "Upon feature negotiation
> + * corresponding offload gets enabled to preserve
> + * backward compatibility."
> + * So we do not need to send this CVQ command if the guest
> + * also enables all supported offloads.
I will add these messages in the v4 patch.
Thanks!
>
> Thanks!
>
>
>> Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
>> ---
>> hw/net/virtio-net.c | 2 +-
>> include/hw/virtio/virtio-net.h | 1 +
>> 2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
>> index 7b27dad6c4..7e8897a8bc 100644
>> --- a/hw/net/virtio-net.c
>> +++ b/hw/net/virtio-net.c
>> @@ -874,7 +874,7 @@ static uint64_t virtio_net_guest_offloads_by_features(uint32_t features)
>> return guest_offloads_mask & features;
>> }
>>
>> -static inline uint64_t virtio_net_supported_guest_offloads(const VirtIONet *n)
>> +uint64_t virtio_net_supported_guest_offloads(const VirtIONet *n)
>> {
>> VirtIODevice *vdev = VIRTIO_DEVICE(n);
>> return virtio_net_guest_offloads_by_features(vdev->guest_features);
>> diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
>> index ef234ffe7e..5f5dcb4572 100644
>> --- a/include/hw/virtio/virtio-net.h
>> +++ b/include/hw/virtio/virtio-net.h
>> @@ -227,5 +227,6 @@ size_t virtio_net_handle_ctrl_iov(VirtIODevice *vdev,
>> unsigned out_num);
>> void virtio_net_set_netclient_name(VirtIONet *n, const char *name,
>> const char *type);
>> +uint64_t virtio_net_supported_guest_offloads(const VirtIONet *n);
>>
>> #endif
>> --
>> 2.25.1
>>
>
next prev parent reply other threads:[~2023-06-02 6:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 13:48 [PATCH v3 0/6] Vhost-vdpa Shadow Virtqueue Offloads support Hawkins Jiawei
2023-06-01 13:48 ` [PATCH v3 1/6] include/hw/virtio: make some VirtIODevice const Hawkins Jiawei
2023-06-01 14:14 ` Eugenio Perez Martin
2023-06-01 13:48 ` [PATCH v3 2/6] vdpa: reuse virtio_vdev_has_feature() Hawkins Jiawei
2023-06-01 14:14 ` Eugenio Perez Martin
2023-06-01 13:48 ` [PATCH v3 3/6] hw/net/virtio-net: make some VirtIONet const Hawkins Jiawei
2023-06-01 14:15 ` Eugenio Perez Martin
2023-06-01 13:48 ` [PATCH v3 4/6] virtio-net: expose virtio_net_supported_guest_offloads() Hawkins Jiawei
2023-06-01 14:37 ` Eugenio Perez Martin
2023-06-02 5:59 ` Hawkins Jiawei [this message]
2023-06-01 13:48 ` [PATCH v3 5/6] vdpa: Add vhost_vdpa_net_load_offloads() Hawkins Jiawei
2023-06-01 14:12 ` Eugenio Perez Martin
2023-06-02 7:30 ` Hawkins Jiawei
2023-06-01 13:48 ` [PATCH v3 6/6] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ Hawkins Jiawei
2023-06-01 14:18 ` Eugenio Perez Martin
2023-06-02 11:25 ` [PATCH v3 0/6] Vhost-vdpa Shadow Virtqueue Offloads support Lei Yang
2023-06-02 12:05 ` Hawkins Jiawei
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=CAKrof1OBqkQwpk1araC8wZ+m4G_rRhfFz3MUx-aBantzpirUaw@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).