Content-Type: multipart/mixed; boundary="===============6891826769357665174==" MIME-Version: 1.0 From: Dave Jiang Subject: [Accel-config] Re: [PATCH v1 1/1] accel-config/test: Fix description timeout calculation to overflow Date: Thu, 28 Apr 2022 08:39:45 -0700 Message-ID: In-Reply-To: b9a8d9fe-f28d-faf1-3d25-e6c9b1557474@intel.com To: accel-config@lists.01.org List-ID: --===============6891826769357665174== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 4/28/2022 8:32 AM, Dave Jiang wrote: > > On 4/27/2022 6:31 PM, Tony Zhu wrote: >> Dsa_test application will fail when when utilizing memory sizes larger >> than 128MiB against multiple devices. The init of timeout should use >> the input msec_timeout. The commit message should say: Testing has shown that when using large transfer size, the mwait value = is not working correctly. The dsa_test application will fail due to = constant value converted by compiler to integer and cause the math to = overflow on large values. Explicitly declare constant to UL in order to = force type casting of unsigned long. Also, the calculation should use = the passed in timeout parameter and not the global constant. Tony, can you also add a patch and remove the global variable ms_timeout = since it's not being used anywhere now? This is not urgent. Thanks! > Signed-off-by: Ken Buchanan >> Signed-off-by: Tony Zhu > > Reviewed-by: Dave Jiang > > >> --- >> =C2=A0 test/accel_test.c | 2 +- >> =C2=A0 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/test/accel_test.c b/test/accel_test.c >> index 8487099..0468a00 100644 >> --- a/test/accel_test.c >> +++ b/test/accel_test.c >> @@ -331,7 +331,7 @@ int acctest_wait_on_desc_timeout(struct = >> completion_record *comp, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 j++; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long timeout =3D (m= s_timeout * 1000000) * 3; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long timeout =3D (m= sec_timeout * 1000000ul) * 3; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int r =3D 1; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long t = =3D 0; > _______________________________________________ > Accel-config mailing list -- accel-config(a)lists.01.org > To unsubscribe send an email to accel-config-leave(a)lists.01.org --===============6891826769357665174==--