DPDK patches and discussions
 help / color / mirror / Atom feed
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, Markus Theil <markus.theil@tu-ilmenau.de>
Subject: [dpdk-dev] [PATCH] igb_uio: fix legacy msi masking
Date: Fri, 13 Oct 2017 18:03:47 +0200	[thread overview]
Message-ID: <1507910627-29940-1-git-send-email-markus.theil@tu-ilmenau.de> (raw)
In-Reply-To: <72302705-a723-ccb2-05ae-5bc131c0080a@intel.com>

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 <markus.theil@tu-ilmenau.de>
Tested-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 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);
-- 
2.7.4

  reply	other threads:[~2017-10-13 16:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13  2:46 [dpdk-dev] [PATCH] igb_uio: fix unknown symbols Ferruh Yigit
2017-10-13  2:51 ` Ferruh Yigit
2017-10-13 16:03   ` Markus Theil [this message]
2017-10-13 17:03     ` [dpdk-dev] [PATCH] igb_uio: fix legacy msi masking Ferruh Yigit
2017-10-13 19:54       ` Ferruh Yigit
2017-10-13  3:21 ` [dpdk-dev] [PATCH] igb_uio: fix unknown symbols Patrick MacArthur
2017-10-13 13:54   ` Thomas Monjalon

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=1507910627-29940-1-git-send-email-markus.theil@tu-ilmenau.de \
    --to=markus.theil@tu-ilmenau.de \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).