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 E6417A04C0; Fri, 25 Sep 2020 13:10:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A5CBC1E8F9; Fri, 25 Sep 2020 13:09:47 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id C8FD61E8BE for ; Fri, 25 Sep 2020 13:09:40 +0200 (CEST) IronPort-SDR: QMraUDGjYdV93eUUqdO5nJE1/J0GdNWxedb9MRj52i9kTCQVyUq6rRlAtv4JAwq7gN91cw1EaN hMoIVo2oCy0w== X-IronPort-AV: E=McAfee;i="6000,8403,9754"; a="149263062" X-IronPort-AV: E=Sophos;i="5.77,301,1596524400"; d="scan'208";a="149263062" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 04:09:40 -0700 IronPort-SDR: zT3pyu00XS51v4qxxWayV9nRyKDR4BtOAV9+WOzmB0wRzUcv2FoAFc7KD1nlMtveMwolzxvo/L 088ar3Uq/YuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,301,1596524400"; d="scan'208";a="455787835" Received: from unknown (HELO silpixa00399126.ir.intel.com) ([10.237.222.4]) by orsmga004.jf.intel.com with ESMTP; 25 Sep 2020 04:09:38 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: patrick.fu@intel.com, Cheng Jiang , Bruce Richardson , Kevin Laatz Date: Fri, 25 Sep 2020 12:08:50 +0100 Message-Id: <20200925110910.284098-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200925110910.284098-1-bruce.richardson@intel.com> References: <20200721095140.719297-1-bruce.richardson@intel.com> <20200925110910.284098-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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 --- 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 4eb3224a7..196209f63 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -78,6 +78,12 @@ New Features ``--portmask=N`` where N represents the hexadecimal bitmask of ports used. +* **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