From patchwork Fri Oct 13 16:03:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 30373 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 E02CC1B79A; Fri, 13 Oct 2017 18:06:56 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by dpdk.org (Postfix) with ESMTP id 398C41B799 for ; Fri, 13 Oct 2017 18:06:56 +0200 (CEST) Received: from thunderstorm.prakinf.tu-ilmenau.de (thunderstorm.prakinf.tu-ilmenau.de [141.24.212.108]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id D79C158006A; Fri, 13 Oct 2017 18:06:55 +0200 (CEST) From: Markus Theil To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Markus Theil Date: Fri, 13 Oct 2017 18:03:47 +0200 Message-Id: <1507910627-29940-1-git-send-email-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <72302705-a723-ccb2-05ae-5bc131c0080a@intel.com> References: <72302705-a723-ccb2-05ae-5bc131c0080a@intel.com> Subject: [dpdk-dev] [PATCH] igb_uio: fix legacy msi masking 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" MSI masks contain a 1 if interrupt is masked, 0 if unmasked. I got that wrong with the !!state calculation. For better readability, the mask is now changed like in igbuio_msi_mask_irq. Fixes: a8ea1e5fb647 ("igb_uio: fix unknown MSI symbols") Signed-off-by: Markus Theil Tested-by: Markus Theil Acked-by: Ferruh Yigit --- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 0dda26c..b67d775 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -122,13 +122,14 @@ igbuio_msi_mask_irq(struct pci_dev *pdev, struct msi_desc *desc, int32_t state) u32 mask_bits = desc->masked; u32 offset = desc->irq - pdev->irq; u32 mask = 1 << offset; - u32 flag = !!state << offset; if (!desc->msi_attrib.maskbit) return; - mask_bits &= ~mask; - mask_bits |= flag; + if (state != 0) + mask_bits &= ~mask; + else + mask_bits |= mask; if (mask_bits != desc->masked) { pci_write_config_dword(pdev, desc->mask_pos, mask_bits);