[V1,4/4] tests/unit_tests_eal: modify code to adapt avx512

Message ID 1635835398-70543-4-git-send-email-xiangx.an@intel.com (mailing list archive)
State Superseded
Headers
Series [V1,1/4] tests/kernelpf_iavf: modify code to adapt avx512 |

Commit Message

Xiang An Nov. 2, 2021, 6:43 a.m. UTC
  Modify code to adapt rxmod avx512.

Signed-off-by: Xiang An <xiangx.an@intel.com>
---
 tests/TestSuite_unit_tests_eal.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Ananyev, Konstantin Nov. 2, 2021, 10:43 a.m. UTC | #1
Hi Xiang,

> Modify code to adapt rxmod avx512.
> 
> Signed-off-by: Xiang An <xiangx.an@intel.com>
> ---
>  tests/TestSuite_unit_tests_eal.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tests_eal.py
> index 8096183..b5cb7a2 100644
> --- a/tests/TestSuite_unit_tests_eal.py
> +++ b/tests/TestSuite_unit_tests_eal.py
> @@ -38,7 +38,7 @@ EAL autotest.
> 
>  import framework.utils as utils
>  from framework.test_case import TestCase
> -
> +from framework.settings import load_global_setting, DPDK_RXMODE_SETTING
>  #
>  #
>  # Test class.
> @@ -462,7 +462,8 @@ class TestUnitTestsEal(TestCase):
>          self.test_app_cmdline += "--no-pci"
> 
>          if self.dut.dpdk_version >= '20.11.0':
> -            self.test_app_cmdline += " --force-max-simd-bitwidth=0"
> +            if load_global_setting(DPDK_RXMODE_SETTING) == 'default':
> +                self.test_app_cmdline += " --force-max-simd-bitwidth=0"

Could you probably explain why it is needed here?

>          self.dut.send_expect(self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time)
>          out = self.dut.send_expect("acl_autotest", "RTE>>", self.run_cmd_time)
>          self.dut.send_expect("quit", "# ")
> --
> 1.8.3.1
  
Huang, ZhiminX Nov. 2, 2021, 11:16 a.m. UTC | #2
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Ananyev, Konstantin
> Sent: Tuesday, November 2, 2021 6:43 PM
> To: An, XiangX <xiangx.an@intel.com>; dts@dpdk.org
> Cc: An, XiangX <xiangx.an@intel.com>
> Subject: Re: [dts] [PATCH V1 4/4] tests/unit_tests_eal: modify code to adapt
> avx512
> 
> 
> Hi Xiang,
> 
> > Modify code to adapt rxmod avx512.
> >
> > Signed-off-by: Xiang An <xiangx.an@intel.com>
> > ---
> >  tests/TestSuite_unit_tests_eal.py | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/TestSuite_unit_tests_eal.py
> b/tests/TestSuite_unit_tests_eal.py
> > index 8096183..b5cb7a2 100644
> > --- a/tests/TestSuite_unit_tests_eal.py
> > +++ b/tests/TestSuite_unit_tests_eal.py
> > @@ -38,7 +38,7 @@ EAL autotest.
> >
> >  import framework.utils as utils
> >  from framework.test_case import TestCase
> > -
> > +from framework.settings import load_global_setting,
> DPDK_RXMODE_SETTING
> >  #
> >  #
> >  # Test class.
> > @@ -462,7 +462,8 @@ class TestUnitTestsEal(TestCase):
> >          self.test_app_cmdline += "--no-pci"
> >
> >          if self.dut.dpdk_version >= '20.11.0':
> > -            self.test_app_cmdline += " --force-max-simd-bitwidth=0"
> > +            if load_global_setting(DPDK_RXMODE_SETTING) == 'default':
> > +                self.test_app_cmdline += "
> --force-max-simd-bitwidth=0"
> 
> Could you probably explain why it is needed here?
> 
> >          self.dut.send_expect(self.test_app_cmdline, "R.*T.*E.*>.*>",
> self.start_test_time)
> >          out = self.dut.send_expect("acl_autotest", "RTE>>",
> self.run_cmd_time)
> >          self.dut.send_expect("quit", "# ")
> > --
> > 1.8.3.1

Hi Konstantin,
We have add this case to test avx512 mode, if this judgment is not added, the cmdline will invalid.

Take a example:
x86_64-native-linuxapp-gcc/app/test/dpdk-test -l 1,2,3,4 -n 4 --file-prefix=dpdk_237965_20211103034106 --force-max-simd-bitwidth=512 --no-pci --force-max-simd-bitwidth=0

Regards,
HuangZhiMin
  
Ananyev, Konstantin Nov. 2, 2021, 11:26 a.m. UTC | #3
> > Hi Xiang,
> >
> > > Modify code to adapt rxmod avx512.
> > >
> > > Signed-off-by: Xiang An <xiangx.an@intel.com>
> > > ---
> > >  tests/TestSuite_unit_tests_eal.py | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/tests/TestSuite_unit_tests_eal.py
> > b/tests/TestSuite_unit_tests_eal.py
> > > index 8096183..b5cb7a2 100644
> > > --- a/tests/TestSuite_unit_tests_eal.py
> > > +++ b/tests/TestSuite_unit_tests_eal.py
> > > @@ -38,7 +38,7 @@ EAL autotest.
> > >
> > >  import framework.utils as utils
> > >  from framework.test_case import TestCase
> > > -
> > > +from framework.settings import load_global_setting,
> > DPDK_RXMODE_SETTING
> > >  #
> > >  #
> > >  # Test class.
> > > @@ -462,7 +462,8 @@ class TestUnitTestsEal(TestCase):
> > >          self.test_app_cmdline += "--no-pci"
> > >
> > >          if self.dut.dpdk_version >= '20.11.0':
> > > -            self.test_app_cmdline += " --force-max-simd-bitwidth=0"
> > > +            if load_global_setting(DPDK_RXMODE_SETTING) == 'default':
> > > +                self.test_app_cmdline += "
> > --force-max-simd-bitwidth=0"
> >
> > Could you probably explain why it is needed here?
> >
> > >          self.dut.send_expect(self.test_app_cmdline, "R.*T.*E.*>.*>",
> > self.start_test_time)
> > >          out = self.dut.send_expect("acl_autotest", "RTE>>",
> > self.run_cmd_time)
> > >          self.dut.send_expect("quit", "# ")
> > > --
> > > 1.8.3.1
> 
> Hi Konstantin,
> We have add this case to test avx512 mode, if this judgment is not added, the cmdline will invalid.
> 
> Take a example:
> x86_64-native-linuxapp-gcc/app/test/dpdk-test -l 1,2,3,4 -n 4 --file-prefix=dpdk_237965_20211103034106 --force-max-simd-bitwidth=512
> --no-pci --force-max-simd-bitwidth=0
> 

So DPDK_RXMODE_SETTING controls whether '--force-max-simd-bitwidth' is set or not?
If so, can we then just override it here for this test-case?
I'd like this test-case to always run with '--force-max-simd-bitwidth=0'.
That way it provides best possible coverage.
  
Huang, ZhiminX Nov. 3, 2021, 3:07 a.m. UTC | #4
> -----Original Message-----
> From: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Sent: Tuesday, November 2, 2021 7:27 PM
> To: Huang, ZhiminX <zhiminx.huang@intel.com>; dts@dpdk.org
> Cc: An, XiangX <xiangx.an@intel.com>
> Subject: RE: [dts] [PATCH V1 4/4] tests/unit_tests_eal: modify code to adapt
> avx512
> 
> 
> 
> > > Hi Xiang,
> > >
> > > > Modify code to adapt rxmod avx512.
> > > >
> > > > Signed-off-by: Xiang An <xiangx.an@intel.com>
> > > > ---
> > > >  tests/TestSuite_unit_tests_eal.py | 5 +++--
> > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/tests/TestSuite_unit_tests_eal.py
> > > b/tests/TestSuite_unit_tests_eal.py
> > > > index 8096183..b5cb7a2 100644
> > > > --- a/tests/TestSuite_unit_tests_eal.py
> > > > +++ b/tests/TestSuite_unit_tests_eal.py
> > > > @@ -38,7 +38,7 @@ EAL autotest.
> > > >
> > > >  import framework.utils as utils
> > > >  from framework.test_case import TestCase
> > > > -
> > > > +from framework.settings import load_global_setting,
> > > DPDK_RXMODE_SETTING
> > > >  #
> > > >  #
> > > >  # Test class.
> > > > @@ -462,7 +462,8 @@ class TestUnitTestsEal(TestCase):
> > > >          self.test_app_cmdline += "--no-pci"
> > > >
> > > >          if self.dut.dpdk_version >= '20.11.0':
> > > > -            self.test_app_cmdline += " --force-max-simd-bitwidth=0"
> > > > +            if load_global_setting(DPDK_RXMODE_SETTING) ==
> 'default':
> > > > +                self.test_app_cmdline += "
> > > --force-max-simd-bitwidth=0"
> > >
> > > Could you probably explain why it is needed here?
> > >
> > > >          self.dut.send_expect(self.test_app_cmdline,
> > > > "R.*T.*E.*>.*>",
> > > self.start_test_time)
> > > >          out = self.dut.send_expect("acl_autotest", "RTE>>",
> > > self.run_cmd_time)
> > > >          self.dut.send_expect("quit", "# ")
> > > > --
> > > > 1.8.3.1
> >
> > Hi Konstantin,
> > We have add this case to test avx512 mode, if this judgment is not added, the
> cmdline will invalid.
> >
> > Take a example:
> > x86_64-native-linuxapp-gcc/app/test/dpdk-test -l 1,2,3,4 -n 4
> > --file-prefix=dpdk_237965_20211103034106 --force-max-simd-bitwidth=512
> > --no-pci --force-max-simd-bitwidth=0
> >
> 
> So DPDK_RXMODE_SETTING controls whether '--force-max-simd-bitwidth' is
> set or not?
> If so, can we then just override it here for this test-case?
> I'd like this test-case to always run with '--force-max-simd-bitwidth=0'.
> That way it provides best possible coverage.
> 
> 
So according your decription, in any avx mode should be excuted '--force-max-simd-bitwidth=0'?
If so, I will re-submit dst patch to cover about acl test.
  
Ananyev, Konstantin Nov. 3, 2021, 10:39 a.m. UTC | #5
> >
> > > > Hi Xiang,
> > > >
> > > > > Modify code to adapt rxmod avx512.
> > > > >
> > > > > Signed-off-by: Xiang An <xiangx.an@intel.com>
> > > > > ---
> > > > >  tests/TestSuite_unit_tests_eal.py | 5 +++--
> > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/tests/TestSuite_unit_tests_eal.py
> > > > b/tests/TestSuite_unit_tests_eal.py
> > > > > index 8096183..b5cb7a2 100644
> > > > > --- a/tests/TestSuite_unit_tests_eal.py
> > > > > +++ b/tests/TestSuite_unit_tests_eal.py
> > > > > @@ -38,7 +38,7 @@ EAL autotest.
> > > > >
> > > > >  import framework.utils as utils
> > > > >  from framework.test_case import TestCase
> > > > > -
> > > > > +from framework.settings import load_global_setting,
> > > > DPDK_RXMODE_SETTING
> > > > >  #
> > > > >  #
> > > > >  # Test class.
> > > > > @@ -462,7 +462,8 @@ class TestUnitTestsEal(TestCase):
> > > > >          self.test_app_cmdline += "--no-pci"
> > > > >
> > > > >          if self.dut.dpdk_version >= '20.11.0':
> > > > > -            self.test_app_cmdline += " --force-max-simd-bitwidth=0"
> > > > > +            if load_global_setting(DPDK_RXMODE_SETTING) ==
> > 'default':
> > > > > +                self.test_app_cmdline += "
> > > > --force-max-simd-bitwidth=0"
> > > >
> > > > Could you probably explain why it is needed here?
> > > >
> > > > >          self.dut.send_expect(self.test_app_cmdline,
> > > > > "R.*T.*E.*>.*>",
> > > > self.start_test_time)
> > > > >          out = self.dut.send_expect("acl_autotest", "RTE>>",
> > > > self.run_cmd_time)
> > > > >          self.dut.send_expect("quit", "# ")
> > > > > --
> > > > > 1.8.3.1
> > >
> > > Hi Konstantin,
> > > We have add this case to test avx512 mode, if this judgment is not added, the
> > cmdline will invalid.
> > >
> > > Take a example:
> > > x86_64-native-linuxapp-gcc/app/test/dpdk-test -l 1,2,3,4 -n 4
> > > --file-prefix=dpdk_237965_20211103034106 --force-max-simd-bitwidth=512
> > > --no-pci --force-max-simd-bitwidth=0
> > >
> >
> > So DPDK_RXMODE_SETTING controls whether '--force-max-simd-bitwidth' is
> > set or not?
> > If so, can we then just override it here for this test-case?
> > I'd like this test-case to always run with '--force-max-simd-bitwidth=0'.
> > That way it provides best possible coverage.
> >
> >
> So according your decription, in any avx mode should be excuted '--force-max-simd-bitwidth=0'?

Yes, basically '--force-max-simd-bitwidth=0' says use max available SIMD on that box.
So on machine with avx512 it will test: avx512, avx2, sse, scalar.
On machine with avx2 only it will test: avx2, sse, scalar.
...

> If so, I will re-submit dst patch to cover about acl test.

Good, thanks.
  

Patch

diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tests_eal.py
index 8096183..b5cb7a2 100644
--- a/tests/TestSuite_unit_tests_eal.py
+++ b/tests/TestSuite_unit_tests_eal.py
@@ -38,7 +38,7 @@  EAL autotest.
 
 import framework.utils as utils
 from framework.test_case import TestCase
-
+from framework.settings import load_global_setting, DPDK_RXMODE_SETTING
 #
 #
 # Test class.
@@ -462,7 +462,8 @@  class TestUnitTestsEal(TestCase):
         self.test_app_cmdline += "--no-pci"
 
         if self.dut.dpdk_version >= '20.11.0':
-            self.test_app_cmdline += " --force-max-simd-bitwidth=0"
+            if load_global_setting(DPDK_RXMODE_SETTING) == 'default':
+                self.test_app_cmdline += " --force-max-simd-bitwidth=0"
         self.dut.send_expect(self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time)
         out = self.dut.send_expect("acl_autotest", "RTE>>", self.run_cmd_time)
         self.dut.send_expect("quit", "# ")