From nobody Tue Feb 10 00:38:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1627481619495343.88950957685984; Wed, 28 Jul 2021 07:13:39 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-DNjQ30jgNUiZ5u07WwPkKw-1; Wed, 28 Jul 2021 10:13:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4085107ACF5; Wed, 28 Jul 2021 14:13:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6E07F5C1CF; Wed, 28 Jul 2021 14:13:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5A3274BB7B; Wed, 28 Jul 2021 14:13:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16S8IC5v013755 for ; Wed, 28 Jul 2021 04:18:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A88BDAF0A; Wed, 28 Jul 2021 08:18:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35585DAF05 for ; Wed, 28 Jul 2021 08:18:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B2678D1388 for ; Wed, 28 Jul 2021 08:18:09 +0000 (UTC) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-535-XMv2XvolMV2ctiw9cxBLKQ-1; Wed, 28 Jul 2021 04:18:07 -0400 Received: by mail-lf1-f53.google.com with SMTP id z2so2422805lft.1 for ; Wed, 28 Jul 2021 01:18:07 -0700 (PDT) Received: from navi.cosmonova.net.ua ([95.67.24.131]) by smtp.gmail.com with ESMTPSA id p5sm571964lfd.240.2021.07.28.01.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 01:18:05 -0700 (PDT) X-MC-Unique: DNjQ30jgNUiZ5u07WwPkKw-1 X-MC-Unique: XMv2XvolMV2ctiw9cxBLKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WRr+J2BGbxYoqjiWbH0JLUM6SvmivGNydXNz6gcGA0s=; b=VVXviltDPj8Dbs0nyZtQnMC6Dz25hZW7v3h8vXzuVCoLsNB8NACVY4HH84zTOkMdyj UUyE153On3wGyYuH1QnABsnk0x5lG4uS6SQNqVHEJcXevZDhaSTbpBsjAtQy3Yvt7ZDg 3jopfc9sOd5xEuSXmQFtvE+Owym6XXPPbQRmr86IoOtCfTjJiRJJcHHzF05GrPhyBMJH FY6M+rEqCrIsE3KUm1s0iMKYdEcDMo5Tba63evEnWWxHN5mf+dUv1MiOCV4tmyaQVdER djJTuHdCFToDqwfu2IQBnBzL9wMFE/UglQ6yYkYFay1XtHAAaue08xPaywlhxPVE2b7A Kh+w== X-Gm-Message-State: AOAM5321UgmzSVoVTz3pO60pYv3CeVgDxPNXqGxcD+YEYHHTQbyuxdNH XFJBY8OWtPXqeg5hLYFHMSEL2Q1UW8ZTrG+N X-Google-Smtp-Source: ABdhPJyYoSIAsJU3xrB0q7RHF0/YnEUlLU4Z57PR2un6O2u4R65jxGeKECtKdT2kSDl5cAcqeIZW6Q== X-Received: by 2002:a19:5e15:: with SMTP id s21mr20421026lfb.282.1627460285638; Wed, 28 Jul 2021 01:18:05 -0700 (PDT) From: Andrew Melnychenko To: libvir-list@redhat.com Subject: [RFC PATCH 01/10] domain_conf: Added configs for RSS and Hash report. Date: Wed, 28 Jul 2021 11:17:05 +0300 Message-Id: <20210728081714.715287-2-andrew@daynix.com> In-Reply-To: <20210728081714.715287-1-andrew@daynix.com> References: <20210728081714.715287-1-andrew@daynix.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Wed, 28 Jul 2021 10:13:24 -0400 Cc: yan@daynix.com, yuri.benditovich@daynix.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1627481620836100003 Content-Type: text/plain; charset="utf-8" Added "rss" and "rss_hash_report" configuration that should be used with qemu virtio RSS. Both options are triswitches. Used as "driver" options and affects only NIC with model type "virtio". In other patches - options should turn on virtio-net RSS and hash propertie= s. Also "rss" may used to affect "ebpf_rss_fds" property of virtio-net in qemu. Signed-off-by: Andrew Melnychenko --- src/conf/domain_conf.c | 31 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 06c1fcf5e5..7289acc9c6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10244,6 +10244,8 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, g_autofree char *vhost_path =3D NULL; g_autofree char *tap =3D NULL; g_autofree char *vhost =3D NULL; + g_autofree char *virtio_rss =3D NULL; + g_autofree char *virtio_rss_hash_report =3D NULL; const char *prefix =3D xmlopt ? xmlopt->config.netPrefix : NULL; =20 if (!(def =3D virDomainNetDefNew(xmlopt))) @@ -10385,6 +10387,8 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, queues =3D virXMLPropString(driver_node, "queues"); rx_queue_size =3D virXMLPropString(driver_node, "rx_queue_size"); tx_queue_size =3D virXMLPropString(driver_node, "tx_queue_size"); + virtio_rss =3D virXMLPropString(driver_node, "rss"); + virtio_rss_hash_report =3D virXMLPropString(driver_node, "rss_hash_rep= ort"); =20 if ((filterref_node =3D virXPathNode("./filterref", ctxt))) { filter =3D virXMLPropString(filterref_node, "filter"); @@ -10796,7 +10800,24 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, } def->driver.virtio.tx_queue_size =3D q; } - + if (virtio_rss) { + if ((val =3D virTristateSwitchTypeFromString(virtio_rss)) <=3D= 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'rss' attribute must be 'on'/'off'/'default': %= s"), + virtio_rss); + goto error; + } + def->driver.virtio.rss =3D val; + } + if (virtio_rss_hash_report) { + if ((val =3D virTristateSwitchTypeFromString(virtio_rss_hash_r= eport)) <=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'rss_hash_report' attribute must be 'on'/'off'/= 'default': %s"), + virtio_rss_hash_report); + goto error; + } + def->driver.virtio.rss_hash_report =3D val; + } if ((tmpNode =3D virXPathNode("./driver/host", ctxt))) { if (virXMLPropTristateSwitch(tmpNode, "csum", VIR_XML_PROP_NON= E, &def->driver.virtio.host.csum) < = 0) @@ -24568,6 +24589,14 @@ virDomainVirtioNetDriverFormat(virBuffer *buf, if (def->driver.virtio.tx_queue_size) virBufferAsprintf(buf, " tx_queue_size=3D'%u'", def->driver.virtio.tx_queue_size); + if (def->driver.virtio.rss !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(buf, " rss=3D'%s'", + virTristateSwitchTypeToString(def->driver.virtio= .rss)); + } + if (def->driver.virtio.rss_hash_report !=3D VIR_TRISTATE_SWITCH_ABSENT= ) { + virBufferAsprintf(buf, " rss_hash_report=3D'%s'", + virTristateSwitchTypeToString(def->driver.virtio= .rss_hash_report)); + } =20 virDomainVirtioOptionsFormat(buf, def->virtio); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ca21082624..60cb70b204 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1046,6 +1046,8 @@ struct _virDomainNetDef { virTristateSwitch ecn; virTristateSwitch ufo; } guest; + virTristateSwitch rss; + virTristateSwitch rss_hash_report; } virtio; } driver; struct { --=20 2.31.1