From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Alexander Gordeev <agordeev@redhat.com>, linux-kernel@vger.kernel.org
Cc: Hyong-Youb Kim <hykim@myri.com>,
netdev@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 20/34] myri10ge: Use pci_enable_msix_range()
Date: Fri, 31 Jan 2014 22:24:53 +0300 [thread overview]
Message-ID: <52EBF885.30309@cogentembedded.com> (raw)
In-Reply-To: <1253b3c920637ab6bb987defb88d1698ac1e4851.1391172839.git.agordeev@redhat.com>
Hello.
On 01/31/2014 06:08 PM, Alexander Gordeev wrote:
> As result of deprecation of MSI-X/MSI enablement functions
> pci_enable_msix() and pci_enable_msi_block() all drivers
> using these two interfaces need to be updated to use the
> new pci_enable_msi_range() and pci_enable_msix_range()
> interfaces.
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
> drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 32 ++++++++++-----------
> 1 files changed, 15 insertions(+), 17 deletions(-)
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> index 68026f7..9f717d6 100644
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> @@ -2329,16 +2329,14 @@ static int myri10ge_request_irq(struct myri10ge_priv *mgp)
> status = 0;
> if (myri10ge_msi) {
> if (mgp->num_slices > 1) {
> - status =
> - pci_enable_msix(pdev, mgp->msix_vectors,
> - mgp->num_slices);
> - if (status == 0) {
> - mgp->msix_enabled = 1;
> - } else {
> + status = pci_enable_msix_range(pdev, mgp->msix_vectors,
> + mgp->num_slices, mgp->num_slices);
> + if (status < 0) {
> dev_err(&pdev->dev,
> "Error %d setting up MSI-X\n", status);
> return status;
> }
> + mgp->msix_enabled = 1;
> }
> if (mgp->msix_enabled == 0) {
> status = pci_enable_msi(pdev);
> @@ -3901,23 +3899,23 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
> }
>
> while (mgp->num_slices > 1) {
> - /* make sure it is a power of two */
> - while (!is_power_of_2(mgp->num_slices))
> - mgp->num_slices--;
> + mgp->num_slices = rounddown_pow_of_two(mgp->num_slices);
> if (mgp->num_slices == 1)
> goto disable_msix;
> - status = pci_enable_msix(pdev, mgp->msix_vectors,
> - mgp->num_slices);
> - if (status == 0) {
> - pci_disable_msix(pdev);
> + status = pci_enable_msix_range(pdev, mgp->msix_vectors,
> + mgp->num_slices, mgp->num_slices);
The continuation line(s) should be aligned to start right under 'pdev',
according to the networking coding rules.
> + if (status < 0)
> + goto disable_msix;
Hm, if enabling MSI failed, we don't need to disable it, right? So,
perhaps the label should be renamed?
> +
> + pci_disable_msix(pdev);
> +
> + if (status == mgp->num_slices) {
> if (old_allocated)
> kfree(old_fw);
> return;
> - }
> - if (status > 0)
> + } else {
> mgp->num_slices = status;
> - else
> - goto disable_msix;
> + }
> }
>
> disable_msix:
WBR, Sergei
next prev parent reply other threads:[~2014-01-31 19:24 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 15:46 [PATCH 00/34] net: Use pci_enable_msix_range() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 01/34] bnx2: " Alexander Gordeev
2014-01-31 21:30 ` David Miller
2014-02-11 0:38 ` Bjorn Helgaas
2014-02-11 1:08 ` Bjorn Helgaas
2014-02-11 8:01 ` Alexander Gordeev
2014-01-31 15:08 ` [PATCH 02/34] bnx2x: " Alexander Gordeev
2014-01-31 19:11 ` Sergei Shtylyov
2014-01-31 15:08 ` [PATCH 03/34] tg3: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 04/34] bna: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 05/34] cxgb3: Remove superfluous call to pci_disable_msix() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 06/34] cxgb3: Use pci_enable_msix_range() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 07/34] cxgb4: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 08/34] cxgb4vf: Remove superfluous call to pci_disable_msix() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 09/34] cxgb4vf: Use pci_enable_msix_range() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 10/34] enic: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 11/34] benet: " Alexander Gordeev
2014-02-03 6:21 ` Sathya Perla
2014-01-31 15:08 ` [PATCH 12/34] e1000e: " Alexander Gordeev
2014-01-31 19:17 ` Sergei Shtylyov
2014-01-31 15:08 ` [PATCH 13/34] i40e: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 14/34] igb: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 15/34] igbvf: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 16/34] ixgbe: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 17/34] ixgbevf: " Alexander Gordeev
2014-01-31 19:20 ` Sergei Shtylyov
2014-01-31 15:08 ` [PATCH 18/34] mlx4: " Alexander Gordeev
2014-01-31 19:22 ` Sergei Shtylyov
2014-02-02 9:43 ` Amir Vadai
2014-01-31 15:08 ` [PATCH 19/34] mlx5: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 20/34] myri10ge: " Alexander Gordeev
2014-01-31 19:24 ` Sergei Shtylyov [this message]
2014-02-01 14:13 ` Hyong-Youb Kim
2014-01-31 15:08 ` [PATCH 21/34] s2io: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 22/34] vxge: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 23/34] forcedeth: Fix invalid errno reporting in nv_request_irq() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 24/34] forcedeth: Cleanup MSI-X to MSI to INTx fallback code Alexander Gordeev
2014-01-31 15:08 ` [PATCH 25/34] forcedeth: Use pci_enable_msix_range() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 26/34] netxen: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 27/34] qlcnic: Cleanup qlcnic_enable_msix() return values Alexander Gordeev
2014-01-31 15:08 ` [PATCH 28/34] qlcnic: Use pci_enable_msix_range() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 29/34] qlge: Get rid of an redundant assignment Alexander Gordeev
2014-01-31 15:08 ` [PATCH 30/34] qlge: Use pci_enable_msix_range() Alexander Gordeev
2014-01-31 15:08 ` [PATCH 31/34] efx: " Alexander Gordeev
2014-01-31 17:21 ` Shradha Shah
2014-01-31 15:08 ` [PATCH 32/34] niu: " Alexander Gordeev
2014-01-31 15:08 ` [PATCH 33/34] vmxnet3: Fix MSI-X/MSI enablement code Alexander Gordeev
2014-01-31 15:08 ` [PATCH 34/34] vmxnet3: Use pci_enable_msix_range() Alexander Gordeev
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=52EBF885.30309@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=agordeev@redhat.com \
--cc=hykim@myri.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.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 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).