[dpdk-dev] igb_uio: fix legacy msi masking
Checks
Commit Message
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
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>
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.
@@ -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);