From patchwork Fri Apr 8 14:16:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Laatz X-Patchwork-Id: 109535 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61D43A050B; Fri, 8 Apr 2022 16:16:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50BAC4067E; Fri, 8 Apr 2022 16:16:47 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 252714003F for ; Fri, 8 Apr 2022 16:16:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649427406; x=1680963406; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iaAcNCcHx9YPG50WpTrEdx0+q0IUOMfja9YyouyNH4U=; b=DVpOaMJY5RsEX2AKWPMqMJry9znDaqUXuFNZhaGeiQ3ka71yjhyvrt2J KrWNqlL11Ngta1QOWBOqkHNoHssHrmCSJ68cL/7nR7N8yo6FPJPL3Y5GX KhRT4CqkOcYbXlqzm55W0CpG5vsXBewjEqcOTHF6rdG93hHyqwbLLpPGB O5mx2n3HF1IpNbfBnmzi47wb4CSaQAU5mYMr2AflB0vEXM4wwhx8//AFQ hfh2Z9KpxgsQ98hO0/ovPeSjh4NoTy8QqWPGiJzNJT4VI0P0fgUny1mPB +i/PDyNSzUU4AILNr5ny3TqypzkOcc045nj4JEaLadGSU3Pw9De6U+KtW Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="260439143" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="260439143" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 07:16:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="852084304" Received: from silpixa00401122.ir.intel.com ([10.55.128.10]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2022 07:16:44 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: Kevin Laatz , Bruce Richardson Subject: [PATCH] dma/idxd: fix return value for pci device commands Date: Fri, 8 Apr 2022 15:16:55 +0100 Message-Id: <20220408141655.1320288-1-kevin.laatz@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 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 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 *