[V1] tests/nic_single_core:rework 16byte configuration

Message ID 20201029055241.44633-1-yingyax.han@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/nic_single_core:rework 16byte configuration |

Commit Message

Yingya Han Oct. 29, 2020, 5:52 a.m. UTC
  rework 16byte configuration to adapt to the new version of DPDK.

Signed-off-by: hanyingya <yingyax.han@intel.com>
---
 conf/nic_single_core_perf.cfg           |  1 +
 tests/TestSuite_nic_single_core_perf.py | 32 ++++++++++---------------
 2 files changed, 14 insertions(+), 19 deletions(-)
  

Comments

Tu, Lijuan Nov. 3, 2020, 2:49 a.m. UTC | #1
> rework 16byte configuration to adapt to the new version of DPDK.
> 
> Signed-off-by: hanyingya <yingyax.han@intel.com>

Applied
  

Patch

diff --git a/conf/nic_single_core_perf.cfg b/conf/nic_single_core_perf.cfg
index e7bf3b28..4d3279ba 100644
--- a/conf/nic_single_core_perf.cfg
+++ b/conf/nic_single_core_perf.cfg
@@ -32,6 +32,7 @@ 
 update_expected = True
 test_parameters = {'1C/1T': {64: [512, 2048]},
                     '1C/2T': {64: [512, 2048]}}
+rx_desc_16byte = 'y'
 test_duration = 60
 accepted_tolerance = 1
 expected_throughput = {
diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py
index e93ee46e..eb42fb30 100644
--- a/tests/TestSuite_nic_single_core_perf.py
+++ b/tests/TestSuite_nic_single_core_perf.py
@@ -57,16 +57,13 @@  class TestNicSingleCorePerf(TestCase):
                                  "Not required NIC ")
         self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip']
 
-        # Update DPDK config file and rebuild to get best perf on fortville
-        if self.nic in ["fortville_25g", "fortville_spirit"]:
-            self.dut.send_expect(
-                "sed -i -e 's/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=y/' ./config/common_base", "#", 20)
-            self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': 'y'})
-            self.dut.build_install_dpdk(self.target)
-        elif self.nic in ["columbiaville_100g", "columbiaville_25g"]:
-            self.dut.send_expect(
-                "sed -i -e 's/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=y/' ./config/common_base", "#", 20)
-            self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': 'y'})
+        self.rx_desc = self.get_suite_cfg()['rx_desc_16byte']
+        if 'y' == self.rx_desc:
+            # Update DPDK config file and rebuild to get best perf on fortville
+            if self.nic in ["fortville_25g", "fortville_spirit"]:
+                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': self.rx_desc})
+            elif self.nic in ["columbiaville_100g", "columbiaville_25g"]:
+                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': self.rx_desc})
             self.dut.build_install_dpdk(self.target)
 
         # Based on h/w type, choose how many ports to use
@@ -395,14 +392,11 @@  class TestNicSingleCorePerf(TestCase):
         Run after each test suite.
         """
         # resume setting
-        if self.nic in ["fortville_25g", "fortville_spirit"]:
-            self.dut.send_expect(
-                "sed -i -e 's/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=y/CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n/' ./config/common_base", "#", 20)
-            self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': 'n'})
-            self.dut.build_install_dpdk(self.target)
-        elif self.nic in ["columbiaville_100g", "columbiaville_25g"]:
-            self.dut.send_expect(
-                "sed -i -e 's/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=y/CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n/' ./config/common_base", "#", 20)
-            self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': 'n'})
+        if 'y' == self.rx_desc:
+            self.rx_desc = 'n'
+            if self.nic in ["fortville_25g", "fortville_spirit"]:
+                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': self.rx_desc})
+            elif self.nic in ["columbiaville_100g", "columbiaville_25g"]:
+                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': self.rx_desc})
             self.dut.build_install_dpdk(self.target)
         self.dut.kill_all()