All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Gordeev <agordeev@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Michael Ellerman <michael@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Tejun Heo <tj@kernel.org>,
	Ben Hutchings <bhutchings@solarflare.com>,
	David Laight <David.Laight@ACULAB.COM>,
	Mark Lord <kernel@start.ca>, "H. Peter Anvin" <hpa@zytor.com>,
	linux-pci@vger.kernel.org
Subject: [PATCH RFC v2 00/29] Introduce pcim_enable_msi*() family helpers
Date: Fri, 18 Oct 2013 19:12:00 +0200	[thread overview]
Message-ID: <cover.1382103786.git.agordeev@redhat.com> (raw)

This series is against "next" branch in Bjorn's repo:
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git

Currently many device drivers need contiguously call functions
pci_enable_msix() for MSI-X or pci_enable_msi_block() for MSI
in a loop until success or failure. This update generalizes
this usage pattern and introduces pcim_enable_msi*() family
helpers.

As result, device drivers do not have to deal with tri-state
return values from pci_enable_msix() and pci_enable_msi_block()
functions directly and expected to have more clearer and straight
code.

So i.e. the request loop described in the documentation...

	int foo_driver_enable_msix(struct foo_adapter *adapter,
				   int nvec)
	{
		while (nvec >= FOO_DRIVER_MINIMUM_NVEC) {
			rc = pci_enable_msix(adapter->pdev,
					     adapter->msix_entries,
					     nvec);
			if (rc > 0)
				nvec = rc;
			else
				return rc;
		}

		return -ENOSPC;
	}

...would turn into a single helper call....

	rc = pcim_enable_msix_range(adapter->pdev,
				    adapter->msix_entries,
				    nvec,
				    FOO_DRIVER_MINIMUM_NVEC);


Device drivers with more specific requirements (i.e. a number of
MSI-Xs which is a multiple of a certain number within a specified
range) would still need to implement the loop using the two old
functions.

It is fair to say the proposal in v1 ("Re-design MSI/MSI-X interrupts
enablement pattern")is scrapped. Thus, I do not clarify what are the
changes since v1  - the whole v2 series could be
considered as completely new.

Device driver updates (patches 12-29) are provided to clarify the
change and expected to get reviews in follow-up post(s) when/if
patch 12 ("PCI/MSI: Introduce pcim_enable_msi*() family helpers")
is accepted.

Patches 1,2	- ACK'ed tweaks for s390 architecture
Patches 3,4	- fixes for PowerPC pSeries platform
Patches 5-12	- fixes, tweaks and changes of the generic MSI code
Patches 12-29	- example updates of few device drivers

The tree could be found in "pci-next-msi-v2" branch in repo:
https://github.com/a-gordeev/linux.git

Alexander Gordeev (29):
  PCI/MSI/s390: Fix single MSI only check
  PCI/MSI/s390: Remove superfluous check of MSI type
  PCI/MSI/pSeries: Fix wrong error code reporting
  PCI/MSI/pSeries: Make quota traversing and requesting race-safe
  PCI/MSI: Fix return value when populate_msi_sysfs() failed
  PCI/MSI: Get rid of useless count of msi_desc leftovers
  PCI/MSI: Return -ENOSYS for unimplemented interfaces, not -1
  PCI/MSI: Make pci_enable_msix() 'nvec' argument unsigned int
  PCI/MSI: Factor out pci_get_msi_cap() interface
  PCI/MSI: Get rid of pci_enable_msi_block_auto() interface
  PCI/MSI: Convert pci_msix_table_size() to a public interface
  PCI/MSI: Introduce pcim_enable_msi*() family helpers
  ipr: Do not call pci_disable_msi/msix() if pci_enable_msi/msix()
    failed
  ipr: Make use of pcim_enable_msi/msix() interfaces
  ixgbe: Make use of pcim_enable_msix_range() interface
  ixgbevf: Make use of pcim_enable_msix_range() interface
  megaraid: Make use of pcim_enable_msix() interface
  ntb: Fix missed call to pci_enable_msix()
  ntb: Make use of pcim_enable_msix/msix_exact() interfaces
  qib: Make use of pcim_enable_msix() and pci_msix_table_size()
    interfaces
  qla2xxx: Make use of pcim_enable_msix_range() interface
  qlge: Get rid of an redundant assignment
  qlge: Make use of pcim_enable_msix() interface
  tg3: Make use of pcim_enable_msix() interface
  vmxnet3: Return -EINVAL if number of requested MSI-Xs is not enough
  vmxnet3: Fixup a weird loop exit
  vmxnet3: Return -ENOSPC when not enough MSI-X vectors available
  vmxnet3: Limit number of rx queues to 1 if per-queue MSI-Xs failed
  vmxnet3: Make use of pcim_enable_msix_range() interface

 Documentation/PCI/MSI-HOWTO.txt                   |  169 ++++++++++++++++++---
 arch/powerpc/platforms/pseries/msi.c              |   26 +++-
 arch/s390/pci/pci.c                               |    4 +-
 drivers/ata/ahci.c                                |   56 +++++---
 drivers/infiniband/hw/qib/qib_pcie.c              |   48 +++---
 drivers/net/ethernet/broadcom/tg3.c               |    6 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c      |   16 +--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   33 ++---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c      |   16 +--
 drivers/net/vmxnet3/vmxnet3_drv.c                 |   58 +++-----
 drivers/ntb/ntb_hw.c                              |   34 ++---
 drivers/pci/msi.c                                 |  129 +++++++++-------
 drivers/pci/pcie/portdrv_core.c                   |    5 +-
 drivers/scsi/ipr.c                                |   51 +++----
 drivers/scsi/megaraid/megaraid_sas_base.c         |   16 +--
 drivers/scsi/qla2xxx/qla_isr.c                    |   28 ++--
 include/linux/pci.h                               |   79 +++++++++--
 17 files changed, 466 insertions(+), 308 deletions(-)

-- 
1.7.7.6


             reply	other threads:[~2013-10-19  7:04 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 17:12 Alexander Gordeev [this message]
2013-10-18 17:12 ` [PATCH RFC v2 01/29] PCI/MSI/s390: Fix single MSI only check Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 02/29] PCI/MSI/s390: Remove superfluous check of MSI type Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 03/29] PCI/MSI/pSeries: Fix wrong error code reporting Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 04/29] PCI/MSI/pSeries: Make quota traversing and requesting race-safe Alexander Gordeev
2013-11-20 15:43   ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 05/29] PCI/MSI: Fix return value when populate_msi_sysfs() failed Alexander Gordeev
2013-11-20 15:50   ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 06/29] PCI/MSI: Get rid of useless count of msi_desc leftovers Alexander Gordeev
2013-11-20 16:07   ` Tejun Heo
2013-11-22 18:27     ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 07/29] PCI/MSI: Return -ENOSYS for unimplemented interfaces, not -1 Alexander Gordeev
2013-11-20 16:07   ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 08/29] PCI/MSI: Make pci_enable_msix() 'nvec' argument unsigned int Alexander Gordeev
2013-11-20 16:14   ` Tejun Heo
2013-11-22 18:34     ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 09/29] PCI/MSI: Factor out pci_get_msi_cap() interface Alexander Gordeev
2013-11-20 16:18   ` Tejun Heo
2013-11-25 13:49     ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 10/29] PCI/MSI: Get rid of pci_enable_msi_block_auto() interface Alexander Gordeev
2013-11-20 16:21   ` Tejun Heo
2013-10-18 17:12 ` [PATCH RFC v2 11/29] PCI/MSI: Convert pci_msix_table_size() to a public interface Alexander Gordeev
2013-11-20 16:23   ` Tejun Heo
2013-11-22 18:38     ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Alexander Gordeev
2013-10-24 10:51   ` Tejun Heo
2013-10-24 10:57     ` David Laight
2013-10-24 11:01       ` Tejun Heo
2013-10-24 11:41       ` Alexander Gordeev
2013-10-25  2:22         ` Mark Lord
2013-10-25  9:10           ` David Laight
2013-10-25  9:10             ` David Laight
2013-10-25 10:01             ` Alexander Gordeev
2013-10-25 14:52               ` intel e1000e pci driver issue on RT Linux kernel Karicheri, Muralidharan
2013-10-25 14:59                 ` Karicheri, Muralidharan
2013-10-27 22:27               ` [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Michael Ellerman
2013-10-28 16:30               ` Mark Lord
2013-10-24 14:31     ` Alexander Gordeev
2013-10-25  2:23       ` Mark Lord
2013-11-04  8:12     ` Alexander Gordeev
2013-11-20 17:15   ` Tejun Heo
2013-11-22 18:44     ` Alexander Gordeev
2013-11-22 18:44       ` Tejun Heo
2013-11-22 18:54         ` Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 13/29] ipr: Do not call pci_disable_msi/msix() if pci_enable_msi/msix() failed Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 14/29] ipr: Make use of pcim_enable_msi/msix() interfaces Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 15/29] ixgbe: Make use of pcim_enable_msix_range() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 16/29] ixgbevf: " Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 17/29] megaraid: Make use of pcim_enable_msix() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 18/29] ntb: Fix missed call to pci_enable_msix() Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 19/29] ntb: Make use of pcim_enable_msix/msix_exact() interfaces Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 20/29] qib: Make use of pcim_enable_msix() and pci_msix_table_size() interfaces Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 21/29] qla2xxx: Make use of pcim_enable_msix_range() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 22/29] qlge: Get rid of an redundant assignment Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 23/29] qlge: Make use of pcim_enable_msix() interface Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 24/29] tg3: " Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 25/29] vmxnet3: Return -EINVAL if number of requested MSI-Xs is not enough Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 26/29] vmxnet3: Fixup a weird loop exit Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 27/29] vmxnet3: Return -ENOSPC when not enough MSI-X vectors available Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 28/29] vmxnet3: Limit number of rx queues to 1 if per-queue MSI-Xs failed Alexander Gordeev
2013-10-18 17:12 ` [PATCH RFC v2 29/29] vmxnet3: Make use of pcim_enable_msix_range() interface Alexander Gordeev
2013-10-21  8:51   ` David Laight
2013-10-21 10:19     ` Alexander Gordeev
2013-11-11 19:56 ` [PATCH RFC v2 00/29] Introduce pcim_enable_msi*() family helpers Alexander Gordeev
2013-11-20 17:16 ` Tejun Heo

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=cover.1382103786.git.agordeev@redhat.com \
    --to=agordeev@redhat.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=bhutchings@solarflare.com \
    --cc=hpa@zytor.com \
    --cc=kernel@start.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=michael@ellerman.id.au \
    --cc=tj@kernel.org \
    /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: link
Be 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.