test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH V3 0/3] ice iavf enable packet pacing
@ 2022-08-11 11:16 Yaqi Tang
  2022-08-11 11:16 ` [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing Yaqi Tang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yaqi Tang @ 2022-08-11 11:16 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

ice iavf enable packet pacing.

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

 .../ice_iavf_packet_pacing_test_plan.rst      | 383 +++++++++++
 test_plans/index.rst                          |   1 +
 tests/TestSuite_ice_iavf_packet_pacing.py     | 641 ++++++++++++++++++
 3 files changed, 1025 insertions(+)
 create mode 100644 test_plans/ice_iavf_packet_pacing_test_plan.rst
 create mode 100644 tests/TestSuite_ice_iavf_packet_pacing.py

-- 
2.25.1


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

* [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing
  2022-08-11 11:16 [PATCH V3 0/3] ice iavf enable packet pacing Yaqi Tang
@ 2022-08-11 11:16 ` Yaqi Tang
  2022-08-12  7:40   ` Peng, Yuan
  2022-08-11 11:16 ` [dts][PATCH V3 2/3] test_plans/ice_iavf_packet_pacing: ice enable packet pacing Yaqi Tang
  2022-08-11 11:16 ` [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: " Yaqi Tang
  2 siblings, 1 reply; 8+ messages in thread
From: Yaqi Tang @ 2022-08-11 11:16 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

Add new test plan for that ice enable packet pacing for 5G small RAN.

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 a78dd0f5..7f414122 100644
--- a/test_plans/index.rst
+++ b/test_plans/index.rst
@@ -39,6 +39,7 @@ The following are the test plans for the DPDK DTS automated test system.
     ice_fdir_test_plan
     ice_ip_fragment_rte_flow_test_plan
     ice_iavf_ip_fragment_rte_flow_test_plan
+    ice_iavf_packet_pacing_test_plan
     ice_iavf_rss_configure_test_plan
     ice_iavf_fdir_pppol2tpoudp_test_plan
     ice_limit_value_test_test_plan
-- 
2.25.1


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

* [dts][PATCH V3 2/3] test_plans/ice_iavf_packet_pacing: ice enable packet pacing
  2022-08-11 11:16 [PATCH V3 0/3] ice iavf enable packet pacing Yaqi Tang
  2022-08-11 11:16 ` [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing Yaqi Tang
@ 2022-08-11 11:16 ` Yaqi Tang
  2022-08-24  7:56   ` Tu, Lijuan
  2022-08-11 11:16 ` [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: " Yaqi Tang
  2 siblings, 1 reply; 8+ messages in thread
From: Yaqi Tang @ 2022-08-11 11:16 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

ICE support queue rate limitation configure, and parse the quanta_size for IGP pacing.

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

diff --git a/test_plans/ice_iavf_packet_pacing_test_plan.rst b/test_plans/ice_iavf_packet_pacing_test_plan.rst
new file mode 100644
index 00000000..92969dac
--- /dev/null
+++ b/test_plans/ice_iavf_packet_pacing_test_plan.rst
@@ -0,0 +1,383 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+   Copyright(c) 2022 Intel Corporation
+
+=============================
+ICE IAVF Enable Packet Pacing 
+=============================
+
+Description
+===========
+1. Enable rte_tm to support queue rate limitation configure.
+2. Enable devargs to parse the quanta_size for IGP pacing.
+
+The packet pacing quality is heavily rely on FlexRan application/OS setup.
+For DPDK validation, we will focus on:
+1. Make sure queue rate limitation configuration take effect by measure the bandwidth.
+2. Should not exceed the bandwidth that be limited by the DCF.  
+3. Not to break anything else.
+
+Prerequisites
+=============
+
+Topology
+--------
+DUT port 0 <----> Tester port 0
+
+Hardware
+--------
+Supported NICs: Intel® Ethernet 800 Series E810-XXVDA4/E810-CQ
+
+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:3b:00.0 and 0000:3b:00.1 is pci device id,
+   ens785f0 and ens785f1 is interface::
+
+    <dpdk dir># ./usertools/dpdk-devbind.py -s
+
+    0000:3b:00.0 'Device 159b' if=ens785f0 drv=ice unused=vfio-pci
+    0000:3b:00.1 'Device 159b' if=ens785f1 drv=ice unused=vfio-pci
+
+3. If vf_num >= 2, Generate 2 VF on PF0, set mac address for VF1::
+
+    # echo 2 > /sys/bus/pci/devices/0000:3b:00.0/sriov_numvfs
+    # ip link set dev ens785f0 vf 0 trust on
+    # ip link set ens785f0 vf 1 mac 00:11:22:33:44:55
+
+   Else, Generate 1 VF on PF0, set mac address for VF0::
+
+    # echo 1 > /sys/bus/pci/devices/0000:3b:00.0/sriov_numvfs
+    # ip link set ens785f0 vf 0 mac 00:11:22:33:44:55
+
+4. Bind the DUT port to dpdk::
+
+    <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci <DUT port pci device id>
+
+Test Case
+=========
+Common Steps
+------------
+TREX sends one stream with frame size 64, mac address is "00:11:22:33:44:55", 100% max rate.
+When check the throughput ratio of each queue, stop the forward and check the TX-packets ratio of queues.
+The TX-packets ratio of queues is same as TX throughput ratio of queues.
+
+Test Case 1: Without quanta size, check peak_tb_rate
+----------------------------------------------------
+Launch testpmd without quanta size, check the TX throughput.
+
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0 --file-prefix=tx -- -i 
+
+2. Configure rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 612980769 0 0 0 
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0 
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 0::
+
+    testpmd> show port stats 0
+
+   Check the TX throughput is 612MBps.
+
+Test Case 2: Single queue, check peak_tb_rate
+---------------------------------------------
+Launch testpmd with quanta_size=1024, check the TX throughput.
+
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,quanta_size=1024 --file-prefix=tx -- -i 
+
+2. Configure rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 612980769 0 0 0 
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0 
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 0::
+
+    testpmd> show port stats 0
+
+   Check the TX throughput is 612MBps.
+
+Test Case 3: Multi queues, check peak_tb_rate
+---------------------------------------------
+Launch testpmd with quanta_size=1024 and multi queues, check the TX throughput and the throughput ratio of each queue.
+
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd with 8 queues::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,quanta_size=1024 --file-prefix=tx -- -i --txq=8 --rxq=8
+
+2. Configure each queue with same rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 100000000 0 0 0 
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0 
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 2 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 3 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 4 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 5 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 6 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 7 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 0::
+
+    testpmd> show port stats 0
+
+   Check the TX throughput is 800MBps.
+ 
+   Check the throughput ratio of each queue::
+    
+    testpmd> stop
+
+   Check the TX throughput of queue 0-7 is 1:1:1:1:1:1:1:1.
+
+Test Case 4: Modify quanta_size, check peak_tb_rate
+---------------------------------------------------
+Launch testpmd with quanta_size=4096 and multi queues, check the TX throughput and the throughput ratio of each queue.
+
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd with 8 queues::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,quanta_size=4096 --file-prefix=tx -- -i --txq=8 --rxq=8
+
+2. Configure each queue with same rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 100000000 0 0 0 
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0 
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 2 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 3 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 4 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 5 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 6 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 7 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 0::
+
+    testpmd> show port stats 0
+
+   Check the TX throughput is 800MBps.
+ 
+   Check the throughput ratio of each queue::
+    
+    testpmd> stop
+
+   Check the TX throughput of queue 0-7 is 1:1:1:1:1:1:1:1.
+
+Test Case 5: Invalid quanta_size, check peak_tb_rate
+----------------------------------------------------
+The scope of quanta size is [256, 4096], and it should be the product of 64.
+Launch testpmd with quanta_size=1000, check it shows invalid quanta size.
+
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,quanta_size=1000 --file-prefix=tx -- -i 
+
+2. check it shows invalid quanta size.
+
+Test Case 6: Multi queues with different rate limit, check peak_tb_rate
+-----------------------------------------------------------------------
+Launch testpmd with quanta_size=1024 and multi queues, then configure each queue with diff rate limit,
+check the TX throughput and the throughput ratio of each queue.
+
+Test Steps
+~~~~~~~~~~
+1. Launch testpmd with 8 queues::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,quanta_size=1024 --file-prefix=tx -- -i --txq=8 --rxq=8
+
+2. Configure each queue with diff rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 10000000 0 0 0
+    testpmd> add port tm node shaper profile 0 2 1000000 0 20000000 0 0 0
+    testpmd> add port tm node shaper profile 0 3 1000000 0 30000000 0 0 0
+    testpmd> add port tm node shaper profile 0 4 1000000 0 40000000 0 0 0
+    testpmd> add port tm node shaper profile 0 5 1000000 0 50000000 0 0 0
+    testpmd> add port tm node shaper profile 0 6 1000000 0 60000000 0 0 0
+    testpmd> add port tm node shaper profile 0 7 1000000 0 70000000 0 0 0
+    testpmd> add port tm node shaper profile 0 8 1000000 0 80000000 0 0 0
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0 
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 1 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 2 900 0 1 2 3 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 3 900 0 1 2 4 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 4 900 0 1 2 5 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 5 900 0 1 2 6 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 6 900 0 1 2 7 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 0 7 900 0 1 2 8 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 0::
+
+    testpmd> show port stats 0
+
+   Check the TX throughput is 360MBps.
+ 
+   Check the throughput ratio of each queue::
+    
+    testpmd> stop
+
+   Check the TX throughput of queue 0-7 is 1:2:3:4:5:6:7:8.
+
+Test Case 7: Port rate limit less than queue rate limit
+-------------------------------------------------------
+Launch dcf testpmd with quanta_size=1024 and multi queues, then configure port rate limit less than queue rate limit,
+check the TX throughput and the throughput ratio of each queue.
+
+Test Steps
+~~~~~~~~~~
+1. Launch dcf testpmd with 8 queues::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,cap=dcf -a 3b:01.1,quanta_size=1024 --file-prefix=tx -- -i --txq=8 --rxq=8 --port-topology=loop
+
+2. Configure port rate limit less than queue rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 100000000 0 0 0   
+    testpmd> add port tm node shaper profile 1 2 1000000 0 612980769 0 0 0   
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0              
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0          
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0         
+    testpmd> add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0         
+    testpmd> add port tm nonleaf node 1 1000 -1 0 1 0 -1 1 0 0
+    testpmd> add port tm nonleaf node 1 900 1000 0 1 1 -1 1 0 0          
+    testpmd> add port tm leaf node 1 0 900 0 1 2 2 0 0xffffffff 0 0         
+    testpmd> add port tm leaf node 1 1 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 2 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 3 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 4 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 5 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 6 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 7 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port tm hierarchy commit 1 no  
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 1::
+
+    testpmd> show port stats 1
+
+   Check the TX throughput is 100MBps.
+ 
+   Check the throughput ratio of each queue::
+    
+    testpmd> stop
+
+   Check the TX throughput of port1 queue 0-7 is 1:1:1:1:1:1:1:1.
+
+Test Case 8: Port rate limit more than queue rate limit
+-------------------------------------------------------
+Launch dcf testpmd with quanta_size=1024 and multi queues, then configure port rate limit more than queue rate limit,
+check the TX throughput and the throughput ratio of each queue.
+
+Test Steps
+~~~~~~~~~~
+1. Launch dcf testpmd with 8 queues::
+
+    <dpdk dir># ./<dpdk build dir>/app/dpdk-testpmd -l 1-4 -n 4 -a 0000:3b:01.0,cap=dcf -a 3b:01.1,quanta_size=1024 --file-prefix=tx -- -i --txq=8 --rxq=8 --port-topology=loop
+
+2. Configure port rate limit more than queue rate limit::
+
+    testpmd> port stop all
+    testpmd> add port tm node shaper profile 0 1 1000000 0 200000000 0 0 0   
+    testpmd> add port tm node shaper profile 1 2 1000000 0 10000000 0 0 0   
+    testpmd> add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0              
+    testpmd> add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0          
+    testpmd> add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0         
+    testpmd> add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0         
+    testpmd> add port tm nonleaf node 1 1000 -1 0 1 0 -1 1 0 0
+    testpmd> add port tm nonleaf node 1 900 1000 0 1 1 -1 1 0 0          
+    testpmd> add port tm leaf node 1 0 900 0 1 2 2 0 0xffffffff 0 0         
+    testpmd> add port tm leaf node 1 1 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 2 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 3 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 4 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 5 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 6 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> add port tm leaf node 1 7 900 0 1 2 2 0 0xffffffff 0 0
+    testpmd> port tm hierarchy commit 0 no
+    testpmd> port tm hierarchy commit 1 no  
+    testpmd> port start all
+    testpmd> set fwd mac
+    testpmd> start
+
+3. Send one stream from TREX.
+
+4. Check the TX throughput of port 1::
+
+    testpmd> show port stats 1
+
+   Check the TX throughput is 80MBps.
+ 
+   Check the throughput ratio of each queue::
+    
+    testpmd> stop
+
+   Check the TX throughput of port1 queue 0-7 is 1:1:1:1:1:1:1:1.
+
-- 
2.25.1


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

* [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: ice enable packet pacing
  2022-08-11 11:16 [PATCH V3 0/3] ice iavf enable packet pacing Yaqi Tang
  2022-08-11 11:16 ` [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing Yaqi Tang
  2022-08-11 11:16 ` [dts][PATCH V3 2/3] test_plans/ice_iavf_packet_pacing: ice enable packet pacing Yaqi Tang
@ 2022-08-11 11:16 ` Yaqi Tang
  2022-08-22  7:52   ` Chen, LingliX
  2022-09-14  7:41   ` lijuan.tu
  2 siblings, 2 replies; 8+ messages in thread
From: Yaqi Tang @ 2022-08-11 11:16 UTC (permalink / raw)
  To: dts; +Cc: Yaqi Tang

ICE support queue rate limitation configure, and parse the quanta_size for IGP pacing.

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

diff --git a/tests/TestSuite_ice_iavf_packet_pacing.py b/tests/TestSuite_ice_iavf_packet_pacing.py
new file mode 100644
index 00000000..46b8e341
--- /dev/null
+++ b/tests/TestSuite_ice_iavf_packet_pacing.py
@@ -0,0 +1,641 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2010-2022 Intel Corporation
+#
+
+import copy
+import os
+import re
+import time
+from pprint import pformat
+
+from framework.packet import Packet
+from framework.pktgen import PacketGeneratorHelper
+from framework.pmd_output import PmdOutput
+from framework.settings import HEADER_SIZE
+from framework.test_case import TestCase
+from framework.utils import GREEN, RED
+
+
+class IAVFPacketPacingTest(TestCase):
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+        self.verify(
+            self.nic in ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP"],
+            "%s nic not support vf 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.pkt = Packet()
+        self.pmdout = PmdOutput(self.dut)
+
+        self.vf_driver = self.get_suite_cfg()["vf_driver"]
+        if self.vf_driver is None:
+            self.vf_driver = "vfio-pci"
+        self.pf0_intf = self.dut.ports_info[self.dut_ports[0]]["intf"]
+
+        # get dts output path
+        if self.logger.log_path.startswith(os.sep):
+            self.output_path = self.logger.log_path
+        else:
+            cur_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+            self.output_path = os.sep.join([cur_path, self.logger.log_path])
+        # create an instance to set stream field setting
+        self.pktgen_helper = PacketGeneratorHelper()
+        self.path = self.dut.apps_name["test-pmd"]
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        pass
+
+    def launch_testpmd(self, allowlist, line_option=""):
+        """
+        start testpmd
+        """
+        # Prepare testpmd EAL and parameters
+        output = self.pmdout.start_testpmd(
+            socket=self.ports_socket,
+            prefix="tx",
+            eal_param=allowlist,
+            param=line_option,
+        )
+        # test link status
+        res = self.pmdout.wait_link_status_up("all", timeout=15)
+        self.verify(res is True, "there have port link is down")
+        return output
+
+    def close_testpmd(self):
+        self.dut.send_expect("quit", "# ", 30)
+        time.sleep(5)
+
+    def create_vf(self, vf_num):
+        self.dut.bind_interfaces_linux("ice")
+        self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], vf_num)
+        self.sriov_vfs_port = self.dut.ports_info[self.dut_ports[0]]["vfs_port"]
+        self.dut.send_expect("ifconfig %s up" % self.pf0_intf, "# ")
+        if vf_num >= 2:
+            self.dut.send_expect(
+                "ip link set dev %s vf 0 trust on" % self.pf0_intf, "# "
+            )
+            self.dut.send_expect(
+                "ip link set %s vf 1 mac 00:11:22:33:44:55" % self.pf0_intf, "#"
+            )
+            self.vf0_pci = self.sriov_vfs_port[0].pci
+            self.vf1_pci = self.sriov_vfs_port[1].pci
+        else:
+            self.dut.send_expect(
+                "ip link set %s vf 0 mac 00:11:22:33:44:55" % self.pf0_intf, "#"
+            )
+            self.vf0_pci = self.sriov_vfs_port[0].pci
+        try:
+            for port in self.sriov_vfs_port:
+                port.bind_driver(self.vf_driver)
+        except Exception as e:
+            self.destroy_vf()
+            raise Exception(e)
+
+    def destroy_vf(self):
+        self.dut.destroy_sriov_vfs_by_port(self.dut_ports[0])
+        self.dut.send_expect("rmmod ice", "# ", 15)
+        self.dut.send_expect("modprobe ice", "# ", 15)
+
+    def testpmd_query_stats(self):
+        output = self.dut.send_expect("show port stats all", "testpmd> ", 20)
+        self.logger.info(output)
+        if not output:
+            return
+        port_pat = ".*NIC statistics for (port \d+) .*"
+        tx_pat = ".*Tx-pps:\s+(\d+)\s+Tx-bps:\s+(\d+).*"
+        port = re.findall(port_pat, output, re.M)
+        tx = re.findall(tx_pat, output, re.M)
+        if not port or not tx:
+            return
+        stat = {}
+        for port_id, (tx_pps, tx_bps) in zip(port, tx):
+            stat[port_id] = {
+                "tx_pps": float(tx_pps),
+                "tx_bps": float(tx_bps),
+            }
+        self.pmd_stat = stat
+
+    def get_queue_packets_stats(self, port):
+        output = self.dut.send_expect("stop", "testpmd> ")
+        self.logger.info(output)
+        p = re.compile("TX Port= %d/Queue=.*\n.*TX-packets: ([0-9]+)\s" % port)
+        queue_pkts = p.findall(output)
+        queue_pkts = list(map(int, queue_pkts))
+        if not queue_pkts:
+            return {}
+        return queue_pkts
+
+    def is_expected_throughput(self, expected, pmd_stat):
+        _expected, unit, port = expected
+        port = port
+        real_stat = pmd_stat.get(f"port {port}", {})
+        key = "tx_bps"
+        real_bps = real_stat.get(key) or 0
+        if real_bps == 0 and _expected == 0:
+            return True
+        if not _expected:
+            return False
+        bias = 10
+        if unit == "MBps":
+            _bias = 100 * abs((real_bps / 8 / 1e6 - _expected) / _expected)
+            return _bias < bias
+        return True
+
+    def set_fields(self):
+        fields_config = {
+            "ip": {
+                "src": {
+                    "start": "198.18.0.0",
+                    "end": "198.18.0.255",
+                    "step": 1,
+                    "action": "random",
+                },
+            },
+        }
+        return fields_config
+
+    def check_traffic(self, expected, frame_size=64):
+        # create pcap file
+        dmac = "00:11:22:33:44:55"
+        payload_size = frame_size - HEADER_SIZE["ip"] - HEADER_SIZE["eth"]
+        pcap = os.sep.join([self.output_path, "dts0.pcap"])
+        self.tester.scapy_append(
+            'wrpcap("%s", [Ether(dst="%s")/IP(src="198.18.0.0",dst="198.28.0.0")/("X"*%d)])'
+            % (pcap, dmac, payload_size)
+        )
+        self.tester.scapy_execute()
+        tgen_input = []
+        tgen_input.append(
+            (
+                self.tester.get_local_port(self.dut_ports[0]),
+                self.tester.get_local_port(self.dut_ports[0]),
+                "%s" % pcap,
+            )
+        )
+
+        # clear streams before add new streams
+        vm_config = self.set_fields()
+        self.tester.pktgen.clear_streams()
+
+        streams = self.pktgen_helper.prepare_stream_from_tginput(
+            tgen_input, 100, vm_config, self.tester.pktgen
+        )
+        traffic_opt = {
+            "method": "throughput",
+            "duration": 20,
+            "interval": 15,
+            "callback": self.testpmd_query_stats,
+        }
+        results = []
+        result = self.tester.pktgen.measure_throughput(
+            stream_ids=[0], options=traffic_opt
+        )
+
+        pmd_stat = self.pmd_stat
+        status = self.is_expected_throughput(expected, pmd_stat)
+        msg = (
+            f"{pformat(expected)}"
+            " not get expected throughput value, real is: "
+            f"{pformat(pmd_stat)}"
+        )
+        self.verify(status, msg)
+
+        _, _, port = expected
+        queue_pkts = self.get_queue_packets_stats(port)
+        results.append([result, pmd_stat, queue_pkts])
+        return results
+
+    def check_queue_pkts_ratio(self, expected, result):
+        total_pkts = sum(result)
+        total_ratio = sum(expected)
+        ratio = []
+        for idx, result in enumerate(result):
+            percentage = 100 * result / total_pkts
+            ratio.append(percentage)
+        bias = 10
+        for idx, percentage in enumerate(expected):
+            percentage = 100 * percentage / total_ratio
+            _bias = 100 * abs(ratio[idx] - percentage) / percentage
+            self.logger.info((ratio[idx], percentage))
+            if _bias < bias:
+                continue
+            else:
+                msg = "can not get expected queue ratio"
+                self.verify(False, msg)
+
+    def check_output(self, expected, output):
+        if isinstance(expected, str):
+            expected = [expected]
+        for _expected in expected:
+            self.verify(
+                _expected in output, f"expected <{_expected}> message not display"
+            )
+
+    def verify_without_quanta_size_check_peak_tb_rate(self):
+        allowlist = f"-a {self.vf0_pci}"
+        line_option = ""
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 612980769 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (612, "MBps", 0)
+
+        results = self.check_traffic(expected_throughput)
+
+    def verify_single_queue_check_peak_tb_rate(self):
+        allowlist = f"-a {self.vf0_pci},quanta_size=1024"
+        line_option = ""
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 612980769 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (612, "MBps", 0)
+
+        results = self.check_traffic(expected_throughput)
+
+    def verify_multi_queues_check_peak_tb_rate(self):
+        allowlist = f"-a {self.vf0_pci},quanta_size=1024"
+        line_option = "--rxq=8 --txq=8"
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 100000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 2 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 3 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 4 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 5 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 6 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 7 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (800, "MBps", 0)
+        expected_ratio = [1, 1, 1, 1, 1, 1, 1, 1]
+
+        results = self.check_traffic(expected_throughput)
+        self.check_queue_pkts_ratio(expected_ratio, results[-1][-1])
+
+    def verify_modify_quanta_size_check_peak_tb_rate(self):
+        allowlist = f"-a {self.vf0_pci},quanta_size=4096"
+        line_option = "--rxq=8 --txq=8"
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 100000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 2 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 3 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 4 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 5 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 6 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 7 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (800, "MBps", 0)
+        expected_ratio = [1, 1, 1, 1, 1, 1, 1, 1]
+
+        results = self.check_traffic(expected_throughput)
+        self.check_queue_pkts_ratio(expected_ratio, results[-1][-1])
+
+    def verify_multi_queues_with_diff_rate_limit_check_peak_tb_rate(self):
+        allowlist = f"-a {self.vf0_pci},quanta_size=1024"
+        line_option = "--rxq=8 --txq=8"
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 10000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 2 1000000 0 20000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 3 1000000 0 30000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 4 1000000 0 40000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 5 1000000 0 50000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 6 1000000 0 60000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 7 1000000 0 70000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 8 1000000 0 80000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 1 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 2 900 0 1 2 3 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 3 900 0 1 2 4 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 4 900 0 1 2 5 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 5 900 0 1 2 6 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 6 900 0 1 2 7 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 7 900 0 1 2 8 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (360, "MBps", 0)
+        expected_ratio = [1, 2, 3, 4, 5, 6, 7, 8]
+
+        results = self.check_traffic(expected_throughput)
+        self.check_queue_pkts_ratio(expected_ratio, results[-1][-1])
+
+    def verify_port_rate_limit_less_than_queue_rate_limit(self):
+        allowlist = f"-a {self.vf0_pci},cap=dcf -a {self.vf1_pci},quanta_size=1024"
+        line_option = "--rxq=8 --txq=8 --port-topology=loop"
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 100000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 1 2 1000000 0 612980769 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 1 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 1 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 0 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 1 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 2 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 3 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 4 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 5 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 6 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 7 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port tm hierarchy commit 1 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (100, "MBps", 1)
+        expected_ratio = [1, 1, 1, 1, 1, 1, 1, 1]
+
+        results = self.check_traffic(expected_throughput)
+        self.check_queue_pkts_ratio(expected_ratio, results[-1][-1])
+
+    def verify_port_rate_limit_more_than_queue_rate_limit(self):
+        allowlist = f"-a {self.vf0_pci},cap=dcf -a {self.vf1_pci},quanta_size=1024"
+        line_option = "--rxq=8 --txq=8 --port-topology=loop"
+        self.launch_testpmd(allowlist, line_option)
+        self.dut.send_expect("port stop all", "testpmd> ")
+        self.dut.send_expect(
+            "add port tm node shaper profile 0 1 1000000 0 200000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm node shaper profile 1 2 1000000 0 10000000 0 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 0 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 0 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 0 1 900 0 1 2 1 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 1 1000 -1 0 1 0 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm nonleaf node 1 900 1000 0 1 1 -1 1 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 0 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 1 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 2 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 3 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 4 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 5 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 6 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect(
+            "add port tm leaf node 1 7 900 0 1 2 2 0 0xffffffff 0 0", "testpmd> "
+        )
+        self.dut.send_expect("port tm hierarchy commit 0 no", "testpmd> ")
+        self.dut.send_expect("port tm hierarchy commit 1 no", "testpmd> ")
+        self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("set fwd mac", "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+
+        expected_throughput = (80, "MBps", 1)
+        expected_ratio = [1, 1, 1, 1, 1, 1, 1, 1]
+
+        results = self.check_traffic(expected_throughput)
+        self.check_queue_pkts_ratio(expected_ratio, results[-1][-1])
+
+    def test_perf_without_quanta_size_check_peak_tb_rate(self):
+        self.create_vf(vf_num=1)
+        self.verify_without_quanta_size_check_peak_tb_rate()
+
+    def test_perf_single_queue_check_peak_tb_rate(self):
+        self.create_vf(vf_num=1)
+        self.verify_single_queue_check_peak_tb_rate()
+
+    def test_perf_multi_queues_check_peak_tb_rate(self):
+        self.create_vf(vf_num=1)
+        self.verify_multi_queues_check_peak_tb_rate()
+
+    def test_perf_modify_quanta_size_check_peak_tb_rate(self):
+        self.create_vf(vf_num=1)
+        self.verify_modify_quanta_size_check_peak_tb_rate()
+
+    def test_perf_invalid_quanta_size_check_peak_tb_rate(self):
+        self.create_vf(vf_num=1)
+        output = self.launch_testpmd(
+            allowlist=f"-a {self.vf0_pci},quanta_size=1000", line_option=""
+        )
+        expected = "iavf_parse_devargs(): invalid quanta size"
+        self.check_output(expected, output)
+
+    def test_perf_multi_queues_with_diff_rate_limit_check_peak_tb_rate(self):
+        self.create_vf(vf_num=1)
+        self.verify_multi_queues_with_diff_rate_limit_check_peak_tb_rate()
+
+    def test_perf_port_rate_limit_less_than_queue_rate_limit(self):
+        self.create_vf(vf_num=2)
+        self.verify_port_rate_limit_less_than_queue_rate_limit()
+
+    def test_perf_port_rate_limit_more_than_queue_rate_limit(self):
+        self.create_vf(vf_num=2)
+        self.verify_port_rate_limit_more_than_queue_rate_limit()
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        """
+        self.close_testpmd()
+        self.destroy_vf()
+
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
+        self.dut.kill_all()
-- 
2.25.1


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

* RE: [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing
  2022-08-11 11:16 ` [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing Yaqi Tang
@ 2022-08-12  7:40   ` Peng, Yuan
  0 siblings, 0 replies; 8+ messages in thread
From: Peng, Yuan @ 2022-08-12  7:40 UTC (permalink / raw)
  To: Tang, Yaqi, dts; +Cc: Tang, Yaqi

Acked-by: Peng, Yuan <yuan.peng@intel.com>

-----Original Message-----
From: Yaqi Tang <yaqi.tang@intel.com> 
Sent: Thursday, August 11, 2022 7:17 PM
To: dts@dpdk.org
Cc: Tang, Yaqi <yaqi.tang@intel.com>
Subject: [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing

Add new test plan for that ice enable packet pacing for 5G small RAN.

Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>
---


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

* RE: [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: ice enable packet pacing
  2022-08-11 11:16 ` [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: " Yaqi Tang
@ 2022-08-22  7:52   ` Chen, LingliX
  2022-09-14  7:41   ` lijuan.tu
  1 sibling, 0 replies; 8+ messages in thread
From: Chen, LingliX @ 2022-08-22  7:52 UTC (permalink / raw)
  To: dts; +Cc: Tang, Yaqi


> -----Original Message-----
> From: Yaqi Tang <yaqi.tang@intel.com>
> Sent: Thursday, August 11, 2022 7:17 PM
> To: dts@dpdk.org
> Cc: Tang, Yaqi <yaqi.tang@intel.com>
> Subject: [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: ice enable packet
> pacing
> 
> ICE support queue rate limitation configure, and parse the quanta_size for IGP
> pacing.
> 
> Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>

Tested-by: Lingli Chen <linglix.chen@intel.com>

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

* RE: [dts][PATCH V3 2/3] test_plans/ice_iavf_packet_pacing: ice enable packet pacing
  2022-08-11 11:16 ` [dts][PATCH V3 2/3] test_plans/ice_iavf_packet_pacing: ice enable packet pacing Yaqi Tang
@ 2022-08-24  7:56   ` Tu, Lijuan
  0 siblings, 0 replies; 8+ messages in thread
From: Tu, Lijuan @ 2022-08-24  7:56 UTC (permalink / raw)
  To: Tang, Yaqi, dts; +Cc: Tang, Yaqi

> +
> +   Check the TX throughput is 612MBps.
......
> +   Check the TX throughput is 612MBps.
......
> +   Check the TX throughput is 800MBps.
......
> +   Check the TX throughput is 360MBps.

I am confused with these throughput, how to calculate them. What ever the bandwidth of the NICs, are they the same ?

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

* [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: ice enable packet pacing
  2022-08-11 11:16 ` [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: " Yaqi Tang
  2022-08-22  7:52   ` Chen, LingliX
@ 2022-09-14  7:41   ` lijuan.tu
  1 sibling, 0 replies; 8+ messages in thread
From: lijuan.tu @ 2022-09-14  7:41 UTC (permalink / raw)
  To: dts, Yaqi Tang; +Cc: Yaqi Tang

On Thu, 11 Aug 2022 11:16:58 +0000, Yaqi Tang <yaqi.tang@intel.com> wrote:
> ICE support queue rate limitation configure, and parse the quanta_size for IGP pacing.
> 
> Signed-off-by: Yaqi Tang <yaqi.tang@intel.com>


Series applied, thanks

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

end of thread, other threads:[~2022-09-14  7:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 11:16 [PATCH V3 0/3] ice iavf enable packet pacing Yaqi Tang
2022-08-11 11:16 ` [dts][PATCH V3 1/3] test_plans/index: add new test plan for ice_iavf_packet_pacing Yaqi Tang
2022-08-12  7:40   ` Peng, Yuan
2022-08-11 11:16 ` [dts][PATCH V3 2/3] test_plans/ice_iavf_packet_pacing: ice enable packet pacing Yaqi Tang
2022-08-24  7:56   ` Tu, Lijuan
2022-08-11 11:16 ` [dts][PATCH V3 3/3] tests/ice_iavf_packet_pacing: " Yaqi Tang
2022-08-22  7:52   ` Chen, LingliX
2022-09-14  7:41   ` lijuan.tu

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).