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 7745943028; Fri, 11 Aug 2023 04:10:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61BE140E03; Fri, 11 Aug 2023 04:10:22 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 286F540DFB for ; Fri, 11 Aug 2023 04:10:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691719821; x=1723255821; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7srMkbDyODXEzc/ydyIchTCwV1BdKr4oLuYKEGW7NYM=; b=JuGzRfvS81eAAyE6H0802rYGJxTtUMCN4hSYaan76Znub0liu/9z4Vqp wfQ5qNCHRjDEK7Q6AKTOn6YWwgCK25lwP+F3q7EvsdcRxxOVBo3wLdFz2 n/ZfXsnkCjkOvc4JtjAIquXKTUEKSli1J0wdnABnHrbmwdtVseU7ay16K ljesZcnj+eqwEbuvbR0sAMV9wl7f0ldOaZLAFQccu10g/TI5WR9Qhm/Za 6Jb81OYkzr1svBGWOKyjQsT2nHqaUFRNPa9oUCe67RB3qIFLX6I+Uqi4l Nrou17huptta7bJZuVU73WI0BL5MKbDUPzigeKweNaJJ6cStv7mHA+Zsr A==; X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="437910865" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="437910865" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2023 19:10:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="709373141" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="709373141" Received: from media-frankdu-kahawai-node2.sh.intel.com ([10.67.119.123]) by orsmga006.jf.intel.com with ESMTP; 10 Aug 2023 19:10:18 -0700 From: Frank Du To: Bruce Richardson , Kevin Laatz Cc: dev@dpdk.org Subject: [PATCH] dma/idxd: add reset in the init routine Date: Fri, 11 Aug 2023 10:10:54 +0800 Message-Id: <20230811021054.3848656-1-frank.du@intel.com> X-Mailer: git-send-email 2.34.1 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 Fix for windows, no one reset the dev to a clear status. In Linux, kernel driver will reset during the prob. Signed-off-by: Frank Du --- drivers/dma/idxd/idxd_pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c index 3696c7f452..a78889a7ef 100644 --- a/drivers/dma/idxd/idxd_pci.c +++ b/drivers/dma/idxd/idxd_pci.c @@ -196,6 +196,14 @@ init_pci_device(struct rte_pci_device *dev, struct idxd_dmadev *idxd, pci->portals = dev->mem_resource[2].addr; pci->wq_cfg_sz = (pci->regs->wqcap >> 24) & 0x0F; + /* reset */ + idxd->u.pci = pci; + err_code = idxd_pci_dev_command(idxd, idxd_reset_device); + if (err_code) { + IDXD_PMD_ERR("Error reset device: code %#x", err_code); + goto err; + } + /* sanity check device status */ if (pci->regs->gensts & GENSTS_DEV_STATE_MASK) { /* need function-level-reset (FLR) or is enabled */ -- 2.34.1