DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Laatz <kevin.laatz@intel.com>
To: dev@dpdk.org
Cc: Kevin Laatz <kevin.laatz@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH] dma/idxd: fix return value for pci device commands
Date: Fri,  8 Apr 2022 15:16:55 +0100	[thread overview]
Message-ID: <20220408141655.1320288-1-kevin.laatz@intel.com> (raw)

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


             reply	other threads:[~2022-04-08 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 14:16 Kevin Laatz [this message]
2022-06-07 10:56 ` Walsh, Conor
2022-06-08  8:54   ` Thomas Monjalon
2022-06-08  8:57     ` Kevin Laatz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408141655.1320288-1-kevin.laatz@intel.com \
    --to=kevin.laatz@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).