From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFB0941CB1; Thu, 16 Feb 2023 12:09:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D85D42D31; Thu, 16 Feb 2023 12:09:39 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 7FB4B40E0F; Thu, 16 Feb 2023 12:09:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676545777; x=1708081777; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dMoWY5wrq3Ago+KRNoPAWQZDtZIlccwlIsaL57iVgnY=; b=Ffd0qc7uFs+r5JrXjUbD4BJRYckszqNP4zwOXNfWPksQqkIkQkmjPMU2 Dez6i1cjGR+9K2v5eOp7R9KheAuyhhPF3Bfmut3m556UZloKRHZMkfCEV VCce8lIAdxxEmpBZwuJx1VwxL6kgC2+CBbHNnZvRTT1y9ixmuWBfRh7Cl LxBCg8LH0j38VoM/YoetCYOXYz2fPx7tIfJKtCalx3nBVkCUtg6IzkaFN 80DXHK0vWfY/bKgf8LAR+ufC4pbUygYM0QjYr+vtQwPrcoZonN9NubqIe ROFj15BMLffAbrj0w6f9SdFSG5+VBdYNsrWFCcP+9Ojfj0Zr4DwsM7rVs A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="315368164" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="315368164" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 03:09:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="702522830" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="702522830" Received: from silpixa00401385.ir.intel.com ([10.237.214.22]) by orsmga001.jf.intel.com with ESMTP; 16 Feb 2023 03:09:35 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: fengchengwen@huawei.com, Bruce Richardson , conor.walsh@intel.com, stable@dpdk.org, Kevin Laatz Subject: [PATCH v3 3/6] dma/ioat: fix incorrect error reporting on restart Date: Thu, 16 Feb 2023 11:09:16 +0000 Message-Id: <20230216110919.373385-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230216110919.373385-1-bruce.richardson@intel.com> References: <20230116153714.554470-1-bruce.richardson@intel.com> <20230216110919.373385-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 the DMA device was stopped and restarted by the driver, the control register specifying the behaviour on error was not getting correctly reset. This caused unit tests to fail as explicitly introduced errors were got getting reported back. Fix by moving the setting of the register to the start function from the probe function. Fixes: 583f046dd404 ("dma/ioat: add start and stop") Cc: conor.walsh@intel.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Reviewed-by: Conor Walsh Acked-by: Kevin Laatz --- drivers/dma/ioat/ioat_dmadev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c index 072eb17cd9..57c18c081d 100644 --- a/drivers/dma/ioat/ioat_dmadev.c +++ b/drivers/dma/ioat/ioat_dmadev.c @@ -142,6 +142,9 @@ ioat_dev_start(struct rte_dma_dev *dev) ioat->regs->chainaddr = ioat->ring_addr; /* Inform hardware of where to write the status/completions. */ ioat->regs->chancmp = ioat->status_addr; + /* Ensure channel control is set to abort on error, so we get status writeback. */ + ioat->regs->chanctrl = IOAT_CHANCTRL_ANY_ERR_ABORT_EN | + IOAT_CHANCTRL_ERR_COMPLETION_EN; /* Prime the status register to be set to the last element. */ ioat->status = ioat->ring_addr + ((ioat->qcfg.nb_desc - 1) * DESC_SZ); @@ -682,8 +685,6 @@ ioat_dmadev_create(const char *name, struct rte_pci_device *dev) return -EIO; } } - ioat->regs->chanctrl = IOAT_CHANCTRL_ANY_ERR_ABORT_EN | - IOAT_CHANCTRL_ERR_COMPLETION_EN; dmadev->fp_obj->dev_private = ioat; -- 2.37.2