From nobody Sun Jun 2 09:05:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1670504616; cv=none; d=zohomail.com; s=zohoarc; b=BWxwQlPZFMv/GsHBtqTzwsQJYeB7yIQlNXMW+Pzo0g2mY94cwcb2FLi+uj/GXX7390B9u59CB0TZiOaOn24/SvMeDPElWpZV0c8zEsmr9nVPBOeAv0UHk1U6tr0tCkiQBIk4wA+jccLOIADRnEO/JeMksNo3JxccoXvo+tJAX8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670504616; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=vQ1MJBM7buXMAlwjVHdTAMeLKyTOCOIH6zGuXwyl5tA=; b=f9Vn0begW//61S78Ssg1GKdfbganB9oxztMEWTjYgjtoutTWYC5sZYfCywxMI+kHo8QcXaJiqoPjiY7xNNepsNxbvKaaxMQBYhqeV6yS2sZpwst2wyGKcRR5orrXQHlEE3E6dp7paEwWiz9uuqZA4Z2x3i3zun4rCitHNk3PkkI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1670504616834990.9781530391839; Thu, 8 Dec 2022 05:03:36 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-457-Nw16wetzM5GQSAEg16QKgg-1; Thu, 08 Dec 2022 08:03:33 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5BB3286C153; Thu, 8 Dec 2022 13:03:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7772A492B05; Thu, 8 Dec 2022 13:03:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2BC871946A44; Thu, 8 Dec 2022 13:03:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C544D1946A41 for ; Thu, 8 Dec 2022 13:03:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 84CE32166B29; Thu, 8 Dec 2022 13:03:26 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D8FB2166B26 for ; Thu, 8 Dec 2022 13:03:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 285F32A59562 for ; Thu, 8 Dec 2022 13:03:26 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-304-XHByxmg8NSyP4F8ZDrJPXA-1; Thu, 08 Dec 2022 08:03:24 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NSZ7S59p1zmWNh for ; Thu, 8 Dec 2022 21:02:28 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 8 Dec 2022 21:03:19 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670504615; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vQ1MJBM7buXMAlwjVHdTAMeLKyTOCOIH6zGuXwyl5tA=; b=Jr/NkRB4r4yXGMaedeOzA44Pv1JCiC2PfguMQgB/RB3BQMGqSSbCKs98GwBtx0j9nxHFlV MOMxjGvHvElaW1EtWzSj7S2121+89Lt+VY4Faz0mv0Ft2e0QYI24MLAiZdMZi8TTSRVOYH /zy4olGTep+YBOMt8jL3aB86plPRvto= X-MC-Unique: Nw16wetzM5GQSAEg16QKgg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: XHByxmg8NSyP4F8ZDrJPXA-1 From: Jiang Jiacheng To: Subject: [PATCH] conf: check vhost-user queues with vcpus Date: Thu, 8 Dec 2022 20:52:19 +0800 Message-ID: <20221208125219.2940088-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected 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 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1670504617609100001 Content-Type: text/plain; charset="utf-8" With kernel without the ref patch, if queues > vcpus, interrupts will be centralized on one vcpu affecting guest performance. After the ref patch merged, the queues whose number is greater than the number of vcpus will not be used. Considering the above, it's better to check the counts of vhost-user queues and vcpus. ref: https://patchwork.kernel.org/project/linux-scsi/cover/1553682995-5682-1-git= -send-email-dongli.zhang@oracle.com/ Signed-off-by: Jiang Jiacheng --- src/conf/domain_validate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 95b8d9b419..6106e79999 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -308,7 +308,7 @@ virSecurityDeviceLabelDefValidate(virSecurityDeviceLabe= lDef **seclabels, =20 =20 static int -virDomainDiskVhostUserValidate(const virDomainDiskDef *disk) +virDomainDiskVhostUserValidate(const virDomainDef *def, const virDomainDis= kDef *disk) { if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_VIRTIO) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -465,6 +465,12 @@ virDomainDiskVhostUserValidate(const virDomainDiskDef = *disk) return -1; } =20 + if (disk->queues > virDomainDefGetVcpus(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("vhost-user disk queues must <=3D vcpus")); + return -1; + } + return 0; } =20 @@ -807,7 +813,7 @@ virDomainDiskDefValidate(const virDomainDef *def, } =20 if (disk->src->type =3D=3D VIR_STORAGE_TYPE_VHOST_USER && - virDomainDiskVhostUserValidate(disk) < 0) { + virDomainDiskVhostUserValidate(def, disk) < 0) { return -1; } =20 --=20 2.33.0