[v3,6/6] tests/nic_single_core_perf: revise rx desc size

Message ID 20210331101659.506185-7-lijuan.tu@intel.com (mailing list archive)
State Accepted
Headers
Series revise tests/nic_signle_core_perf |

Commit Message

Tu, Lijuan March 31, 2021, 10:16 a.m. UTC
  rx_desc_16byte uses  'y' indicates the rx descriptor size to 16B, and
other string for 32B. but 'y' is a reserved string in INI, misuse it
will casuse the write-back configurattion file can't be read correctly.
so rename rx_desc_16byte to rx_desc_size and the type is integer.

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
---
 conf/nic_single_core_perf.cfg           |  4 +++-
 tests/TestSuite_nic_single_core_perf.py | 17 +++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)
  

Patch

diff --git a/conf/nic_single_core_perf.cfg b/conf/nic_single_core_perf.cfg
index 72b8c533..7970995e 100644
--- a/conf/nic_single_core_perf.cfg
+++ b/conf/nic_single_core_perf.cfg
@@ -5,6 +5,8 @@ 
 # numbers, and the pattern is
 #    {'frame size': ['descriptor number #1', 'descriptor number #2']}
 #
+#  - rx_desc_size defines the rx descriptor size which is 16B or 32B.
+#
 #  - throughput_stat_sample_interval defines interval of get throughput
 #  statistics (second). If not set, it is 5 seconds by default.
 #
@@ -39,7 +41,7 @@ 
 update_expected = True
 test_parameters = {'1C/1T': {64: [512, 2048]},
                     '1C/2T': {64: [512, 2048]}}
-rx_desc_16byte = 'y'
+rx_desc_size = 16
 test_duration = 60
 throughput_stat_sample_interval = 2
 accepted_tolerance = 0.05
diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py
index 8606f599..ee022054 100644
--- a/tests/TestSuite_nic_single_core_perf.py
+++ b/tests/TestSuite_nic_single_core_perf.py
@@ -58,13 +58,15 @@  class TestNicSingleCorePerf(TestCase):
                                  "Not required NIC ")
         self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip']
 
-        self.rx_desc = self.get_suite_cfg()['rx_desc_16byte']
-        if 'y' == self.rx_desc:
+        self.rx_desc_size = self.get_suite_cfg().get('rx_desc_size', 32)
+        err_msg = "Rx desc only has 16B and 32B size, %d is not valid" % self.rx_desc_size
+        self.verify(self.rx_desc_size == 16 or self.rx_desc_size == 32, err_msg)
+        if self.rx_desc_size == 16:
             # 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})
+                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': 'y'})
             elif self.nic in ["columbiaville_100g", "columbiaville_25g", "columbiaville_25gx2"]:
-                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': self.rx_desc})
+                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': 'y'})
             self.dut.build_install_dpdk(self.target)
 
         # Based on h/w type, choose how many ports to use
@@ -417,11 +419,10 @@  class TestNicSingleCorePerf(TestCase):
         Run after each test suite.
         """
         # resume setting
-        if 'y' == self.rx_desc:
-            self.rx_desc = 'n'
+        if self.rx_desc_size == 16:
             if self.nic in ["fortville_25g", "fortville_spirit"]:
-                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': self.rx_desc})
+                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': 'n'})
             elif self.nic in ["columbiaville_100g", "columbiaville_25g", "columbiaville_25gx2"]:
-                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': self.rx_desc})
+                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': 'n'})
             self.dut.build_install_dpdk(self.target)
         self.dut.kill_all()