diff mbox series

[RFC,1/3] virtio_net: export virtio_net_guest_offloads_by_features

Message ID 20221125143859.2211494-2-eperezma@redhat.com (mailing list archive)
State New, archived
Headers show
Series VIRTIO_NET_F_CTRL_GUEST_OFFLOADS vDPA Shadow VirtQueue implementation | expand

Commit Message

Eugenio Perez Martin Nov. 25, 2022, 2:38 p.m. UTC
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 mbox series

Patch

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) |