DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Subject: [dpdk-dev] [PATCH] raw/ioat: fix termination descriptor for batch
Date: Fri, 16 Jul 2021 14:50:27 +0100	[thread overview]
Message-ID: <20210716135027.30855-1-konstantin.ananyev@intel.com> (raw)

When batch_size == 1, idxd has to add a dummy termination descriptor
to satisfy HW requirements.
Right now it uses NOP descriptor with FENCE flag.
This is excessive and fencing can slowdown things quite significantly.
The patch removes FENCE flag from termination dummy descriptor.
That helps to improve performance for no-burst scenarios.

Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/raw/ioat/rte_idxd_rawdev_fns.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/ioat/rte_idxd_rawdev_fns.h b/drivers/raw/ioat/rte_idxd_rawdev_fns.h
index 57548609e3..3ea25f6ca9 100644
--- a/drivers/raw/ioat/rte_idxd_rawdev_fns.h
+++ b/drivers/raw/ioat/rte_idxd_rawdev_fns.h
@@ -231,6 +231,14 @@ __idxd_enqueue_copy(int dev_id, rte_iova_t src, rte_iova_t dst,
 			src, dst, length, &hdl);
 }
 
+static __rte_always_inline int
+__idxd_enqueue_nop(int dev_id)
+{
+	/* only op field needs filling - zero src, dst and length */
+	return __idxd_write_desc(dev_id, idxd_op_nop << IDXD_CMD_OP_SHIFT,
+			0, 0, 0, NULL);
+}
+
 static __rte_always_inline int
 __idxd_fence(int dev_id)
 {
@@ -260,8 +268,8 @@ __idxd_perform_ops(int dev_id)
 		return 0;
 
 	if (idxd->batch_size == 1)
-		/* use a fence as a null descriptor, so batch_size >= 2 */
-		if (__idxd_fence(dev_id) != 1)
+		/* use a NOP as a null descriptor, so batch_size >= 2 */
+		if (__idxd_enqueue_nop(dev_id) != 1)
 			return -1;
 
 	/* write completion beyond last desc in the batch */
-- 
2.26.3


             reply	other threads:[~2021-07-16 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 13:50 Konstantin Ananyev [this message]
2021-07-16 14:27 ` Bruce Richardson
2021-07-20 13:51   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210716135027.30855-1-konstantin.ananyev@intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).