qemu-devel
[Top][All Lists]
Advanced

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

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


From: Akihiko Odaki
Subject: [PATCH v4 2/2] virtio-net: Report RSS warning at device realization
Date: Sat, 04 Jan 2025 16:48:54 +0900

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

-- 
2.47.1




reply via email to

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