From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D2AC1A0032; Fri, 29 Oct 2021 09:39:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9217540688; Fri, 29 Oct 2021 09:39:05 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 5BE9340395 for ; Fri, 29 Oct 2021 09:39:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635493143; 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; bh=VxVvFUoWZWL8hR42aOO3xKEW0QHR6hizWVp51AscAck=; b=O2xzrQ+JiLWyLYTe5aSMCnVOCR+jbVRALrHWeckGy8k08BuhUC//1s2id7WcxiVRlV7yMo bXtmMFdhG+LSsubnScFKHgVzLzAvMQsw0RzZNrBdDN3QsJ3IsvG/0SadUoxIqllmQvTeJU mE4Sf7tMNvEzY1l19Upoef+OMxF1E6Y= 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-333-wwOFaYgsPwagABkV2sk3sQ-1; Fri, 29 Oct 2021 03:39:02 -0400 X-MC-Unique: wwOFaYgsPwagABkV2sk3sQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F29718125C0; Fri, 29 Oct 2021 07:39:01 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.79]) by smtp.corp.redhat.com (Postfix) with ESMTP id C22EA60854; Fri, 29 Oct 2021 07:38:59 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Anatoly Burakov , Dmitry Kozlyuk , Harman Kalra Date: Fri, 29 Oct 2021 09:38:19 +0200 Message-Id: <20211029073819.29336-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH] interrupts: do not resize event list for non MSIX X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Resizing event list only makes sense in MSIX case. Besides, event list has always been RTE_MAX_RXTX_INTR_VEC_ID large. Let's restore this assumption for code that might rely on this property and only enlarge the event list when necessary. Bugzilla ID: 843, 865 Fixes: 8cb5d08db940 ("interrupts: extend event list") Signed-off-by: David Marchand --- drivers/bus/pci/linux/pci_vfio.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index f622e7f8e6..edcee92556 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -266,12 +266,6 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd) return -1; } - /* Reallocate the efds and elist fields of intr_handle based - * on PCI device MSIX size. - */ - if (rte_intr_event_list_update(dev->intr_handle, irq.count)) - return -1; - /* if this vector cannot be used with eventfd, fail if we explicitly * specified interrupt type, otherwise continue */ if ((irq.flags & VFIO_IRQ_INFO_EVENTFD) == 0) { @@ -283,6 +277,14 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd) continue; } + /* Reallocate the efds and elist fields of intr_handle based + * on PCI device MSIX size. + */ + if (i == VFIO_PCI_MSIX_IRQ_INDEX && + (uint32_t)rte_intr_nb_intr_get(dev->intr_handle) < irq.count && + rte_intr_event_list_update(dev->intr_handle, irq.count)) + return -1; + /* set up an eventfd for interrupts */ fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); if (fd < 0) { -- 2.23.0