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 D6E85A0C55; Wed, 13 Oct 2021 17:19:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A91641232; Wed, 13 Oct 2021 17:18:17 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 9309C411F5 for ; Wed, 13 Oct 2021 17:18:14 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10136"; a="290944119" X-IronPort-AV: E=Sophos;i="5.85,371,1624345200"; d="scan'208";a="290944119" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 08:18:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,371,1624345200"; d="scan'208";a="441682184" Received: from silpixa00399126.ir.intel.com ([10.237.223.151]) by orsmga006.jf.intel.com with ESMTP; 13 Oct 2021 08:18:12 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: conor.walsh@intel.com, kevin.laatz@intel.com, fengchengwen@huawei.com, jerinj@marvell.com, Bruce Richardson Date: Wed, 13 Oct 2021 16:17:33 +0100 Message-Id: <20211013151736.762378-11-bruce.richardson@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013151736.762378-1-bruce.richardson@intel.com> References: <20210924102942.2878051-1-bruce.richardson@intel.com> <20211013151736.762378-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v7 10/13] dmadev: add flag for error handling support 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 Sender: "dev" Due to HW or driver limiations, not all dmadevs may support full error handling e.g. safely managing and reporting an invalid address to a copy operation. The skeleton dmadev, for example, being pure software will always seg-fault if passed an invalid address. To indicate the availability of safe error handling by a device, we add a capability flag for it. Signed-off-by: Bruce Richardson Reviewed-by: Conor Walsh Reviewed-by: Kevin Laatz --- lib/dmadev/rte_dmadev.c | 1 + lib/dmadev/rte_dmadev.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index b6647e6ff8..182d32aedb 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -722,6 +722,7 @@ dma_capability_name(uint64_t capability) { RTE_DMA_CAPA_DEV_TO_DEV, "dev2dev" }, { RTE_DMA_CAPA_SVA, "sva" }, { RTE_DMA_CAPA_SILENT, "silent" }, + { RTE_DMA_CAPA_HANDLES_ERRORS, "handles_errors" }, { RTE_DMA_CAPA_OPS_COPY, "copy" }, { RTE_DMA_CAPA_OPS_COPY_SG, "copy_sg" }, { RTE_DMA_CAPA_OPS_FILL, "fill" }, diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h index bf78748b0c..f5d23017b1 100644 --- a/lib/dmadev/rte_dmadev.h +++ b/lib/dmadev/rte_dmadev.h @@ -262,6 +262,14 @@ int16_t rte_dma_next_dev(int16_t start_dev_id); * @see struct rte_dma_conf::silent_mode */ #define RTE_DMA_CAPA_SILENT RTE_BIT64(5) +/** Supports error handling + * + * With this bit set, invalid input addresses will be reported as operation failures + * to the user but other operations can continue. + * Without this bit set, invalid data is not handled by either HW or driver, so user + * must ensure that all memory addresses are valid and accessible by HW. + */ +#define RTE_DMA_CAPA_HANDLES_ERRORS RTE_BIT64(6) /** Support copy operation. * This capability start with index of 32, so that it could leave gap between * normal capability and ops capability. -- 2.30.2