[Accel-config] Re: [PATCH 1/1] accel-config: Remove duplicate movdir64b and enqcmd instructions

Dave Jiang <dave.jiang at intel.com>
Newsgroups dev.linux.lists.accel-config
Message-ID <[email protected]>
On 3/2/2021 11:56 AM, Tony Zhu wrote:
> 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>


> ---
>   test/dsa.c  |  2 +-
>   test/dsa.h  | 19 +------------------
>   test/prep.c |  2 +-
>   3 files changed, 3 insertions(+), 20 deletions(-)
>
> diff --git a/test/dsa.c b/test/dsa.c
> index 70eda30..602bfb8 100644
> --- a/test/dsa.c
> +++ b/test/dsa.c
> @@ -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");
> diff --git a/test/dsa.h b/test/dsa.h
> index b99ec44..b301593 100644
> --- a/test/dsa.h
> +++ b/test/dsa.h
> @@ -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)
>   {
> diff --git a/test/prep.c b/test/prep.c
> index 42f4f81..ce5a3a6 100644
> --- a/test/prep.c
> +++ b/test/prep.c
> @@ -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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.