From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 69227A04BC; Thu, 8 Oct 2020 11:53:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC7E71BDBD; Thu, 8 Oct 2020 11:51:54 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C9651B62 for ; Thu, 8 Oct 2020 11:51:50 +0200 (CEST) IronPort-SDR: znnH3HLqUfZHI5zmPKJCWaX0eR0jszL5fSJ7jtQtPKBfzFAvZR8L10HHi1J2/lR8bn6y8QaX6t 8Erx1gcnsueA== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="152226365" X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="152226365" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 02:51:50 -0700 IronPort-SDR: 8I1zK+Jo02xLVhtWOm99zLbpNBEi6iH8ucsyBO1b+r3IsQ/V9PTEcotCmUYQIHbuUk48DbmEP0 Z0fViTlMQ6uA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="344686631" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by orsmga008.jf.intel.com with ESMTP; 08 Oct 2020 02:51:48 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: patrick.fu@intel.com, thomas@monjalon.net, Cheng Jiang , Bruce Richardson , Kevin Laatz , Radu Nicolau Date: Thu, 8 Oct 2020 10:51:13 +0100 Message-Id: <20201008095133.123014-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008095133.123014-1-bruce.richardson@intel.com> References: <20200721095140.719297-1-bruce.richardson@intel.com> <20201008095133.123014-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 05/25] raw/ioat: add a flag to control copying handle parameters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Cheng Jiang Add a flag which controls whether rte_ioat_enqueue_copy and rte_ioat_completed_copies function should process handle parameters. Not doing so can improve the performance when handle parameters are not necessary. Signed-off-by: Cheng Jiang Signed-off-by: Bruce Richardson Reviewed-by: Kevin Laatz Acked-by: Radu Nicolau --- doc/guides/rawdevs/ioat.rst | 3 ++ doc/guides/rel_notes/release_20_11.rst | 6 ++++ drivers/raw/ioat/ioat_rawdev.c | 2 ++ drivers/raw/ioat/rte_ioat_rawdev.h | 45 +++++++++++++++++++------- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/doc/guides/rawdevs/ioat.rst b/doc/guides/rawdevs/ioat.rst index c46460ff4..af00d77fb 100644 --- a/doc/guides/rawdevs/ioat.rst +++ b/doc/guides/rawdevs/ioat.rst @@ -129,6 +129,9 @@ output, the ``dev_private`` structure element cannot be NULL, and must point to a valid ``rte_ioat_rawdev_config`` structure, containing the ring size to be used by the device. The ring size must be a power of two, between 64 and 4096. +If it is not needed, the tracking by the driver of user-provided completion +handles may be disabled by setting the ``hdls_disable`` flag in +the configuration structure also. The following code shows how the device is configured in ``test_ioat_rawdev.c``: diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index cdf20404c..1e73c26d4 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -116,6 +116,12 @@ New Features * Extern objects and functions can be plugged into the pipeline. * Transaction-oriented table updates. +* **Updated ioat rawdev driver** + + The ioat rawdev driver has been updated and enhanced. Changes include: + + * Added a per-device configuration flag to disable management of user-provided completion handles + Removed Items ------------- diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c index 0732b059f..ea9f51ffc 100644 --- a/drivers/raw/ioat/ioat_rawdev.c +++ b/drivers/raw/ioat/ioat_rawdev.c @@ -58,6 +58,7 @@ ioat_dev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config, return -EINVAL; ioat->ring_size = params->ring_size; + ioat->hdls_disable = params->hdls_disable; if (ioat->desc_ring != NULL) { rte_memzone_free(ioat->desc_mz); ioat->desc_ring = NULL; @@ -122,6 +123,7 @@ ioat_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info, return -EINVAL; cfg->ring_size = ioat->ring_size; + cfg->hdls_disable = ioat->hdls_disable; return 0; } diff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h index 3d8419271..28ce95cc9 100644 --- a/drivers/raw/ioat/rte_ioat_rawdev.h +++ b/drivers/raw/ioat/rte_ioat_rawdev.h @@ -38,7 +38,8 @@ extern "C" { * an ioat rawdev instance. */ struct rte_ioat_rawdev_config { - unsigned short ring_size; + unsigned short ring_size; /**< size of job submission descriptor ring */ + bool hdls_disable; /**< if set, ignore user-supplied handle params */ }; /** @@ -56,6 +57,7 @@ struct rte_ioat_rawdev { unsigned short ring_size; struct rte_ioat_generic_hw_desc *desc_ring; + bool hdls_disable; __m128i *hdls; /* completion handles for returning to user */ @@ -88,10 +90,14 @@ struct rte_ioat_rawdev { * The length of the data to be copied * @param src_hdl * An opaque handle for the source data, to be returned when this operation - * has been completed and the user polls for the completion details + * has been completed and the user polls for the completion details. + * NOTE: If hdls_disable configuration option for the device is set, this + * parameter is ignored. * @param dst_hdl * An opaque handle for the destination data, to be returned when this - * operation has been completed and the user polls for the completion details + * operation has been completed and the user polls for the completion details. + * NOTE: If hdls_disable configuration option for the device is set, this + * parameter is ignored. * @param fence * A flag parameter indicating that hardware should not begin to perform any * subsequently enqueued copy operations until after this operation has @@ -126,8 +132,10 @@ rte_ioat_enqueue_copy(int dev_id, phys_addr_t src, phys_addr_t dst, desc->u.control_raw = (uint32_t)((!!fence << 4) | (!(write & 0xF)) << 3); desc->src_addr = src; desc->dest_addr = dst; + if (!ioat->hdls_disable) + ioat->hdls[write] = _mm_set_epi64x((int64_t)dst_hdl, + (int64_t)src_hdl); - ioat->hdls[write] = _mm_set_epi64x((int64_t)dst_hdl, (int64_t)src_hdl); rte_prefetch0(&ioat->desc_ring[ioat->next_write & mask]); ioat->enqueued++; @@ -174,19 +182,29 @@ rte_ioat_get_last_completed(struct rte_ioat_rawdev *ioat, int *error) /** * Returns details of copy operations that have been completed * - * Returns to the caller the user-provided "handles" for the copy operations - * which have been completed by the hardware, and not already returned by - * a previous call to this API. + * If the hdls_disable option was not set when the device was configured, + * the function will return to the caller the user-provided "handles" for + * the copy operations which have been completed by the hardware, and not + * already returned by a previous call to this API. + * If the hdls_disable option for the device was set on configure, the + * max_copies, src_hdls and dst_hdls parameters will be ignored, and the + * function returns the number of newly-completed operations. * * @param dev_id * The rawdev device id of the ioat instance * @param max_copies * The number of entries which can fit in the src_hdls and dst_hdls - * arrays, i.e. max number of completed operations to report + * arrays, i.e. max number of completed operations to report. + * NOTE: If hdls_disable configuration option for the device is set, this + * parameter is ignored. * @param src_hdls - * Array to hold the source handle parameters of the completed copies + * Array to hold the source handle parameters of the completed copies. + * NOTE: If hdls_disable configuration option for the device is set, this + * parameter is ignored. * @param dst_hdls - * Array to hold the destination handle parameters of the completed copies + * Array to hold the destination handle parameters of the completed copies. + * NOTE: If hdls_disable configuration option for the device is set, this + * parameter is ignored. * @return * -1 on error, with rte_errno set appropriately. * Otherwise number of completed operations i.e. number of entries written @@ -212,6 +230,11 @@ rte_ioat_completed_copies(int dev_id, uint8_t max_copies, return -1; } + if (ioat->hdls_disable) { + read += count; + goto end; + } + if (count > max_copies) count = max_copies; @@ -229,7 +252,7 @@ rte_ioat_completed_copies(int dev_id, uint8_t max_copies, src_hdls[i] = hdls[0]; dst_hdls[i] = hdls[1]; } - +end: ioat->next_read = read; ioat->completed += count; return count; -- 2.25.1