From nobody Tue Feb 10 06:15:43 2026 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1712143118; cv=none; d=zohomail.com; s=zohoarc; b=axURZU8lKBiHQamIMT66Q4srP+p3jLF4HYgbG2A4Z2Sxw/ZOyNfN94O/dsO/zK7qQQdd0c5wmU3XuxwT4GuDu0a5AYR0LBuQu5YLMXI6hBpUJzN6E7JxFeySkVZYRXLJhvqtWbKkLLC8xv9T8a4ormgdHBTXBhuO/JSciqpj0Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712143118; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=b1mEKoDGZ4GGrqc3/3B4HXNGq76T02i3zn74clINDmw=; b=KEEYKD6Zrfkb7UqgseBbWO9Xle4GxoOA4n8umBdwmQRvRou1D9d/vd6UgBMUDwku0Ov/Upv7fAhWQ1rKSalCF34iB7bnGkY65K8GHauR2S3eO+6dXREX5ptesE/vbU2vaq2n6x/QVbTOSlPdB1hSfV97oEj7/SQbtIvYjRFul8o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712143118546674.7538071626204; Wed, 3 Apr 2024 04:18:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rryX8-0007hi-Fd; Wed, 03 Apr 2024 07:11:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rryX5-0007hQ-Ow for qemu-devel@nongnu.org; Wed, 03 Apr 2024 07:11:55 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rryX4-0007N5-5F for qemu-devel@nongnu.org; Wed, 03 Apr 2024 07:11:55 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1e0f0398553so55566915ad.3 for ; Wed, 03 Apr 2024 04:11:53 -0700 (PDT) Received: from localhost ([157.82.200.213]) by smtp.gmail.com with UTF8SMTPSA id y20-20020a170902e19400b001e28ba8b4d9sm1777496pla.132.2024.04.03.04.11.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Apr 2024 04:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1712142713; x=1712747513; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b1mEKoDGZ4GGrqc3/3B4HXNGq76T02i3zn74clINDmw=; b=HefW53rNnJT0YkjKYpes9DpFcPr7NX7oYmUUzO7mugrcdAAef08rUcGuSygO/v9E0D ABgx6/ryTqkwmnHFpo/WODBHQg/xPP2oMygYaiLfQ82Ln+71qU4hw1bSeED3cjTkSUBf 07cPqW75wf35PnaRAQhLTcg6bDnuvPITo1ZgLszEuIJWF2464YWHOBUTu+IBWQjnc4fv XKPgUnNlM96Jnm9wg/jodxNGgsp82v0TryrQxvf0FnJf1FB+gIwE0moUqmujIPxcYRbE xN2vteAaLNpUYvb1Lrj4FcPWnCTrfKrY5zBCEldpJ27UaFP11S//RT2+7jXABqhAuCFs bZOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712142713; x=1712747513; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b1mEKoDGZ4GGrqc3/3B4HXNGq76T02i3zn74clINDmw=; b=v9ZI9+VzGwya8HzGLXuHWbUFWLUJoMhXnBmHnl3AJt2+7CDS89QyPFpCnZigSIF/LY 39Ily2wkwVY5A5BnPAlYvMWQXFIrf4OKiTixwcifHd2SntXdW4MTjWGjFy4PpkHnor/V +lT8/6PIfl6cJQT7EDoceL/JvuRy2kj/dfZZfpJ1033viVA0jkKZUTjXllTcMwpttGVs N+G4QV4rNthJTi6pVMK4Z0yNPQCkTMHAwbOKUt0zoKicHyPIswWSsgcS/mCzZrd8oTyN 3TMc9fzaCinuoeBPpOAkYoYlMF5IOhgw7Y8LjPgDuoB2F3yg9r70ej1FQs6ezRY7XL5n ti4A== X-Gm-Message-State: AOJu0YwCtKkEu7SXXwQqrKm9NAmBgi3OuOdf2ArxXKGJ/A/CR7SQWU4U 5+U2V4FlH5aLQYLXy8KponKMg0SoEQe5+96iNn28jOkKr2QjgT5Fp8sQtvjYC3o= X-Google-Smtp-Source: AGHT+IHvoC8xqgF91bDQlnBrnxzII7j07cUWafpRBktQBsVJhWwVjC6DwoPKCkl21CGTV//zpc6s8g== X-Received: by 2002:a17:903:1ca:b0:1e2:90c6:839a with SMTP id e10-20020a17090301ca00b001e290c6839amr1831744plh.31.1712142713065; Wed, 03 Apr 2024 04:11:53 -0700 (PDT) From: Akihiko Odaki Date: Wed, 03 Apr 2024 20:11:02 +0900 Subject: [PATCH v9 14/20] virtio-net: Report RSS warning at device realization MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240403-rss-v9-14-c6d87e69d38b@daynix.com> References: <20240403-rss-v9-0-c6d87e69d38b@daynix.com> In-Reply-To: <20240403-rss-v9-0-c6d87e69d38b@daynix.com> To: Jason Wang , Dmitry Fleytman , Sriram Yagnaraman , "Michael S. Tsirkin" , Luigi Rizzo , Giuseppe Lettieri , Vincenzo Maffione , Andrew Melnychenko , Yuri Benditovich Cc: qemu-devel@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1712143118970100001 Warning about RSS fallback at device realization allows the user to notice the configuration problem early. Signed-off-by: Akihiko Odaki --- hw/net/virtio-net.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3d53eba88cfc..86929c9e1fad 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1261,10 +1261,12 @@ static bool virtio_net_attach_epbf_rss(VirtIONet *n) =20 if (!ebpf_rss_set_all(&n->ebpf_rss, &config, n->rss_data.indirections_table, n->rss_data.key)= ) { + error_report("Failed to configure eBPF RSS"); return false; } =20 if (!virtio_net_attach_ebpf_to_backend(n->nic, n->ebpf_rss.program_fd)= ) { + error_report("Failed to attach eBPF to backend"); return false; } =20 @@ -1279,16 +1281,10 @@ static void virtio_net_detach_epbf_rss(VirtIONet *n) static void virtio_net_commit_rss_config(VirtIONet *n) { if (n->rss_data.enabled) { - n->rss_data.enabled_software_rss =3D n->rss_data.populate_hash; + n->rss_data.enabled_software_rss =3D n->rss_data.populate_hash || + !virtio_net_attach_epbf_rss(n); if (n->rss_data.populate_hash) { virtio_net_detach_epbf_rss(n); - } else if (!virtio_net_attach_epbf_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 RS= S"); - n->rss_data.enabled_software_rss =3D true; - } } =20 trace_virtio_net_rss_enable(n->rss_data.hash_types, @@ -3802,9 +3798,14 @@ static void virtio_net_device_realize(DeviceState *d= ev, Error **errp) net_rx_pkt_init(&n->rx_pkt); =20 if (virtio_has_feature(n->host_features, VIRTIO_NET_F_RSS) && - !virtio_net_load_ebpf(n) && get_vhost_net(nc->peer)) { - virtio_net_device_unrealize(dev); - error_setg(errp, "Can't load eBPF RSS for vhost"); + !virtio_net_load_ebpf(n)) { + if (get_vhost_net(nc->peer)) { + error_setg(errp, "Can't load eBPF RSS for vhost"); + virtio_net_device_unrealize(dev); + return; + } + + warn_report("Can't load eBPF RSS - fallback to software RSS"); } } =20 --=20 2.44.0