Skip to contentSkip to conversation

accel-config: Remove duplicate movdir64b and enqcmd instructions

PATCH Dave Jiang 1 participant 1 message Mar 2, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dave Jiang

author Reviewed-by
#1 lore raw
Quoted 8 lines · Tony Zhu

From: Tony Zhu <tony.zhu(a)intel.com>

There are 2 versions of enqcmd and movdir64b under accel-config test directory. One in accfg_test.h and one in dsa.h. The version in dsa.h doesn't have the "sfence" called before the submit instruction and is wrong for DSA. The version in accfg_test.h is the correct version.

Signed-off-by Tony Zhu <tony.zhu(a)intel.com>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>
Quoted 69 lines
---
  test/dsa.c  |  2 +-
  test/dsa.h  | 19 +------------------
  test/prep.c |  2 +-
  3 files changed, 3 insertions(+), 20 deletions(-)
test/dsa.c +1 -1
index 70eda30..602bfb8 100644
@@ -367,7 +367,7 @@ int dsa_enqcmd(struct dsa_context *ctx, struct dsa_hw_desc *hw)
  	int ret = 0;
 
  	while (retry_count < 3) {
-		if (!enqcmd(hw, ctx->wq_reg))
+		if (!enqcmd(ctx->wq_reg, hw))
  			break;
 
  		info("retry\n");
test/dsa.h +1 -18
index b99ec44..b301593 100644
@@ -4,6 +4,7 @@
  #define __TEST_DSA_H__
  #include <accfg/libaccel_config.h>
  #include <linux/idxd.h>
+#include "accfg_test.h"
 
  #define MAX_PATH_LENGTH 1024
 
@@ -144,24 +145,6 @@ static inline void dbg(const char *msg, ...)
  	va_end(args);
  }
 
-static inline unsigned char enqcmd(struct dsa_hw_desc *desc,
-			volatile void *reg)
-{
-	unsigned char retry;
-
-	asm volatile(".byte 0xf2, 0x0f, 0x38, 0xf8, 0x02\t\n"
-			"setz %0\t\n"
-			: "=r"(retry) : "a" (reg), "d" (desc));
-	return retry;
-}
-
-static inline void movdir64b(struct dsa_hw_desc *desc,
-			volatile void *reg)
-{
-	asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02\t\n"
-		: : "a" (reg), "d" (desc));
-}
-
  /* Dump DSA hardware descriptor to log */
  static inline void dump_desc(struct dsa_hw_desc *hw)
  {
test/prep.c +1 -1
index 42f4f81..ce5a3a6 100644
@@ -24,7 +24,7 @@ void dsa_desc_submit(struct dsa_context *ctx, struct dsa_hw_desc *hw)
 
  	/* use MOVDIR64B for DWQ */
  	if (ctx->dedicated)
-		movdir64b(hw, ctx->wq_reg);
+		movdir64b(ctx->wq_reg, hw);
  	else /* use ENQCMD for SWQ */
  		if (dsa_enqcmd(ctx, hw))
  			usleep(10000);