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 1C0D2A0540; Mon, 13 Jul 2020 09:21:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8236C1C1AB; Mon, 13 Jul 2020 09:21:18 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BA74F1BEE7 for ; Mon, 13 Jul 2020 09:21:16 +0200 (CEST) IronPort-SDR: uq+Rf2/+CJbLtm/8KZKAJPAEzFyHFIYuPfDkuypWTukkoF17CFOwOOfHK30q0D0cdTTgqF5tTG rP8iKw6yy2kw== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="148566498" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="148566498" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 00:21:13 -0700 IronPort-SDR: QJ4V43QyGsdmHTd1wJ23SHFz9AcZTIsoynVg9jraLo3TgviDjsguEoglkH0LLgrFbRw9eWg7VT 8/MDHJVK9VPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="484915813" Received: from dpdk_jiangcheng.sh.intel.com ([10.67.119.112]) by fmsmga006.fm.intel.com with ESMTP; 13 Jul 2020 00:21:11 -0700 From: Cheng Jiang To: bruce.richardson@intel.com, dev@dpdk.org Cc: patrick.fu@intel.com, Cheng Jiang Date: Mon, 13 Jul 2020 07:15:19 +0000 Message-Id: <20200713071519.110662-1-Cheng1.jiang@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 20.11] raw/ioat: added 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" Added a flag which controls whether rte_ioat_enqueue_copy and rte_ioat_completed_copies function should process handle parameters to improve the performance when handle parameters are not necessary to use. This is targeting 20.11 release. Signed-off-by: Cheng Jiang --- drivers/raw/ioat/ioat_rawdev.c | 1 + drivers/raw/ioat/rte_ioat_rawdev.h | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c index 87fd088aa..5bf030785 100644 --- a/drivers/raw/ioat/ioat_rawdev.c +++ b/drivers/raw/ioat/ioat_rawdev.c @@ -57,6 +57,7 @@ ioat_dev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config) return -EINVAL; ioat->ring_size = params->ring_size; + ioat->hdls_enable = params->hdls_enable; if (ioat->desc_ring != NULL) { rte_memzone_free(ioat->desc_mz); ioat->desc_ring = NULL; diff --git a/drivers/raw/ioat/rte_ioat_rawdev.h b/drivers/raw/ioat/rte_ioat_rawdev.h index f765a6557..daca04dd3 100644 --- a/drivers/raw/ioat/rte_ioat_rawdev.h +++ b/drivers/raw/ioat/rte_ioat_rawdev.h @@ -35,6 +35,7 @@ */ struct rte_ioat_rawdev_config { unsigned short ring_size; + bool hdls_enable; }; /** @@ -52,6 +53,8 @@ struct rte_ioat_rawdev { unsigned short ring_size; struct rte_ioat_generic_hw_desc *desc_ring; + + bool hdls_enable; /* control if handles need to be copied */ __m128i *hdls; /* completion handles for returning to user */ @@ -121,8 +124,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_enable) + 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++; @@ -208,6 +213,11 @@ rte_ioat_completed_copies(int dev_id, uint8_t max_copies, if (count > max_copies) count = max_copies; + ioat->next_read = read + count; + ioat->completed += count; + if (!ioat->hdls_enable) + return count; + for (; i < count - 1; i += 2, read += 2) { __m128i hdls0 = _mm_load_si128(&ioat->hdls[read & mask]); __m128i hdls1 = _mm_load_si128(&ioat->hdls[(read + 1) & mask]); @@ -223,8 +233,6 @@ rte_ioat_completed_copies(int dev_id, uint8_t max_copies, dst_hdls[i] = hdls[1]; } - ioat->next_read = read; - ioat->completed += count; return count; } -- 2.27.0