From: Christoph Hellwig <hch@lst.de> To: Alexander Gordeev <agordeev@redhat.com> Cc: Christoph Hellwig <hch@lst.de>, tglx@linutronix.de, axboe@fb.com, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/13] pci: Provide sensible irq vector alloc/free routines Date: Sun, 10 Jul 2016 05:47:37 +0200 [thread overview] Message-ID: <20160710034737.GB15720@lst.de> (raw) In-Reply-To: <20160706080545.GA14583@dhcp-27-118.brq.redhat.com> On Wed, Jul 06, 2016 at 10:05:45AM +0200, Alexander Gordeev wrote: > > + pci_enable_msi, pci_enable_msi_range, pci_enable_msi_exact, pci_disable_msi, > > + pci_msi_vec_count, pci_enable_msix_range, pci_enable_msix_exact, > > + pci_disable_msix, pci_msix_vec_count > > Description of these functions can be removed when all drivers migrated > to the new API. Also implementation descriptions + examples would still > be needed AFAICT. I diagreed - if we deprecated functions the only thing that should be mentioned is a "don't use these". > This function's code almost matches the existing pci_enable_msix_range() > so pci_enable_msix_range() should be reworked instead IMHO. That's what earlier versions of the code did. However due to the fact that we want to avoid over-allocating the msix_vectors array (minor) and get the vectors count of the affinity mask right (major, as pointed out by you last time) I had to move the allocations inside the helpers that loop around the atctual enablement. I didn't want to change the function to a different version of the algorithm just before removing them relatively soon. But given that strong preference for changing these simple functions instead of duplicating them I've changed that patch to do that now. > We do not need to keep msix_entry array, since it only needed for > pci_irq_vector() function. But the same info could be retrieved from > msi_desc::irq. Indeed. Avoiding this allocation makes these interfaces quite a bit simpler. It requires a few prep patches, but I think it's definitively worth, so the next version will avoid the need for the msix_entry array. > > + /* use legacy irq if allowed */ > > + if (min_vecs == 1) > > + return 1; > > + return -ENOSPC; > > The original error code (in vecs) would be overridden with -ENOSPC here. Ok, fixed. > > + WARN_ON_ONCE(!dev->msi_enabled && nr > 0); > > + return dev->irq + nr; > > I think this function should check irq number existence and return the > vector number or -EINVAL; Ok, fixed. > > + unsigned int flags) > > +{ > > + if (min_vecs > 1) > > + return -ENOSPC; > > In case CONFIG_PCI_MSI is unset min_vecs > 1 is -EINVAL; Ok, fixed.
WARNING: multiple messages have this Message-ID (diff)
From: hch@lst.de (Christoph Hellwig) Subject: [PATCH 07/13] pci: Provide sensible irq vector alloc/free routines Date: Sun, 10 Jul 2016 05:47:37 +0200 [thread overview] Message-ID: <20160710034737.GB15720@lst.de> (raw) In-Reply-To: <20160706080545.GA14583@dhcp-27-118.brq.redhat.com> On Wed, Jul 06, 2016@10:05:45AM +0200, Alexander Gordeev wrote: > > + pci_enable_msi, pci_enable_msi_range, pci_enable_msi_exact, pci_disable_msi, > > + pci_msi_vec_count, pci_enable_msix_range, pci_enable_msix_exact, > > + pci_disable_msix, pci_msix_vec_count > > Description of these functions can be removed when all drivers migrated > to the new API. Also implementation descriptions + examples would still > be needed AFAICT. I diagreed - if we deprecated functions the only thing that should be mentioned is a "don't use these". > This function's code almost matches the existing pci_enable_msix_range() > so pci_enable_msix_range() should be reworked instead IMHO. That's what earlier versions of the code did. However due to the fact that we want to avoid over-allocating the msix_vectors array (minor) and get the vectors count of the affinity mask right (major, as pointed out by you last time) I had to move the allocations inside the helpers that loop around the atctual enablement. I didn't want to change the function to a different version of the algorithm just before removing them relatively soon. But given that strong preference for changing these simple functions instead of duplicating them I've changed that patch to do that now. > We do not need to keep msix_entry array, since it only needed for > pci_irq_vector() function. But the same info could be retrieved from > msi_desc::irq. Indeed. Avoiding this allocation makes these interfaces quite a bit simpler. It requires a few prep patches, but I think it's definitively worth, so the next version will avoid the need for the msix_entry array. > > + /* use legacy irq if allowed */ > > + if (min_vecs == 1) > > + return 1; > > + return -ENOSPC; > > The original error code (in vecs) would be overridden with -ENOSPC here. Ok, fixed. > > + WARN_ON_ONCE(!dev->msi_enabled && nr > 0); > > + return dev->irq + nr; > > I think this function should check irq number existence and return the > vector number or -EINVAL; Ok, fixed. > > + unsigned int flags) > > +{ > > + if (min_vecs > 1) > > + return -ENOSPC; > > In case CONFIG_PCI_MSI is unset min_vecs > 1 is -EINVAL; Ok, fixed.
next prev parent reply other threads:[~2016-07-10 3:47 UTC|newest] Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-07-04 8:39 automatic interrupt affinity for MSI/MSI-X capable devices V3 Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` [PATCH 01/13] irq/msi: Remove unused MSI_FLAG_IDENTITY_MAP Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:32 ` [tip:irq/core] genirq/msi: " tip-bot for Thomas Gleixner 2016-07-04 8:39 ` [PATCH 02/13] irq: Introduce IRQD_AFFINITY_MANAGED flag Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:32 ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner 2016-07-04 8:39 ` [PATCH 03/13] irq: Add affinity hint to irq allocation Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:33 ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner [not found] ` <1468875386-31662-1-git-send-email-vincent.stehle@laposte.net> 2016-07-19 3:56 ` [PATCH next] genirq: fix missing irq allocation affinity hint Christoph Hellwig 2016-07-19 12:03 ` Thomas Gleixner 2016-07-04 8:39 ` [PATCH 04/13] irq: Use affinity hint in irqdesc allocation Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:33 ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner 2016-07-04 8:39 ` [PATCH 05/13] irq/msi: Make use of affinity aware allocations Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:33 ` [tip:irq/core] genirq/msi: " tip-bot for Thomas Gleixner 2016-07-04 8:39 ` [PATCH 06/13] irq: add a helper spread an affinity mask for MSI/MSI-X vectors Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:34 ` [tip:irq/core] genirq: Add a helper to " tip-bot for Christoph Hellwig 2016-07-04 8:39 ` [PATCH 07/13] pci: Provide sensible irq vector alloc/free routines Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-06 8:05 ` Alexander Gordeev 2016-07-06 8:05 ` Alexander Gordeev 2016-07-10 3:47 ` Christoph Hellwig [this message] 2016-07-10 3:47 ` Christoph Hellwig 2016-07-11 10:43 ` Alexander Gordeev 2016-07-11 10:43 ` Alexander Gordeev 2016-07-12 9:13 ` Christoph Hellwig 2016-07-12 9:13 ` Christoph Hellwig 2016-07-12 12:46 ` Alexander Gordeev 2016-07-12 12:46 ` Alexander Gordeev 2016-07-04 8:39 ` [PATCH 08/13] pci: spread interrupt vectors in pci_alloc_irq_vectors Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-07 11:05 ` Alexander Gordeev 2016-07-07 11:05 ` Alexander Gordeev 2016-07-10 3:57 ` Christoph Hellwig 2016-07-10 3:57 ` Christoph Hellwig 2016-07-12 6:49 ` Alexander Gordeev 2016-07-12 6:49 ` Alexander Gordeev 2016-07-04 8:39 ` [PATCH 09/13] blk-mq: don't redistribute hardware queues on a CPU hotplug event Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` [PATCH 10/13] blk-mq: only allocate a single mq_map per tag_set Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` [PATCH 11/13] blk-mq: allow the driver to pass in an affinity mask Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` [PATCH 12/13] nvme: switch to use pci_alloc_irq_vectors Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-07 19:30 ` Alexander Gordeev 2016-07-07 19:30 ` Alexander Gordeev 2016-07-10 3:59 ` Christoph Hellwig 2016-07-10 3:59 ` Christoph Hellwig 2016-07-04 8:39 ` [PATCH 13/13] nvme: remove the post_scan callout Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 8:39 ` Christoph Hellwig 2016-07-04 10:30 ` automatic interrupt affinity for MSI/MSI-X capable devices V3 Thomas Gleixner 2016-07-04 10:30 ` Thomas Gleixner -- strict thread matches above, loose matches on Subject: below -- 2016-06-14 19:58 automatic interrupt affinity for MSI/MSI-X capable devices V2 Christoph Hellwig 2016-06-14 19:59 ` [PATCH 07/13] pci: Provide sensible irq vector alloc/free routines Christoph Hellwig 2016-06-14 19:59 ` Christoph Hellwig 2016-06-14 19:59 ` Christoph Hellwig 2016-06-23 11:16 ` Alexander Gordeev 2016-06-23 11:16 ` Alexander Gordeev 2016-06-30 16:54 ` Christoph Hellwig 2016-06-30 16:54 ` Christoph Hellwig 2016-06-30 17:28 ` Alexander Gordeev 2016-06-30 17:28 ` Alexander Gordeev 2016-06-30 17:35 ` Christoph Hellwig 2016-06-30 17:35 ` Christoph Hellwig
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20160710034737.GB15720@lst.de \ --to=hch@lst.de \ --cc=agordeev@redhat.com \ --cc=axboe@fb.com \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvme@lists.infradead.org \ --cc=linux-pci@vger.kernel.org \ --cc=tglx@linutronix.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.