qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 1/3] virtio_net: export virtio_net_guest_offloads_by_features


From: Eugenio Pérez
Subject: [RFC PATCH 1/3] virtio_net: export virtio_net_guest_offloads_by_features
Date: Fri, 25 Nov 2022 15:38:57 +0100

vdpa NIC can use it to know if it needs to restore guest offloads at
startup / migration.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
 include/hw/virtio/virtio-net.h | 1 +
 hw/net/virtio-net.c            | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index ef234ffe7e..491eafef16 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -221,6 +221,7 @@ struct VirtIONet {
     struct EBPFRSSContext ebpf_rss;
 };
 
+uint64_t virtio_net_guest_offloads_by_features(uint32_t features);
 size_t virtio_net_handle_ctrl_iov(VirtIODevice *vdev,
                                   const struct iovec *in_sg, unsigned in_num,
                                   const struct iovec *out_sg,
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index aba12759d5..87eb086dee 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -845,7 +845,7 @@ static void virtio_net_apply_guest_offloads(VirtIONet *n)
             !!(n->curr_guest_offloads & (1ULL << VIRTIO_NET_F_GUEST_UFO)));
 }
 
-static uint64_t virtio_net_guest_offloads_by_features(uint32_t features)
+uint64_t virtio_net_guest_offloads_by_features(uint32_t features)
 {
     static const uint64_t guest_offloads_mask =
         (1ULL << VIRTIO_NET_F_GUEST_CSUM) |
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]