From nobody Thu Jul 10 07:26:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1486709084043428.3289023615682; Thu, 9 Feb 2017 22:44:44 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1A6fJLU017766; Fri, 10 Feb 2017 01:41:19 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1A6elr6009970 for ; Fri, 10 Feb 2017 01:40:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5F10D244A2; Fri, 10 Feb 2017 06:40:47 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 537742D5EF; Fri, 10 Feb 2017 06:40:47 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DC63C05B1C8; Fri, 10 Feb 2017 06:40:46 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 09 Feb 2017 22:40:44 -0800 Received: from s2600wt.sh.intel.com ([10.239.48.158]) by fmsmga001.fm.intel.com with ESMTP; 09 Feb 2017 22:40:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,139,1484035200"; d="scan'208";a="1105518470" From: Eli Qiao To: libvir-list@redhat.com Date: Fri, 10 Feb 2017 14:42:12 +0800 Message-Id: <1486708933-5731-9-git-send-email-liyong.qiao@intel.com> In-Reply-To: <1486708933-5731-1-git-send-email-liyong.qiao@intel.com> References: <1486708933-5731-1-git-send-email-liyong.qiao@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 10 Feb 2017 06:40:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 10 Feb 2017 06:40:46 +0000 (UTC) for IP:'134.134.136.24' DOMAIN:'mga09.intel.com' HELO:'mga09.intel.com' FROM:'liyong.qiao@intel.com' RCPT:'' X-RedHat-Spam-Score: -4.222 (BAYES_50, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RP_MATCHES_RCVD, SPF_PASS) 134.134.136.24 mga09.intel.com 134.134.136.24 mga09.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: mkletzan@redhat.com, qiaowei.ren@intel.com, mtosatti@redhat.com, qiaoliyong@gmail.com Subject: [libvirt] [v4 8/9] Resctrl: Compatible mode for cdp enabled 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch support l3 cache allocation compatible mode if cdp enabled on host. In this case l3code/l3data has same schemata. Signed-off-by: Eli Qiao --- src/conf/domain_conf.c | 15 +++++++++++++-- src/util/virresctrl.c | 10 ++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d790eb8..107eb87 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15682,9 +15682,20 @@ virDomainCacheTuneDefParseXML(virDomainDefPtr def, resctrl =3D virResCtrlGet(type); =20 if (resctrl =3D=3D NULL || !resctrl->enabled) { - virReportError(VIR_ERR_XML_ERROR, + /* support cdp compatible */ + if (type =3D=3D VIR_RDT_RESOURCE_L3) { + resctrl =3D virResCtrlGet(type + 1); + if (resctrl =3D=3D NULL || !resctrl->enabled) { + virReportError(VIR_ERR_XML_ERROR, _("'host doesn't enabled cache type '%s'"), tmp); - goto cleanup; + goto cleanup; + } + VIR_WARN("Use cdp compatible mode."); + } else { + virReportError(VIR_ERR_XML_ERROR, + _("'host doesn't enabled cache type '%s'"), tmp); + goto cleanup; + } } =20 bool found_host_id =3D false; diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index e6f9f30..3552761 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -941,6 +941,7 @@ int virResCtrlSetCacheBanks(virDomainCachetunePtr cache= tune, char name[VIR_UUID_STRING_BUFLEN]; virResDomainPtr p; int type; + int pair_type =3D -1; int sid; int schemata; =20 @@ -974,6 +975,13 @@ int virResCtrlSetCacheBanks(virDomainCachetunePtr cach= etune, cachetune->cache_banks[i].type); continue; } + /* use cdp compatible mode */ + if (!VIR_RESCTRL_ENABLED(type) && + (type =3D=3D VIR_RDT_RESOURCE_L3) && + VIR_RESCTRL_ENABLED(VIR_RDT_RESOURCE_L3DATA)) { + type =3D VIR_RDT_RESOURCE_L3DATA; + pair_type =3D VIR_RDT_RESOURCE_L3CODE; + } =20 if ((sid =3D virResCtrlGetSocketIdByHostID( type, cachetune->cache_banks[i].host_id)) < 0)= { @@ -991,6 +999,8 @@ int virResCtrlSetCacheBanks(virDomainCachetunePtr cache= tune, } =20 p->schematas[type]->schemata_items[sid].schemata =3D schemata; + if (pair_type > 0) + p->schematas[pair_type]->schemata_items[sid].schemata =3D = schemata; } =20 for (i =3D 0; i < npid; i++) --=20 1.9.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list