linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
  • [parent not found: <338c9012577acf694eb23622902185584987bd8f.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <467ce10b1df795edf80ed222816ab739fee7b0ea.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <3ff5236944aae69f2cd934b5b6da7c1c269df7c1.1380703262.git.agordeev@redhat.com>]
  • [parent not found: <5d9c5b2d3bbc444ff32bddeece7a239d046bd79c.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <0590d63c3432229a3824bada71e07a08fb955498.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <49eb592e15aaec804f9c11ca132d2b85c516aefa.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <9650a7dfbcfd5f1da21f7b093665abf4b1041071.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <9d424912ef78993dc75e2af5006cd12913e9e7e7.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <9c282c4ab92731c719d161d2db6fc54ce33891d9.1380703262.git.agordeev@redhat.com>]
  • * [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern
           [not found] <cover.1380703262.git.agordeev@redhat.com>
                       ` (9 preceding siblings ...)
           [not found] ` <9c282c4ab92731c719d161d2db6fc54ce33891d9.1380703262.git.agordeev@redhat.com>
    @ 2013-10-03 22:49 ` Ben Hutchings
      2013-10-04  8:29   ` Alexander Gordeev
           [not found] ` <8c9811b13fd93e73641dab8e3bd1bd5b2dc37a61.1380703262.git.agordeev@redhat.com>
                       ` (7 subsequent siblings)
      18 siblings, 1 reply; 53+ messages in thread
    From: Ben Hutchings @ 2013-10-03 22:49 UTC (permalink / raw)
    
    
    On Wed, 2013-10-02@12:48 +0200, Alexander Gordeev wrote:
    > This series is against "next" branch in Bjorn's repo:
    > git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
    > 
    > Currently pci_enable_msi_block() and pci_enable_msix() interfaces
    > return a error code in case of failure, 0 in case of success and a
    > positive value which indicates the number of MSI-X/MSI interrupts
    > that could have been allocated. The latter value should be passed
    > to a repeated call to the interfaces until a failure or success:
    >
    > 
    > 	for (i = 0; i < FOO_DRIVER_MAXIMUM_NVEC; i++)
    > 		adapter->msix_entries[i].entry = i;
    > 
    > 	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;
    > 
    > 
    > This technique proved to be confusing and error-prone. Vast share
    > of device drivers simply fail to follow the described guidelines.
    > 
    > This update converts pci_enable_msix() and pci_enable_msi_block()
    > interfaces to canonical kernel functions and makes them return a
    > error code in case of failure or 0 in case of success.
    [...]
    
    I think this is fundamentally flawed: pci_msix_table_size() and
    pci_get_msi_cap() can only report the limits of the *device* (which the
    driver usually already knows), whereas MSI allocation can also be
    constrained due to *global* limits on the number of distinct IRQs.
    
    Currently pci_enable_msix() will report a positive value if it fails due
    to the global limit.  Your patch 7 removes that.  pci_enable_msi_block()
    unfortunately doesn't appear to do this.
    
    It seems to me that a more useful interface would take a minimum and
    maximum number of vectors from the driver.  This wouldn't allow the
    driver to specify that it could only accept, say, any even number within
    a certain range, but you could still leave the current functions
    available for any driver that needs that.
    
    Ben.
    
    -- 
    Ben Hutchings, Staff Engineer, Solarflare
    Not speaking for my employer; that's the marketing department's job.
    They asked us to note that Solarflare product names are trademarked.
    
    ^ permalink raw reply	[flat|nested] 53+ messages in thread
  • [parent not found: <8c9811b13fd93e73641dab8e3bd1bd5b2dc37a61.1380703262.git.agordeev@redhat.com>]
  • [parent not found: <bae65aa3e30dfd23bd5ed47add7310cfbb96243a.1380703262.git.agordeev@redhat.com>]
  • [parent not found: <e8b51bd48c24d0fc4ee8adea5c138c9bf84191e9.1380703262.git.agordeev@redhat.com>]
  • [parent not found: <d8c36203ada6efbfa9f7ce92c2f713ee3b6d6b8d.1380703262.git.agordeev@redhat.com>]
  • * [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern
           [not found] <cover.1380703262.git.agordeev@redhat.com>
                       ` (14 preceding siblings ...)
           [not found] ` <d8c36203ada6efbfa9f7ce92c2f713ee3b6d6b8d.1380703262.git.agordeev@redhat.com>
    @ 2013-10-07 18:21 ` Tejun Heo
      2013-10-08  9:07   ` Alexander Gordeev
      2013-10-08  4:33 ` Michael Ellerman
                       ` (2 subsequent siblings)
      18 siblings, 1 reply; 53+ messages in thread
    From: Tejun Heo @ 2013-10-07 18:21 UTC (permalink / raw)
    
    
    Hello, Alexander.
    
    On Wed, Oct 02, 2013@12:48:16PM +0200, Alexander Gordeev wrote:
    > Alexander Gordeev (77):
    >   PCI/MSI: Fix return value when populate_msi_sysfs() failed
    >   PCI/MSI/PPC: Fix wrong RTAS error code reporting
    >   PCI/MSI/s390: Fix single MSI only check
    >   PCI/MSI/s390: Remove superfluous check of MSI type
    >   PCI/MSI: Convert pci_msix_table_size() to a public interface
    >   PCI/MSI: Factor out pci_get_msi_cap() interface
    >   PCI/MSI: Re-design MSI/MSI-X interrupts enablement pattern
    >   PCI/MSI: Get rid of pci_enable_msi_block_auto() interface
    >   ahci: Update MSI/MSI-X interrupts enablement code
    >   ahci: Check MRSM bit when multiple MSIs enabled
    ...
    
    Whee.... that's a lot more than I expected.  I was just scanning
    multiple msi users.  Maybe we can stage the work in more manageable
    steps so that you don't have to go through massive conversion only to
    do it all over again afterwards and likewise people don't get
    bombarded on each iteration?  Maybe we can first update pci / msi code
    proper, msi and then msix?
    
    Thanks.
    
    -- 
    tejun
    
    ^ permalink raw reply	[flat|nested] 53+ messages in thread
  • * [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern
           [not found] <cover.1380703262.git.agordeev@redhat.com>
                       ` (15 preceding siblings ...)
      2013-10-07 18:21 ` [PATCH RFC 00/77] " Tejun Heo
    @ 2013-10-08  4:33 ` Michael Ellerman
      2013-10-08  7:33   ` Alexander Gordeev
           [not found] ` <c92efbde96541d08f37510422c096d543bb01279.1380703263.git.agordeev@redhat.com>
           [not found] ` <5254D397.9030307@zytor.com>
      18 siblings, 1 reply; 53+ messages in thread
    From: Michael Ellerman @ 2013-10-08  4:33 UTC (permalink / raw)
    
    
    On Wed, Oct 02, 2013@12:29:04PM +0200, Alexander Gordeev wrote:
    > This series is against "next" branch in Bjorn's repo:
    > git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
    > 
    > Currently pci_enable_msi_block() and pci_enable_msix() interfaces
    > return a error code in case of failure, 0 in case of success and a
    > positive value which indicates the number of MSI-X/MSI interrupts
    > that could have been allocated. The latter value should be passed
    > to a repeated call to the interfaces until a failure or success:
    > 
    > 
    > 	for (i = 0; i < FOO_DRIVER_MAXIMUM_NVEC; i++)
    > 		adapter->msix_entries[i].entry = i;
    > 
    > 	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;
    > 
    > 
    > This technique proved to be confusing and error-prone. Vast share
    > of device drivers simply fail to follow the described guidelines.
    
    To clarify "Vast share of device drivers":
    
     - 58 drivers call pci_enable_msix()
     - 24 try a single allocation and then fallback to MSI/LSI
     - 19 use the loop style allocation as above
     - 14 try an allocation, and if it fails retry once
     - 1  incorrectly continues when pci_enable_msix() returns > 0
    
    So 33 drivers (> 50%) successfully make use of the "confusing and
    error-prone" return value.
    
    Another 24 happily ignore it, which is also entirely fine.
    
    And yes, one is buggy, so obviously the interface is too complex. Thanks
    drivers/ntb/ntb_hw.c
    
    cheers
    
    ^ permalink raw reply	[flat|nested] 53+ messages in thread
  • [parent not found: <c92efbde96541d08f37510422c096d543bb01279.1380703263.git.agordeev@redhat.com>]
  • [parent not found: <5254D397.9030307@zytor.com>]

  • end of thread, other threads:[~2013-10-10 18:07 UTC | newest]
    
    Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <cover.1380703262.git.agordeev@redhat.com>
         [not found] ` <2d4272136269f3cb3b1a5ac53b12aa45c7ea65c0.1380703263.git.agordeev@redhat.com>
    2013-10-02 19:31   ` [PATCH RFC 36/77] ipr: Enable MSI-X when IPR_USE_MSIX type is set, not IPR_USE_MSI Brian King
         [not found] ` <338c9012577acf694eb23622902185584987bd8f.1380703263.git.agordeev@redhat.com>
    2013-10-02 20:50   ` [PATCH RFC 40/77] ixgbevf: Update MSI/MSI-X interrupts enablement code Keller, Jacob E
         [not found] ` <467ce10b1df795edf80ed222816ab739fee7b0ea.1380703263.git.agordeev@redhat.com>
    2013-10-03  0:29   ` [PATCH RFC 77/77] vxge: " Jon Mason
         [not found] ` <3ff5236944aae69f2cd934b5b6da7c1c269df7c1.1380703262.git.agordeev@redhat.com>
    2013-10-03  0:39   ` [PATCH RFC 01/77] PCI/MSI: Fix return value when populate_msi_sysfs() failed Jon Mason
         [not found] ` <5d9c5b2d3bbc444ff32bddeece7a239d046bd79c.1380703263.git.agordeev@redhat.com>
    2013-10-03  0:48   ` [PATCH RFC 54/77] ntb: Ensure number of MSIs on SNB is enough for the link interrupt Jon Mason
    2013-10-05 21:43     ` Alexander Gordeev
    2013-10-07 16:50       ` Jon Mason
    2013-10-07 18:38         ` Alexander Gordeev
    2013-10-07 20:31           ` Jon Mason
         [not found] ` <0590d63c3432229a3824bada71e07a08fb955498.1380703263.git.agordeev@redhat.com>
    2013-10-03  0:49   ` [PATCH RFC 53/77] ntb: Fix missed call to pci_enable_msix() Jon Mason
         [not found] ` <49eb592e15aaec804f9c11ca132d2b85c516aefa.1380703263.git.agordeev@redhat.com>
    2013-10-03  1:02   ` [PATCH RFC 55/77] ntb: Update MSI/MSI-X interrupts enablement code Jon Mason
         [not found] ` <9650a7dfbcfd5f1da21f7b093665abf4b1041071.1380703263.git.agordeev@redhat.com>
    2013-10-03  7:14   ` [PATCH RFC 50/77] mlx5: " Eli Cohen
    2013-10-03 19:48     ` Alexander Gordeev
    2013-10-10 15:29       ` Eli Cohen
         [not found] ` <9d424912ef78993dc75e2af5006cd12913e9e7e7.1380703263.git.agordeev@redhat.com>
    2013-10-03 16:11   ` [PATCH RFC 51/77] mthca: " Jack Morgenstein
         [not found] ` <9c282c4ab92731c719d161d2db6fc54ce33891d9.1380703262.git.agordeev@redhat.com>
    2013-10-03 21:52   ` [PATCH RFC 06/77] PCI/MSI: Factor out pci_get_msi_cap() interface Ben Hutchings
    2013-10-04  5:13     ` Alexander Gordeev
    2013-10-03 22:49 ` [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern Ben Hutchings
    2013-10-04  8:29   ` Alexander Gordeev
    2013-10-04  8:31     ` David Laight
    2013-10-04  9:21       ` Alexander Gordeev
    2013-10-04 21:29     ` Ben Hutchings
    2013-10-05 14:20       ` Alexander Gordeev
    2013-10-05 21:46         ` Benjamin Herrenschmidt
    2013-10-06  6:02           ` Alexander Gordeev
    2013-10-06  6:19             ` Benjamin Herrenschmidt
    2013-10-06  7:10               ` Alexander Gordeev
    2013-10-07 18:01                 ` Tejun Heo
    2013-10-07 20:10                   ` Benjamin Herrenschmidt
    2013-10-07 20:46                     ` Ben Hutchings
    2013-10-08 12:22                   ` Alexander Gordeev
    2013-10-09 15:41                     ` Tejun Heo
    2013-10-09 12:57                   ` Alexander Gordeev
    2013-10-09 15:43                     ` Tejun Heo
    2013-10-07 20:48                 ` Ben Hutchings
    2013-10-09 15:46                   ` Tejun Heo
         [not found] ` <8c9811b13fd93e73641dab8e3bd1bd5b2dc37a61.1380703262.git.agordeev@redhat.com>
    2013-10-04  7:39   ` [PATCH RFC 03/77] PCI/MSI/s390: Fix single MSI only check Martin Schwidefsky
         [not found] ` <bae65aa3e30dfd23bd5ed47add7310cfbb96243a.1380703262.git.agordeev@redhat.com>
    2013-10-04  7:40   ` [PATCH RFC 04/77] PCI/MSI/s390: Remove superfluous check of MSI type Martin Schwidefsky
         [not found] ` <e8b51bd48c24d0fc4ee8adea5c138c9bf84191e9.1380703262.git.agordeev@redhat.com>
    2013-10-07 18:10   ` [PATCH RFC 05/77] PCI/MSI: Convert pci_msix_table_size() to a public interface Tejun Heo
    2013-10-08  7:56     ` Alexander Gordeev
         [not found] ` <d8c36203ada6efbfa9f7ce92c2f713ee3b6d6b8d.1380703262.git.agordeev@redhat.com>
    2013-10-07 18:17   ` [PATCH RFC 07/77] PCI/MSI: Re-design MSI/MSI-X interrupts enablement pattern Tejun Heo
    2013-10-08  7:48     ` Alexander Gordeev
    2013-10-09 15:54       ` Tejun Heo
    2013-10-07 18:21 ` [PATCH RFC 00/77] " Tejun Heo
    2013-10-08  9:07   ` Alexander Gordeev
    2013-10-09 15:57     ` Tejun Heo
    2013-10-08  4:33 ` Michael Ellerman
    2013-10-08  7:33   ` Alexander Gordeev
    2013-10-09  1:34     ` Michael Ellerman
         [not found] ` <c92efbde96541d08f37510422c096d543bb01279.1380703263.git.agordeev@redhat.com>
    2013-10-08 22:46   ` [PATCH RFC 63/77] qlcnic: Update MSI/MSI-X interrupts enablement code Himanshu Madhani
         [not found] ` <5254D397.9030307@zytor.com>
         [not found]   ` <1381292648.645.259.camel@pasglop>
    2013-10-10 10:17     ` [PATCH RFC 00/77] Re-design MSI/MSI-X interrupts enablement pattern Alexander Gordeev
    2013-10-10 16:28       ` H. Peter Anvin
    2013-10-10 18:07         ` Alexander Gordeev
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).