From f217dbff20603b51a51e226be77593ea06122ab5 Mon Sep 17 00:00:00 2001 From: Kevin Laatz Date: Fri, 8 Apr 2022 15:16:55 +0100 Subject: [PATCH] dma/idxd: fix error code for PCI device commands 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 Acked-by: Conor Walsh --- drivers/dma/idxd/idxd_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c index 9ca1ec64e9..65c6bbf4c1 100644 --- a/drivers/dma/idxd/idxd_pci.c +++ b/drivers/dma/idxd/idxd_pci.c @@ -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 * -- 2.39.5