From patchwork Mon Dec 18 06:16:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Roulin X-Patchwork-Id: 32345 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADEA51DBF; Mon, 18 Dec 2017 07:18:10 +0100 (CET) Received: from internalmail.cumulusnetworks.com (internalmail.cumulusnetworks.com [45.55.219.144]) by dpdk.org (Postfix) with ESMTP id E9BFE200 for ; Mon, 18 Dec 2017 07:18:08 +0100 (CET) Received: from localhost (office.cumulusnetworks.com [216.129.126.126]) by internalmail.cumulusnetworks.com (Postfix) with ESMTPSA id 9B06DC11CA; Sun, 17 Dec 2017 22:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cumulusnetworks.com; s=mail; t=1513577887; bh=Y9O6yTFDkMeG+Kr/H1ELpO+KpQ61PxMpXEoKeRjxDfg=; h=From:To:Cc:Subject:Date; b=YZOEwOYqbGntu+en7lCODfiLHHPMAYXmCIxjjfns+Ob0FUdR/Cvro0OB1H2kliZpX D+1tF6wtxcKfbZYO+4maq62u3jM7NvCxE1jpraDPqSnIA9FoLnVO6J+PCcyQSnVQ4c 3TZmhI1k4lQ1c2lGrqLhPeGpvjkvPwOh/SB1QWx8= From: Andy Roulin To: dev@dpdk.org Cc: shm@cumulusnetworks.com, Andy Roulin Date: Sun, 17 Dec 2017 22:16:30 -0800 Message-Id: <1513577790-6608-1-git-send-email-aroulin@cumulusnetworks.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] kni: fix pci_enable_msix_range error handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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. "