diff mbox series

[v4,2/2] virtio-net: Report RSS warning at device realization

Message ID 20250104-auto-v4-2-972461ee87fd@daynix.com (mailing list archive)
State New
Headers show
Series virtio-net: Convert feature properties to OnOffAuto | expand

Commit Message

Akihiko Odaki Jan. 4, 2025, 7:48 a.m. UTC
Warning about RSS fallback at device realization allows the user to
notice the configuration problem early.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 hw/net/virtio-net.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6b2104c6b68d..c6a8e6055909 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -829,6 +829,8 @@  static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
         if (virtio_has_feature(on_off_auto_features.on_bits, VIRTIO_NET_F_HASH_REPORT) ||
             (virtio_has_feature(on_off_auto_features.on_bits, VIRTIO_NET_F_RSS) &&
              !ebpf_rss_is_loaded(&n->ebpf_rss))) {
+            warn_report("Can't load eBPF RSS - fallback to software RSS");
+
             virtio_clear_feature(&on_off_auto_features.auto_bits,
                                  VIRTIO_NET_F_RSS);
         }
@@ -1344,16 +1346,10 @@  static void virtio_net_detach_ebpf_rss(VirtIONet *n)
 static void virtio_net_commit_rss_config(VirtIONet *n)
 {
     if (n->rss_data.enabled) {
-        n->rss_data.enabled_software_rss = n->rss_data.populate_hash;
+        n->rss_data.enabled_software_rss = n->rss_data.populate_hash ||
+                                           !virtio_net_attach_ebpf_rss(n);
         if (n->rss_data.populate_hash) {
             virtio_net_detach_ebpf_rss(n);
-        } else if (!virtio_net_attach_ebpf_rss(n)) {
-            if (get_vhost_net(qemu_get_queue(n->nic)->peer)) {
-                warn_report("Can't load eBPF RSS for vhost");
-            } else {
-                warn_report("Can't load eBPF RSS - fallback to software RSS");
-                n->rss_data.enabled_software_rss = true;
-            }
         }
 
         trace_virtio_net_rss_enable(n,