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 3E652423F2; Mon, 16 Jan 2023 18:38:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E217042D27; Mon, 16 Jan 2023 18:38:00 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id E5CCB42D0C; Mon, 16 Jan 2023 18:37:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673890679; x=1705426679; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=leGtDM/a3StluTw/9dzlevlJ23l6D91yAdjApzDtd4g=; b=didGG6t3IYpXYTa+/FteXHbSFYn1+A6zt++scOD0QFk4IC+qyEM61XEO qdICwHVtA+kCxOu8o+Pbvzda7y1u3HzbbrwyyPZF9BgaH9vM0z/xJeJhH I5WuZD/2XVkq2JbVt4rAzDz3hwBeoK6p9zNIJuXAm8c39gAMg9FSky9nh H27Ti6UwMszUxgEAT45jvoZsAUDdrSnrf91NngTRa+uANgYhaCsXbaRVx M2VuAh0DVXO6PL4OLxce2nR9OYz0j7aK5Pn6gsqzsIrQW1leZ+xl/IppS sQtxfBP1uqikOecpJZvkG2mN+4ZMNg6ntvOxYVjkJizl4/D83znYZirs5 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="326570394" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="326570394" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 09:37:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="987869180" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="987869180" Received: from silpixa00401385.ir.intel.com ([10.237.214.55]) by fmsmga005.fm.intel.com with ESMTP; 16 Jan 2023 09:37:56 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , conor.walsh@intel.com, stable@dpdk.org, Kevin Laatz Subject: [PATCH v2 3/6] dma/ioat: fix incorrect error reporting on restart Date: Mon, 16 Jan 2023 17:37:34 +0000 Message-Id: <20230116173738.562322-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230116173738.562322-1-bruce.richardson@intel.com> References: <20230116153714.554470-1-bruce.richardson@intel.com> <20230116173738.562322-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 --- 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