From nobody Mon Feb 9 18:44:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599661462; cv=none; d=zohomail.com; s=zohoarc; b=XTVsAmWahtZxWZEK4+HBDEXbXfL6egYF4ddrpKUpXGHuRQcVdMjBih66GSDVhin6Us3m1GH6e5NVR60Jo9WPgq4Po2VtokYJrxx7ozphoxCe6gPlWoY1aT6OIdDK6/o5/an0W3D4UsIMwxkJswoHnVdOeFsT7k1SCRsVmemNQOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599661462; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=hl24NRJ8Rt13BsX1usyBfMcCTpzjZpiQVXtc8EueBIg=; b=i1Gj1aos1P7u7fYUUPZ8W/ERJvhELaYWIjMxAh2dX9YiTNj65isjQ3Hl5PggnWcYshShBSAe5EJLxtH4sFhP7aJt71Gzrpw7N2O3EOy8XqxhYuOkmPq/LeUt6U5q8N0U4i+rokN7norO84ZBIu1gfAGBhzr9IvzaW7+yb14EZmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599661462883612.7761102160484; Wed, 9 Sep 2020 07:24:22 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-ZnBjMyGaNgiP8b33fK7TEw-1; Wed, 09 Sep 2020 10:24:19 -0400 Received: by mail-wm1-f71.google.com with SMTP id m125so838582wmm.7 for ; Wed, 09 Sep 2020 07:24:17 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id b187sm4172577wmb.8.2020.09.09.07.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 07:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599661461; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=hl24NRJ8Rt13BsX1usyBfMcCTpzjZpiQVXtc8EueBIg=; b=BOjkyjv69vCNneqBQo99Xa9EskUdqVNUMLVPet8JyLwMjmfM1SILeqMJpyXRg1pWBno8yE Lt0nrkVTs5rjcqG0TDgMsHAz1k+/fB0RS9xhXPmgnSvNgL4ctEMivS267sW3x8n08KAFsi mBscPxgOs1UOsRa2L7hty+85oPUiuW4= X-MC-Unique: ZnBjMyGaNgiP8b33fK7TEw-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=hl24NRJ8Rt13BsX1usyBfMcCTpzjZpiQVXtc8EueBIg=; b=JvBaY1b80sHhh0WxGqT+mSfF4+wZSUzUHfv9+le+Pq2dkKeNRp9o4JCgPYGzNJJrMv vs87906+JOD8QHTdaF/UUM0VrssZcVUZXT19KuRuarTB8Zu9A/SJkfayZGy+k7kKTHcR 3Hy6P+PT+5nKlSrdQRf6YypY+y9kooXnxhqgDEFy2zSFBlcZAwe5qy31GnBoa2UIIY6m nX67ejvVQiN5OEy/wpXEttYONG+3CZzCT2dMrMvIWPnRN6cZSLTkEl5k0fauz8VETocZ 7sw76Bx1QhCAUZL0m6j5mVufVl3/xQFsWc4m/mgB5NTREYFHtclfTj1q10wcURNbrW5s X95A== X-Gm-Message-State: AOAM533muni0QmIsyAtDn5yo9sZh26HUAiEzxhLgOMGc1mVbjHvrIiBb 9ZZbmip19sPC1kEVhdAM68GFQGK6uu2FwBqdwDqg32528Oosy4LYzqZI4gH5fb0zrx20WvN1w1M EFD1kdmWEF1xNcg== X-Received: by 2002:a1c:6341:: with SMTP id x62mr3814937wmb.70.1599661456336; Wed, 09 Sep 2020 07:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2AuS7XclxQglsXhutPrkRcK+UtTdydKLuczpxR70nsEyCL2jF0vcml4H9rgqTzZrK7nihWw== X-Received: by 2002:a1c:6341:: with SMTP id x62mr3814920wmb.70.1599661456134; Wed, 09 Sep 2020 07:24:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Max Reitz , qemu-block@nongnu.org, Kevin Wolf , Fam Zheng , Alex Williamson , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 4/4] block/nvme: Use qemu_vfio_pci_init_msix_irqs() to initialize our IRQ Date: Wed, 9 Sep 2020 16:23:54 +0200 Message-Id: <20200909142354.334859-5-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200909142354.334859-1-philmd@redhat.com> References: <20200909142354.334859-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Instead of initializing one MSIX IRQ with the generic qemu_vfio_pci_init_irq() function, use the MSIX specific one which will allow us to use multiple IRQs. For now we provide an array of a single IRQ. Reviewed-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- block/nvme.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index f4f27b6da7d..e6dac027f72 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -694,6 +694,7 @@ static int nvme_init(BlockDriverState *bs, const char *= device, int namespace, uint64_t timeout_ms; uint64_t deadline, now; Error *local_err =3D NULL; + unsigned irq_count =3D MSIX_IRQ_COUNT; =20 qemu_co_mutex_init(&s->dma_map_lock); qemu_co_queue_init(&s->dma_flush_queue); @@ -779,9 +780,13 @@ static int nvme_init(BlockDriverState *bs, const char = *device, int namespace, } } =20 - ret =3D qemu_vfio_pci_init_irq(s->vfio, s->irq_notifier, - VFIO_PCI_MSIX_IRQ_INDEX, errp); + ret =3D qemu_vfio_pci_init_msix_irqs(s->vfio, s->irq_notifier, + &irq_count, errp); if (ret) { + if (ret =3D=3D -EOVERFLOW) { + error_append_hint(errp, "%u IRQs requested but only %u availab= le\n", + MSIX_IRQ_COUNT, irq_count); + } goto out; } aio_set_event_notifier(bdrv_get_aio_context(bs), --=20 2.26.2