test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH V1 0/3] IGC Enable Tx Timestamp Offloading
@ 2023-07-16 14:00 Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 1/3] test_plans/index: add test plan for igc_tx_timestamp Yaqi Tang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yaqi Tang @ 2023-07-16 14:00 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

Yaqi Tang (3):
  test_plans/index
  test_plans/igc_tx_timestamp
  tests/igc_tx_timestamp

 test_plans/igc_tx_timestamp_test_plan.rst | 161 +++++++++++++++++++
 test_plans/index.rst                      |   1 +
 tests/TestSuite_igc_tx_timestamp.py       | 184 ++++++++++++++++++++++
 3 files changed, 346 insertions(+)
 create mode 100644 test_plans/igc_tx_timestamp_test_plan.rst
 create mode 100644 tests/TestSuite_igc_tx_timestamp.py

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V1 1/3] test_plans/index: add test plan for igc_tx_timestamp
  2023-07-16 14:00 [PATCH V1 0/3] IGC Enable Tx Timestamp Offloading Yaqi Tang
@ 2023-07-16 14:00 ` Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 2/3] test_plans/igc_tx_timestamp: igc enable tx timestamp offloading Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 3/3] tests/igc_tx_timestamp: " Yaqi Tang
  2 siblings, 0 replies; 4+ messages in thread
From: Yaqi Tang @ 2023-07-16 14:00 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

Add new test plan for igc enable tx timestamp offloading.

Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>
---
 test_plans/index.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test_plans/index.rst b/test_plans/index.rst
index 2ac4850d..dc6f6d22 100644
--- a/test_plans/index.rst
+++ b/test_plans/index.rst
@@ -57,6 +57,7 @@ The following are the test plans for the DPDK DTS automated test system.
     ice_vf_support_multicast_address_test_plan
     ice_rss_protocol_agnostic_flow_test_plan
     ice_fdir_protocol_agnostic_flow_test_plan
+    igc_tx_timestamp_test_plan
     cloud_filter_with_l4_port_test_plan
     dcf_lifecycle_test_plan
     crypto_perf_cryptodev_perf_test_plan
-- 
2.25.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V1 2/3] test_plans/igc_tx_timestamp: igc enable tx timestamp offloading
  2023-07-16 14:00 [PATCH V1 0/3] IGC Enable Tx Timestamp Offloading Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 1/3] test_plans/index: add test plan for igc_tx_timestamp Yaqi Tang
@ 2023-07-16 14:00 ` Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 3/3] tests/igc_tx_timestamp: " Yaqi Tang
  2 siblings, 0 replies; 4+ messages in thread
From: Yaqi Tang @ 2023-07-16 14:00 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

IGC Enable Tx timestamp offloading by leveraging I225 NIC's "Launch Time".

Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>
---
 test_plans/igc_tx_timestamp_test_plan.rst | 161 ++++++++++++++++++++++
 1 file changed, 161 insertions(+)
 create mode 100644 test_plans/igc_tx_timestamp_test_plan.rst

diff --git a/test_plans/igc_tx_timestamp_test_plan.rst b/test_plans/igc_tx_timestamp_test_plan.rst
new file mode 100644
index 00000000..727e73be
--- /dev/null
+++ b/test_plans/igc_tx_timestamp_test_plan.rst
@@ -0,0 +1,161 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+   Copyright(c) 2023 Intel Corporation
+
+==================================
+IGC Enable Tx Timestamp Offloading
+==================================
+
+Description
+===========
+IGC Enable Tx timestamp offloading by leveraging I225 NIC's "Launch Time".
+Measure time interval for Rx timestamp when setting Tx interval between packets in one burst and MAX/MIN error.
+Currently, the minimum time interval for Rx timestamp when setting Tx interval implemented by 2.5G IGC NIC is 300ns.
+
+.. note::
+   testpmd> set txtimes (inter),(intra)
+   inter is the delay between the bursts in the device clock units.
+   intra is the delay between the packets within the burst specified in the device clock units. 
+   Due to the time difference in the software, the inter value should be as large as possible to avoid conflicts, 
+   so the inter value in this plan is set to 30000000.
+
+Prerequisites
+=============
+
+Topology
+--------
+The connection is as below table::
+   +-----------------------------+
+   |     DUT     |     TESTER    |
+   +=============================+
+   |            2.5G             |
+   | IGC-NIC-1  ----  IGC-NIC-2  |
+   +-----------------------------+
+
+Hardware
+--------
+Supported NICs: IGC-I225_LM/IGC-I226_LM
+
+Software
+--------
+dpdk: http://dpdk.org/git/dpdk
+runtime command: https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html
+
+General Set Up
+--------------
+1. Compile DPDK::
+
+    # CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib --default-library=static <dpdk build dir>
+    # ninja -C <dpdk build dir> -j 110
+
+2. Get the pci device id and interface of DUT and tester.
+   For example, 0000:18:00.0 and 0000:86:00.0 is pci device id,
+   ens785 and ens803 is interface::
+
+    <dpdk dir># ./usertools/dpdk-devbind.py -s
+
+    0000:18:00.0 'Device 125b' if=ens785 drv=igc unused=vfio-pci
+    0000:86:00.0 'Device 125b' if=ens803 drv=igc unused=vfio-pci
+    
+3. Bind the DUT port to dpdk::
+
+    <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci <DUT port pci device id>
+
+4. Tester compile test-timestamp app::
+
+   # gcc /root/pkt_rx_tx.c -o test-timestamp -lpthread
+
+5. Tester Launch test-timestamp app::
+
+   # ./test-timestamp -i <Tester port interface> -t
+
+Test Case
+=========
+Test Case 1: Enable tx timestamp, check time interval of rx timestamp
+---------------------------------------------------------------------
+Launch testpmd enable tx timestamp offloading, set different txtimes intra and measure time interval of Rx timestamp between packets in one burst and MAX/MIN error.
+When the set txtimes intra more than 300ns, the time interval for Rx timestamp is the set intra. When it's less than 300ns, the time interval for Rx timestamp is 300ns.
+
+Subcase 1: set txtimes intra 2000ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd enable tx timestamp::
+
+   ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1-2 -n 4 -a 0000:18:00.0 -- -i --tx-offloads=0x200000
+
+2. Set txtimes intra::
+
+   set fwd txonly
+   set txtimes 30000000,2000
+   start
+
+3. Check the time interval of Rx timestamp is 2000ns and measure MAX/MIN error.
+
+Subcase 2: set txtimes intra 1000ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Modify subcase 1 test step 2 to::
+
+    set txtimes 30000000,1000
+
+2. Execute subcase 1 test steps to check the time interval of Rx timestamp is 1000ns and measure MAX/MIN error.
+
+Subcase 3: set txtimes intra 400ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Modify subcase 1 test step 2 to::
+
+    set txtimes 30000000,400
+
+2. Execute subcase 1 test steps to check the time interval of Rx timestamp is 400ns and measure MAX/MIN error.
+
+Subcase 4: set txtimes intra 300ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Modify subcase 1 test step 2 to::
+
+    set txtimes 30000000,300
+
+2. Execute subcase 1 test steps to check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+
+Subcase 5: set txtimes intra 200ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Modify subcase 1 test step 2 to::
+
+    set txtimes 30000000,200
+
+2. Execute subcase 1 test steps to check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+
+Test Case 2: Without tx timestamp, check time interval of rx timestamp
+----------------------------------------------------------------------
+Launch testpmd without tx timestamp offloading, set different txtimes intra and measure time interval for Rx timestamp between packets in one burst and MAX/MIN error.
+Regardless of the value of txtimes intra, the time interval for Rx timestamp is 300ns.
+
+Subcase 1: set txtimes intra 2000ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd enable tx timestamp::
+
+   ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1-2 -n 4 -a 0000:18:00.0 -- -i
+
+2. Set txtimes intra::
+
+   set fwd txonly
+   set txtimes 30000000,2000
+   start
+
+3. Check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+
+Subcase 2: set txtimes intra 1000ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Modify subcase 1 test step 2 to::
+
+    set txtimes 30000000,1000
+
+2. Execute subcase 1 test steps to check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+
+Subcase 3: set txtimes intra 400ns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1. Modify subcase 1 test step 2 to::
+
+    set txtimes 30000000,400
+
+2. Execute subcase 1 test steps to check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH V1 3/3] tests/igc_tx_timestamp: igc enable tx timestamp offloading
  2023-07-16 14:00 [PATCH V1 0/3] IGC Enable Tx Timestamp Offloading Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 1/3] test_plans/index: add test plan for igc_tx_timestamp Yaqi Tang
  2023-07-16 14:00 ` [PATCH V1 2/3] test_plans/igc_tx_timestamp: igc enable tx timestamp offloading Yaqi Tang
@ 2023-07-16 14:00 ` Yaqi Tang
  2 siblings, 0 replies; 4+ messages in thread
From: Yaqi Tang @ 2023-07-16 14:00 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

IGC Enable Tx timestamp offloading by leveraging I225 NIC's "Launch Time".

Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>
---
 tests/TestSuite_igc_tx_timestamp.py | 184 ++++++++++++++++++++++++++++
 1 file changed, 184 insertions(+)
 create mode 100644 tests/TestSuite_igc_tx_timestamp.py

diff --git a/tests/TestSuite_igc_tx_timestamp.py b/tests/TestSuite_igc_tx_timestamp.py
new file mode 100644
index 00000000..5fa0ee32
--- /dev/null
+++ b/tests/TestSuite_igc_tx_timestamp.py
@@ -0,0 +1,184 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2023 Intel Corporation
+#
+
+import re
+import time
+
+from framework.pmd_output import PmdOutput
+from framework.test_case import TestCase
+from framework.utils import GREEN, RED
+
+
+class TimestampTest(TestCase):
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        Generic filter Prerequistites
+        """
+        self.verify(
+            self.nic in ["IGC-I225_LM", "IGC-I226_LM"],
+            "%s nic not support tx timestamp" % self.nic,
+        )
+        self.dut_ports = self.dut.get_ports(self.nic)
+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        # Verify that enough ports are available
+        self.verify(len(self.dut_ports) >= 1, "Insufficient ports")
+        self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])
+        self.tester_iface0 = self.tester.get_interface(self.tester_port0)
+        self.pmdout = PmdOutput(self.dut)
+        self.pf_pci = self.dut.ports_info[self.dut_ports[0]]["pci"]
+
+        apps_name = "test-timestamp"
+        self.build_test_app(apps_name)
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        pass
+
+    def build_test_app(self, apps_name):
+        # Compile test app
+        print(self.tester.send_expect("ls", "#", 5))
+        test_rx_timestamp = "/root/pkt_rx_tx.c"
+        out = self.tester.send_expect(
+            "gcc %s -o %s -lpthread" % (test_rx_timestamp, apps_name), "#", 15
+        )
+        self.verify("Error" not in out, "Compilation %s error" % apps_name)
+        output = self.tester.send_expect("find -name %s" % apps_name, "#")
+        self.verify("%s" % apps_name in output, "Compilation %s error" % apps_name)
+
+    def launch_testpmd(self, param, intra):
+        """
+        start testpmd
+        """
+        # Prepare testpmd EAL and parameters
+        self.pmdout.start_testpmd(
+            param=param,
+            eal_param=f"-a {self.pf_pci}",
+            socket=self.ports_socket,
+        )
+        # Test link status
+        res = self.pmdout.wait_link_status_up("all", 5)
+        self.verify(res is True, "there have port link is down")
+        self.pmdout.execute_cmd("set fwd txonly")
+        self.pmdout.execute_cmd("set txtimes 30000000,%d" % intra)
+        self.pmdout.execute_cmd("start", "testpmd>", 5)
+        self.pmdout.execute_cmd("stop")
+
+    def launch_test_app(self, apps_name):
+        print(self.tester.send_expect("ls", "#", 5))
+        self.tester.send_command("./%s -i %s -t" % (apps_name, self.tester_iface0), "#")
+        out = self.tester.get_session_output(timeout=0.1)
+        self.verify("Press Enter to continue" in out, "Launch test app failed.")
+
+    def check_time_interval_error(self, interval):
+        out = self.tester.get_session_output(timeout=0.1)
+        rx_ts_pat = ".*ts\s+(\d+)"
+        rx_ts = re.findall(rx_ts_pat, out, re.M)
+        rx_ts = list(map(int, rx_ts))
+        self.error_msgs = []
+        intervals = []
+        if len(rx_ts) != 32:
+            error_msg = "Tester should recieve 32 RX timestamps."
+            self.logger.error(error_msg)
+            self.error_msgs.append(error_msg)
+        else:
+            for i in range(len(rx_ts) - 1):
+                rx = rx_ts[i + 1] - rx_ts[i]
+                intervals.append(rx)
+            self.logger.info("Rx time intervals: {}".format(intervals))
+            error = [abs((x - interval) / interval) * 100 for x in intervals]
+            error = [round(x, 2) for x in error]
+            self.logger.info("Rx time interval error: {}".format(error))
+            if all(x < 50 for x in error) == False:
+                error_msg = "The time interval error for Rx timestamp is too large."
+                self.logger.error(error_msg)
+                self.error_msgs.append(error_msg)
+            else:
+                self.logger.info(
+                    "max_error={}%, min_error={}%".format(max(error), min(error))
+                )
+        self.verify(not self.error_msgs, "some subcases failed")
+
+    def handle_tx_timestamp_case(self, apps_name, param, intra, interval):
+        self.launch_test_app(apps_name)
+        self.launch_testpmd(param, intra)
+        self.check_time_interval_error(interval)
+        self.pmdout.execute_cmd("quit", "#")
+
+    def test_with_tx_timestamp_check_time_interval(self, apps_name="test-timestamp"):
+        # Subcase 1: set txtimes intra 2000ns, check the time interval of Rx timestamp is 2000ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 1: set txtimes intra 2000ns ================"
+        )
+        self.handle_tx_timestamp_case(
+            apps_name, param="--tx-offloads=0x200000", intra=2000, interval=2000
+        )
+
+        # Subcase 2: set txtimes intra 1000ns, check the time interval of Rx timestamp is 1000ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 2: set txtimes intra 1000ns ================"
+        )
+        self.handle_tx_timestamp_case(
+            apps_name, param="--tx-offloads=0x200000", intra=1000, interval=1000
+        )
+
+        # Subcase 3: set txtimes intra 400ns, check the time interval of Rx timestamp is 400ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 3: set txtimes intra 400ns ================"
+        )
+        self.handle_tx_timestamp_case(
+            apps_name, param="--tx-offloads=0x200000", intra=400, interval=400
+        )
+
+        # Subcase 4: set txtimes intra 300ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 4: set txtimes intra 300ns ================"
+        )
+        self.handle_tx_timestamp_case(
+            apps_name, param="--tx-offloads=0x200000", intra=300, interval=300
+        )
+
+        # Subcase 5: set txtimes intra 200ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 5: set txtimes intra 200ns ================"
+        )
+        self.handle_tx_timestamp_case(
+            apps_name, param="--tx-offloads=0x200000", intra=200, interval=300
+        )
+
+    def test_without_tx_timestamp_check_time_interval(self, apps_name="test-timestamp"):
+        # Subcase 1: set txtimes intra 2000ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 1: set txtimes intra 2000ns ================"
+        )
+        self.handle_tx_timestamp_case(apps_name, param="", intra=2000, interval=300)
+
+        # Subcase 2: set txtimes intra 1000ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 2: set txtimes intra 1000ns ================"
+        )
+        self.handle_tx_timestamp_case(apps_name, param="", intra=1000, interval=300)
+
+        # Subcase 3: set txtimes intra 400ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.
+        self.logger.info(
+            "===================Test subcase 3: set txtimes intra 400ns ================"
+        )
+        self.handle_tx_timestamp_case(apps_name, param="", intra=400, interval=300)
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        """
+        # Bind the interfaces to the igc driver, then bind to the vfio-pci driver.
+        self.pmdout.execute_cmd("quit", "#")
+        self.dut.bind_interfaces_linux("igc")
+        self.dut.bind_interfaces_linux("vfio-pci")
+
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
+        self.dut.kill_all()
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-16 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-16 14:00 [PATCH V1 0/3] IGC Enable Tx Timestamp Offloading Yaqi Tang
2023-07-16 14:00 ` [PATCH V1 1/3] test_plans/index: add test plan for igc_tx_timestamp Yaqi Tang
2023-07-16 14:00 ` [PATCH V1 2/3] test_plans/igc_tx_timestamp: igc enable tx timestamp offloading Yaqi Tang
2023-07-16 14:00 ` [PATCH V1 3/3] tests/igc_tx_timestamp: " Yaqi Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).