Skip to contentSkip to conversation

raw/ioat: fix termination descriptor for batch

PATCH Applied Konstantin Ananyev 3 participants 3 messages Jul 16, 2021 – Jul 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raw/ioat: fix termination descriptor for batch

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")
---
 drivers/raw/ioat/rte_idxd_rawdev_fns.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/raw/ioat/rte_idxd_rawdev_fns.h +10 -2
index 57548609e3..3ea25f6ca9 100644
@@ -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 */
Signature · 1 line
2.26.3
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Konstantin Ananyev

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")

Thanks for patch.

#2 lore raw
Quoted 9 lines · Bruce Richardson
Quoted 7 lines · Konstantin Ananyev

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.

Quoted 4 lines
Quoted 3 lines
Fixes 245efe544d8e ("raw/ioat: report status of completed jobs")

Applied, thanks.

Signature · 1 line
David Marchand