lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <14063C7AD467DE4B82DEDB5C278E8663010F35E258@fmsmsx107.amr.corp.intel.com>
Date:   Thu, 11 Jun 2020 13:17:22 +0000
From:   "Ruhl, Michael J" <michael.j.ruhl@...el.com>
To:     "Stankiewicz, Piotr" <piotr.stankiewicz@...el.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>
CC:     "Stankiewicz, Piotr" <piotr.stankiewicz@...el.com>,
        "Dalessandro, Dennis" <dennis.dalessandro@...el.com>,
        "Marciniszyn, Mike" <mike.marciniszyn@...el.com>,
        Doug Ledford <dledford@...hat.com>,
        "Jason Gunthorpe" <jgg@...pe.ca>, Arnd Bergmann <arnd@...db.de>,
        "Shevchenko, Andriy" <andriy.shevchenko@...el.com>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate

>-----Original Message-----
>From: linux-rdma-owner@...r.kernel.org <linux-rdma-
>owner@...r.kernel.org> On Behalf Of Piotr Stankiewicz
>Sent: Tuesday, June 9, 2020 5:18 AM
>To: Bjorn Helgaas <bhelgaas@...gle.com>; linux-pci@...r.kernel.org
>Cc: Stankiewicz, Piotr <piotr.stankiewicz@...el.com>; Dalessandro, Dennis
><dennis.dalessandro@...el.com>; Marciniszyn, Mike
><mike.marciniszyn@...el.com>; Doug Ledford <dledford@...hat.com>;
>Jason Gunthorpe <jgg@...pe.ca>; Arnd Bergmann <arnd@...db.de>;
>Shevchenko, Andriy <andriy.shevchenko@...el.com>; linux-
>rdma@...r.kernel.org; linux-kernel@...r.kernel.org
>Subject: [PATCH v3 08/15] IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate
>
>Seeing as there is shorthand available to use when asking for any type
>of interrupt, or any type of message signalled interrupt, leverage it.
>
>Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@...el.com>
>Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
>---
> drivers/infiniband/hw/qib/qib_pcie.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/infiniband/hw/qib/qib_pcie.c
>b/drivers/infiniband/hw/qib/qib_pcie.c
>index 3dc6ce033319..caff44d2c12c 100644
>--- a/drivers/infiniband/hw/qib/qib_pcie.c
>+++ b/drivers/infiniband/hw/qib/qib_pcie.c
>@@ -213,7 +213,7 @@ int qib_pcie_params(struct qib_devdata *dd, u32
>minw, u32 *nent)
> 	u16 linkstat, speed;
> 	int nvec;
> 	int maxvec;
>-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
>+	unsigned int flags;
>
> 	if (!pci_is_pcie(dd->pcidev)) {
> 		qib_dev_err(dd, "Can't find PCI Express capability!\n");
>@@ -225,7 +225,9 @@ int qib_pcie_params(struct qib_devdata *dd, u32
>minw, u32 *nent)
> 	}
>
> 	if (dd->flags & QIB_HAS_INTX)
>-		flags |= PCI_IRQ_LEGACY;
>+		flags = PCI_IRQ_ALL_TYPES;
>+	else
>+		flags = PCI_IRQ_MSI_TYPES;

Thinking about lines of code, this patch could probably just be:

-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags = PCI_IRQ_MSI_TYPES;

Or maybe even:

-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags = PCI_IRQ_ALL_TYPES;

- 	if (dd->flags & QIB_HAS_INTX)
-		flags |= PCI_IRQ_LEGACY;

?

M

> 	maxvec = (nent && *nent) ? *nent : 1;
> 	nvec = pci_alloc_irq_vectors(dd->pcidev, 1, maxvec, flags);
> 	if (nvec < 0)
>--
>2.17.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ