Content-Type: multipart/mixed; boundary="===============2722751377346683962==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH 1/1] accel-config: Remove duplicate movdir64b and enqcmd instructions Date: Tue, 02 Mar 2021 07:53:45 -0700 Message-ID: <62e890bb-97c5-5e29-7de3-0d914091de73@intel.com> In-Reply-To: 20210302185637.1092544-1-intel@localhost.localdomain To: accel-config@lists.01.org List-ID: --===============2722751377346683962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 3/2/2021 11:56 AM, Tony Zhu wrote: > From: Tony Zhu > > There are 2 versions of enqcmd and movdir64b under accel-config test dire= ctory. > One in accfg_test.h and one in dsa.h. The version in dsa.h doesn't have t= he "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 Reviewed-by: Dave Jiang > --- > 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 =3D 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 > #include > +#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" > - : "=3Dr"(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 ds= a_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); --===============2722751377346683962==--