From: Andy Roulin <aroulin@cumulusnetworks.com>
To: dev@dpdk.org
Cc: shm@cumulusnetworks.com, Andy Roulin <aroulin@cumulusnetworks.com>
Subject: [dpdk-dev] [PATCH] kni: fix pci_enable_msix_range error handling
Date: Sun, 17 Dec 2017 22:16:30 -0800 [thread overview]
Message-ID: <1513577790-6608-1-git-send-email-aroulin@cumulusnetworks.com> (raw)
pci_enable_msix_range's return value has a different meaning than what
was previously returned by pci_enable_msix.
"It returns a negative errno if an error occurs. If it succeeds, it
returns the actual number of interrupts allocated and indicates the
successful configuration of MSI-X capability structure with new
allocated MSI-X interrupts."
The following commit introduced pci_enable_msix_range:
dpdk: 9fb3cd2c ("kni: fix ethtool build with kernel 4.11")
http://dpdk.org/dev/patchwork/patch/24076/
Signed-off-by: Andy Roulin <aroulin@cumulusnetworks.com>
---
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index e0f427a..32ef3b9 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -1043,14 +1043,16 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
#ifdef HAVE_PCI_ENABLE_MSIX
err = pci_enable_msix(pdev,
adapter->msix_entries, numvecs);
+ if (err == 0)
+ break;
#else
err = pci_enable_msix_range(pdev,
adapter->msix_entries,
numvecs,
numvecs);
-#endif
- if (err == 0)
+ if (err < 0)
break;
+#endif
}
/* MSI-X failed, so fall through and try MSI */
dev_warn(pci_dev_to_dev(pdev), "Failed to initialize MSI-X interrupts. "
--
2.1.4
next reply other threads:[~2017-12-18 6:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 6:16 Andy Roulin [this message]
2018-02-05 19:05 ` Ferruh Yigit
2018-02-05 19:46 ` Andy Roulin
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=1513577790-6608-1-git-send-email-aroulin@cumulusnetworks.com \
--to=aroulin@cumulusnetworks.com \
--cc=dev@dpdk.org \
--cc=shm@cumulusnetworks.com \
/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).