]> git.droids-corp.org - dpdk.git/commitdiff
dma/idxd: fix error code for PCI device commands
authorKevin Laatz <kevin.laatz@intel.com>
Fri, 8 Apr 2022 14:16:55 +0000 (15:16 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 8 Jun 2022 08:54:02 +0000 (10:54 +0200)
When sending a command to an idxd device via PCI BAR, the response from
HW is checked to ensure it was successful. The response was incorrectly
being negated before being returned by the function, meaning error codes
cannot be checked against the HW specification.

This patch fixes the return values of the function by removing the
negation.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")
Fixes: 452c1916b0db ("dma/idxd: fix truncated error code in status check")
Cc: stable@dpdk.org
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
drivers/dma/idxd/idxd_pci.c

index 9ca1ec64e9e1378c11ffdb028235634c564a8005..65c6bbf4c13d8f1576c6cb4877383a3c44716215 100644 (file)
@@ -38,13 +38,13 @@ idxd_pci_dev_command(struct idxd_dmadev *idxd, enum rte_idxd_cmds command)
                        IDXD_PMD_ERR("Timeout waiting for command response from HW");
                        rte_spinlock_unlock(&idxd->u.pci->lk);
                        err_code &= CMDSTATUS_ERR_MASK;
-                       return -err_code;
+                       return err_code;
                }
        } while (err_code & CMDSTATUS_ACTIVE_MASK);
        rte_spinlock_unlock(&idxd->u.pci->lk);
 
        err_code &= CMDSTATUS_ERR_MASK;
-       return -err_code;
+       return err_code;
 }
 
 static uint32_t *