[dpdk-dev] igb_uio: fix legacy msi masking

Message ID 1507910627-29940-1-git-send-email-markus.theil@tu-ilmenau.de (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Markus Theil Oct. 13, 2017, 4:03 p.m. UTC
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(-)
  

Comments

Ferruh Yigit Oct. 13, 2017, 5:03 p.m. UTC | #1
On 10/13/2017 5:03 PM, Markus Theil wrote:
> 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>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit Oct. 13, 2017, 7:54 p.m. UTC | #2
On 10/13/2017 6:03 PM, Ferruh Yigit wrote:
> On 10/13/2017 5:03 PM, Markus Theil wrote:
>> 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>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk/master, thanks.
  

Patch

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);