DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] dma/idxd: fix return value for pci device commands
@ 2022-04-08 14:16 Kevin Laatz
  2022-06-07 10:56 ` Walsh, Conor
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Laatz @ 2022-04-08 14:16 UTC (permalink / raw)
  To: dev; +Cc: Kevin Laatz, Bruce Richardson

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.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
---
 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 fa0a1ad562..844077b079 100644
--- a/drivers/dma/idxd/idxd_pci.c
+++ b/drivers/dma/idxd/idxd_pci.c
@@ -39,13 +39,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.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-08  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 14:16 [PATCH] dma/idxd: fix return value for pci device commands Kevin Laatz
2022-06-07 10:56 ` Walsh, Conor
2022-06-08  8:54   ` Thomas Monjalon
2022-06-08  8:57     ` Kevin Laatz

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