test suite reviews and discussions
 help / color / mirror / Atom feed
* RE: [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case
  2021-11-24 10:58 ` [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case Hailin Xu
@ 2021-11-24  3:30   ` Xu, HailinX
  0 siblings, 0 replies; 5+ messages in thread
From: Xu, HailinX @ 2021-11-24  3:30 UTC (permalink / raw)
  To: dts, Fu, Qi

[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

> -----Original Message-----
> From: Xu, HailinX <hailinx.xu@intel.com>
> Sent: Wednesday, November 24, 2021 6:58 PM
> To: dts@dpdk.org; Fu, Qi <qi.fu@intel.com>
> Cc: Xu, HailinX <hailinx.xu@intel.com>
> Subject: [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case
 
Tested-by: Xu Hailin <hailinx.xu@intel.com>

[-- Attachment #2: RSSConfigureTest.log --]
[-- Type: application/octet-stream, Size: 720103 bytes --]

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

* [dts][PATCH v3 0/3] change test plan and test cases
@ 2021-11-24 10:58 Hailin Xu
  2021-11-24 10:58 ` [dts][PATCH v3 1/3] test_plans/cvl_rss_configure: change test plan Hailin Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hailin Xu @ 2021-11-24 10:58 UTC (permalink / raw)
  To: dts, qi.fu; +Cc: Hailin Xu

v1:
change test plan and test cases
v2:
1. Change test plan and test cases
2. Add reason for changing test plan
3. Chenge rss common interface
v3:
1. Change test plan and test cases
2. Add reason for changing test plan
3. Chenge rss common interface
4. Add bind port to dpdk

Hailin Xu (3):
  test_plans/cvl_rss_configure: change test plan
  tests/cvl_rss_configure: change test case
  tests/rte_flow_common: change common interface

 test_plans/cvl_rss_configure_test_plan.rst | 276 ++++---------
 tests/TestSuite_cvl_rss_configure.py       | 437 ++++++++++-----------
 tests/rte_flow_common.py                   |  11 +-
 3 files changed, 286 insertions(+), 438 deletions(-)

-- 
2.17.1


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

* [dts][PATCH v3 1/3] test_plans/cvl_rss_configure: change test plan
  2021-11-24 10:58 [dts][PATCH v3 0/3] change test plan and test cases Hailin Xu
@ 2021-11-24 10:58 ` Hailin Xu
  2021-11-24 10:58 ` [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case Hailin Xu
  2021-11-24 10:58 ` [dts][PATCH v3 3/3] tests/rte_flow_common: change common interface Hailin Xu
  2 siblings, 0 replies; 5+ messages in thread
From: Hailin Xu @ 2021-11-24 10:58 UTC (permalink / raw)
  To: dts, qi.fu; +Cc: Hailin Xu

1. When all/default RSS types are enabled, ip/tcp/udp/sctp types of packets have hash value,
when the input set is changed, the hash value should change.
2. When enable the specified RSS type, packets of matched type have hash,
the packet input set of match type change, the hash value should also change,
while packets of unmatched type have no hash value.
example:
  enable tcp rss, send ipv4/ipv6 tcp packets, these packets have hash value,
  when these packets input set change, hash value should also change.
  when send ip/sctp/udp packets should be no hash value.

Signed-off-by: Hailin Xu <hailinx.xu@intel.com>
---
 test_plans/cvl_rss_configure_test_plan.rst | 276 ++++++---------------
 1 file changed, 69 insertions(+), 207 deletions(-)

diff --git a/test_plans/cvl_rss_configure_test_plan.rst b/test_plans/cvl_rss_configure_test_plan.rst
index eaf15bd0..57c66ba8 100644
--- a/test_plans/cvl_rss_configure_test_plan.rst
+++ b/test_plans/cvl_rss_configure_test_plan.rst
@@ -420,27 +420,7 @@ Test Case: test_RSS_configure_to_udp
     testpmd> port config all rss udp
     testpmd> start
 
-3. check ipv4 packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/("X"*40)], iface="enp27s0f2")
-
-4. check ipv6 packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/("X"*40)], iface="enp27s0f2")
-
-5. check ipv4-udp packets:
+3. check ipv4-udp packets:
    send a basic packet, record the hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
@@ -452,7 +432,7 @@ Test Case: test_RSS_configure_to_udp
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1027)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-6. check ipv6-udp packets:
+4. check ipv6-udp packets:
    send a basic packet, record the hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
@@ -464,66 +444,36 @@ Test Case: test_RSS_configure_to_udp
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1027)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-7. check ipv4-tcp packets:
-   send a basic packet, record the hash value::
+5. check ipv4 packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
+6. check ipv6 packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
 
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
+7. check ipv4-tcp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
 8. check ipv6-tcp packets:
-   send a basic packet, record the hash value::
+   send a basic packet, verify no hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
 9. check ipv4-sctp packets:
-   send a basic packet, record the hash value::
+   send a basic packet, verify no hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
 10. check ipv6-sctp packets:
-    send a basic packet, record the hash value::
+   send a basic packet, verify no hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
 Test Case: test_RSS_configure_to_tcp
 ====================================
 
@@ -538,57 +488,7 @@ Test Case: test_RSS_configure_to_tcp
     testpmd> port config all rss tcp
     testpmd> start
 
-3. check ipv4 packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/("X"*40)], iface="enp27s0f2")
-
-4. check ipv6 packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/("X"*40)], iface="enp27s0f2")
-
-5. check ipv4-udp packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
-6. check ipv6-udp packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
-7. check ipv4-tcp packets:
+3. check ipv4-tcp packets:
    send a basic packet, record the hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
@@ -600,7 +500,7 @@ Test Case: test_RSS_configure_to_tcp
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1027)/("X"*40)], iface="enp27s0f2")
 
-8. check ipv6-tcp packets:
+4. check ipv6-tcp packets:
    send a basic packet, record the hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
@@ -612,35 +512,35 @@ Test Case: test_RSS_configure_to_tcp
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1027)/("X"*40)], iface="enp27s0f2")
 
-9. check ipv4-sctp packets:
-   send a basic packet, record the hash value::
+5. check ipv4 packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
+6. check ipv6 packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
 
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
+7. check ipv4-udp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-10. check ipv6-sctp packets:
-    send a basic packet, record the hash value::
+8. check ipv6-udp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
+9. check ipv4-sctp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
+10. check ipv6-sctp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
 Test Case: test_RSS_configure_to_sctp
 =====================================
@@ -656,105 +556,59 @@ Test Case: test_RSS_configure_to_sctp
     testpmd> port config all rss sctp
     testpmd> start
 
-3. check ipv4 packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/("X"*40)], iface="enp27s0f2")
-
-4. check ipv6 packets:
+3. check ipv4-sctp packets:
    send a basic packet, record the hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
    send packets with changed input set, check the received packets have different hash value with the basic packet::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1026)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-5. check ipv4-udp packets:
-   send a basic packet, record the hash value::
+4. check ipv6-sctp packets:
+    send a basic packet, record the hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
    send packets with changed input set, check the received packets have different hash value with the basic packet::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
-6. check ipv6-udp packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1026)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
+5. check ipv4 packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/("X"*40)], iface="enp27s0f2")
 
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
+6. check ipv6 packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/("X"*40)], iface="enp27s0f2")
 
 7. check ipv4-tcp packets:
-   send a basic packet, record the hash value::
+   send a basic packet, verify no hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/TCP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
 8. check ipv6-tcp packets:
-   send a basic packet, record the hash value::
+   send a basic packet, verify no hash value::
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/TCP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send a packet with same input set and changed other parameters.
-   check the received packet have same hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/TCP(sport=1026,dport=1027)/("X"*40)], iface="enp27s0f2")
-
-9. check ipv4-sctp packets:
-   send a basic packet, record the hash value::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
-
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-
-10. check ipv6-sctp packets:
-    send a basic packet, record the hash value::
+9. check ipv4-udp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
-   send packets with changed input set, check the received packets have different hash value with the basic packet::
+10. check ipv6-udp packets:
+   send a basic packet, verify no hash value::
 
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
-        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/UDP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
 
 Test Case: test_RSS_configure_to_all
 ====================================
@@ -847,6 +701,8 @@ Test Case: test_RSS_configure_to_all
 
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1026)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
 10. check ipv6-sctp packets:
     send a basic packet, record the hash value::
@@ -857,6 +713,8 @@ Test Case: test_RSS_configure_to_all
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1026)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
 Test Case: test_RSS_configure_to_default
 ========================================
@@ -949,6 +807,8 @@ Test Case: test_RSS_configure_to_default
 
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.4",dst="192.168.0.3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1024,dport=1026)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2",dst="192.168.0.3")/SCTP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
 
 10. check ipv6-sctp packets:
     send a basic packet, record the hash value::
@@ -959,3 +819,5 @@ Test Case: test_RSS_configure_to_default
 
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::4",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
         sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::5")/SCTP(sport=1024,dport=1025)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1024,dport=1026)/("X"*40)], iface="enp27s0f2")
+        sendp([Ether(dst="00:00:00:00:01:00")/IPv6(src="3ffe:2501:200:3::2",dst="3ffe:2501:200:3::3")/SCTP(sport=1026,dport=1025)/("X"*40)], iface="enp27s0f2")
-- 
2.17.1


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

* [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case
  2021-11-24 10:58 [dts][PATCH v3 0/3] change test plan and test cases Hailin Xu
  2021-11-24 10:58 ` [dts][PATCH v3 1/3] test_plans/cvl_rss_configure: change test plan Hailin Xu
@ 2021-11-24 10:58 ` Hailin Xu
  2021-11-24  3:30   ` Xu, HailinX
  2021-11-24 10:58 ` [dts][PATCH v3 3/3] tests/rte_flow_common: change common interface Hailin Xu
  2 siblings, 1 reply; 5+ messages in thread
From: Hailin Xu @ 2021-11-24 10:58 UTC (permalink / raw)
  To: dts, qi.fu; +Cc: Hailin Xu

1. Change code to support rss common interface and adapt to test plan.
2. Change packet checkpoint from queue to hash value.

Signed-off-by: Hailin Xu <hailinx.xu@intel.com>
---
 tests/TestSuite_cvl_rss_configure.py | 437 +++++++++++++--------------
 1 file changed, 211 insertions(+), 226 deletions(-)

diff --git a/tests/TestSuite_cvl_rss_configure.py b/tests/TestSuite_cvl_rss_configure.py
index 1c4ffbfc..e0dbd420 100644
--- a/tests/TestSuite_cvl_rss_configure.py
+++ b/tests/TestSuite_cvl_rss_configure.py
@@ -29,166 +29,192 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import json
-import os
-import re
 import time
-from collections import OrderedDict
-
-from scapy.contrib.gtp import *
-
-import framework.packet as packet
-import tests.rte_flow_common as rfc
-from framework.packet import IncreaseIP, IncreaseIPv6
-from framework.pmd_output import PmdOutput
 from framework.test_case import TestCase
-from framework.utils import BLUE, RED
-
-out = os.popen("pip list|grep scapy ")
-version_result =out.read()
-p=re.compile('scapy\s+2\.3\.\d+')
-m=p.search(version_result)
-
-tv_mac_ip_ipv4 = {
-    "name":"tv_mac_ip_ipv4",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/("X"*480)' %(i, i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ip_ipv6 = {
-    "name":"tv_mac_ip_ipv6",
-    "scapy_str": ['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::%d", dst="2001::%d")/("X"*480)' %(i, i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv4_udp_l3_random = {
-    "name":"tv_mac_ipv4_udp_l3_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP()/("X"*480)' %(i,i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv4_udp_l4_random = {
-    "name":"tv_mac_ipv4_udp_l4_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IP()/UDP(sport=%d, dport=%d)/("X"*480)' %(i+50,i+55) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv6_udp_l3_random = {
-    "name":"tv_mac_ipv6_udp_l3_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::%d", dst="2001::%d")/UDP()/("X"*480)' %(i,i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv6_udp_l4_random = {
-    "name":"tv_mac_ipv6_udp_l4_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IPv6()/UDP(sport=%d, dport=%d)/("X"*480)' %(i+50,i+55) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv4_tcp_l3_random = {
-    "name":"tv_mac_ipv4_tcp_l3_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP()/("X"*480)' %(i,i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv4_tcp_l4_random = {
-    "name":"tv_mac_ipv4_tcp_l4_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IP()/TCP(sport=%d, dport=%d)/("X"*480)' %(i+50,i+55) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
-}
-
-tv_mac_ipv6_tcp_l3_random = {
-    "name":"tv_mac_ipv6_tcp_l3_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::%d", dst="2001::%d")/TCP()/("X"*480)' %(i,i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
+from framework.pmd_output import PmdOutput
+from framework import packet
+from .rte_flow_common import RssProcessing
+
+mac_ipv4_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*480)'
+mac_ipv6_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::3")/("X"*480)'
+mac_ipv4_tcp_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=1026, dport=1027)/("X"*480)'
+mac_ipv6_tcp_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::3")/TCP(sport=1026, dport=1027)/("X"*480)'
+mac_ipv4_udp_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1026, dport=1027)/("X"*480)'
+mac_ipv6_udp_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::3")/UDP(sport=1026, dport=1027)/("X"*480)'
+mac_ipv4_sctp_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.3")/SCTP(sport=1026, dport=1027)/("X"*480)'
+mac_ipv6_sctp_basic_pkt = 'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::3")/TCP(sport=1026, dport=1027)/("X"*480)'
+
+mac_ipv4_changed_pkt = ['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.5")/("X"*480)',
+                        'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.5", dst="192.168.0.3")/("X"*480)']
+
+mac_ipv6_changed_pkt = ['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::5")/("X"*480)',
+                        'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::5", dst="2001::3")/("X"*480)']
+
+mac_ipv4_tcp_changed_l3_pkt = ['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.5")/TCP(sport=1026, dport=1027)/("X"*480)',
+                               'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.5", dst="192.168.0.3")/TCP(sport=1026, dport=1027)/("X"*480)']
+
+mac_ipv4_tcp_changed_l4_pkt = ['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=1025, dport=1027)/("X"*480)',
+                               'Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=1026, dport=1025)/("X"*480)']
+
+mac_ipv6_tcp_changed_l3_pkt = ['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::5")/TCP(sport=1026, dport=1027)/("X"*480)',
+                               'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::5", dst="2001::3")/TCP(sport=1026, dport=1027)/("X"*480)']
+
+mac_ipv6_tcp_changed_l4_pkt = ['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::3")/TCP(sport=1025, dport=1027)/("X"*480)',
+                               'Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::2", dst="2001::3")/TCP(sport=1026, dport=1025)/("X"*480)']
+
+mac_ipv4_udp_changed_l3_pkt = [sv.replace("/TCP", "/UDP") for sv in mac_ipv4_tcp_changed_l3_pkt]
+mac_ipv4_udp_changed_l4_pkt = [sv.replace("/TCP", "/UDP") for sv in mac_ipv4_tcp_changed_l4_pkt]
+
+mac_ipv6_udp_changed_l3_pkt = [sv.replace("/TCP", "/UDP") for sv in mac_ipv6_tcp_changed_l3_pkt]
+mac_ipv6_udp_changed_l4_pkt = [sv.replace("/TCP", "/UDP") for sv in mac_ipv6_tcp_changed_l4_pkt]
+
+mac_ipv4_sctp_changed_l3_pkt = [sv.replace("/TCP", "/SCTP") for sv in mac_ipv4_tcp_changed_l3_pkt]
+mac_ipv4_sctp_changed_l4_pkt = [sv.replace("/TCP", "/SCTP") for sv in mac_ipv4_tcp_changed_l4_pkt]
+
+mac_ipv6_sctp_changed_l3_pkt = [sv.replace("/TCP", "/SCTP") for sv in mac_ipv6_tcp_changed_l3_pkt]
+mac_ipv6_sctp_changed_l4_pkt = [sv.replace("/TCP", "/SCTP") for sv in mac_ipv6_tcp_changed_l4_pkt]
+
+command_line_option_rss_ip = {
+    'sub_casename': 'command_line_option_rss_ip',
+    'port_id': 0,
+    'test': [
+        {'send_packet': mac_ipv4_basic_pkt,
+         'action': {'save_hash': 'ip-ipv4'}},
+        {'send_packet': mac_ipv4_changed_pkt,
+         'action': {'check_hash_different': 'ip-ipv4'}},
+        {'send_packet': mac_ipv6_basic_pkt,
+         'action': {'save_hash': 'ip-ipv6'}},
+        {'send_packet': mac_ipv6_changed_pkt,
+         'action': {'check_hash_different': 'ip-ipv4'}},
+        # ipv4/ipv6 tcp
+        {'send_packet': mac_ipv4_tcp_basic_pkt,
+         'action': {'save_hash': 'ipv4-tcp'}},
+        {'send_packet': mac_ipv4_tcp_changed_l3_pkt,
+         'action': {'check_hash_different': 'ipv4-tcp'}},
+        {'send_packet': mac_ipv4_tcp_changed_l4_pkt,
+         'action': {'check_hash_same': 'ipv4-tcp'}},
+        {'send_packet': mac_ipv6_tcp_basic_pkt,
+         'action': {'save_hash': 'ipv6-tcp'}},
+        {'send_packet': mac_ipv6_tcp_changed_l3_pkt,
+         'action': {'check_hash_different': 'ipv6-tcp'}},
+        {'send_packet': mac_ipv6_tcp_changed_l4_pkt,
+         'action': {'check_hash_same': 'ipv6-tcp'}},
+        # ipv4/ipv6 udp
+        {'send_packet': mac_ipv4_udp_basic_pkt,
+         'action': {'save_hash': 'ipv4-udp'}},
+        {'send_packet': mac_ipv4_udp_changed_l3_pkt,
+         'action': {'check_hash_different': 'ipv4-udp'}},
+        {'send_packet': mac_ipv4_udp_changed_l4_pkt,
+         'action': {'check_hash_same': 'ipv4-udp'}},
+        {'send_packet': mac_ipv6_udp_basic_pkt,
+         'action': {'save_hash': 'ipv6-udp'}},
+        {'send_packet': mac_ipv6_udp_changed_l3_pkt,
+         'action': {'check_hash_different': 'ipv6-udp'}},
+        {'send_packet': mac_ipv6_udp_changed_l4_pkt,
+         'action': {'check_hash_same': 'ipv6-udp'}},
+        # ipv4/ipv6 sctp
+        {'send_packet': mac_ipv4_sctp_basic_pkt,
+         'action': {'save_hash': 'ipv4-sctp'}},
+        {'send_packet': mac_ipv4_sctp_changed_l3_pkt,
+         'action': {'check_hash_different': 'ipv4-sctp'}},
+        {'send_packet': mac_ipv4_sctp_changed_l4_pkt,
+         'action': {'check_hash_same': 'ipv4-sctp'}},
+        {'send_packet': mac_ipv6_sctp_basic_pkt,
+         'action': {'save_hash': 'ipv6-sctp'}},
+        {'send_packet': mac_ipv6_sctp_changed_l3_pkt,
+         'action': {'check_hash_different': 'ipv6-sctp'}},
+        {'send_packet': mac_ipv6_sctp_changed_l4_pkt,
+         'action': {'check_hash_same': 'ipv6-sctp'}}
+    ]
 }
 
-tv_mac_ipv6_tcp_l4_random = {
-    "name":"tv_mac_ipv6_tcp_l4_random",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IPv6()/TCP(sport=%d, dport=%d)/("X"*480)' %(i+50,i+55) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
+command_line_option_rss_udp = {
+    'sub_casename': 'command_line_option_rss_udp',
+    'port_id': 0,
+    'test': [
+    # ipv4/ipv6 udp
+    {'send_packet': mac_ipv4_udp_basic_pkt,
+     'action': {'save_hash': 'ipv4-udp'}},
+    {'send_packet': mac_ipv4_udp_changed_l3_pkt,
+     'action': {'check_hash_different': 'ipv4-udp'}},
+    {'send_packet': mac_ipv4_udp_changed_l4_pkt,
+     'action': {'check_hash_different': 'ipv4-udp'}},
+    {'send_packet': mac_ipv6_udp_basic_pkt,
+     'action': {'save_hash': 'ipv6-udp'}},
+    {'send_packet': mac_ipv6_udp_changed_l3_pkt,
+     'action': {'check_hash_different': 'ipv6-udp'}},
+    {'send_packet': mac_ipv6_udp_changed_l4_pkt,
+     'action': {'check_hash_different': 'ipv6-udp'}},
+    # ipv4/ipv6 tcp/sctp
+    {'send_packet': mac_ipv4_basic_pkt,
+     'action': {'check_no_hash': 'ip-ipv4'}},
+    {'send_packet': mac_ipv6_basic_pkt,
+     'action': {'check_no_hash': 'ip-ipv6'}},
+    {'send_packet': mac_ipv4_tcp_basic_pkt,
+     'action': {'check_no_hash': 'ipv4-tcp'}},
+    {'send_packet': mac_ipv6_tcp_basic_pkt,
+     'action': {'check_no_hash': 'ipv6-tcp'}},
+    {'send_packet': mac_ipv4_sctp_basic_pkt,
+     'action': {'check_no_hash': 'ipv4-sctp'}},
+    {'send_packet': mac_ipv6_sctp_basic_pkt,
+     'action': {'check_no_hash': 'ipv6-sctp'}},
+    ]
 }
 
-tv_mac_ipv4_sctp = {
-    "name":"tv_mac_ipv4_sctp",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/SCTP()/("X"*480)' %(i,i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
+command_line_option_disable_rss = {
+    'sub_casename': 'command_line_option_disable',
+    'port_id': 0,
+    'test': [
+    # all
+    {'send_packet': mac_ipv4_basic_pkt,
+     'action': {'check_no_hash': 'ip-ipv4'}},
+    {'send_packet': mac_ipv4_basic_pkt,
+     'action': {'check_no_hash': 'ip-ipv6'}},
+    {'send_packet': mac_ipv4_tcp_basic_pkt,
+     'action': {'check_no_hash': 'ipv4-tcp'}},
+    {'send_packet': mac_ipv6_tcp_basic_pkt,
+     'action': {'check_no_hash': 'ipv6-tcp'}},
+    {'send_packet': mac_ipv4_udp_basic_pkt,
+     'action': {'check_no_hash': 'ipv4-udp'}},
+    {'send_packet': mac_ipv6_udp_basic_pkt,
+     'action': {'check_no_hash': 'ipv6-udp'}},
+    {'send_packet': mac_ipv4_sctp_basic_pkt,
+     'action': {'check_no_hash': 'ipv4-sctp'}},
+    {'send_packet': mac_ipv6_sctp_basic_pkt,
+     'action': {'check_no_hash': 'ipv6-sctp'}},
+    ]
 }
 
-tv_mac_ipv6_sctp = {
-    "name":"tv_mac_ipv6_sctp",
-    "scapy_str":['Ether(dst="00:00:00:00:01:00")/IPv6(src="2001::%d", dst="2001::%d")/SCTP()/("X"*480)' %(i,i+10) for i in range(0,100)],
-    "check_func_param": {"expect_port":0}
+rss_configure_to_ip = {
+    'sub_casename': 'rss_configure_to_ip',
+    'port_id': 0,
+    'test': command_line_option_rss_ip['test']
 }
 
-tvs_mac_rss_ip = [
-    tv_mac_ip_ipv4,
-    tv_mac_ip_ipv6
-    ]
-
-tvs_mac_rss_l3 = [
-    tv_mac_ip_ipv4,
-    tv_mac_ip_ipv6,
-    tv_mac_ipv4_udp_l3_random,
-    tv_mac_ipv6_udp_l3_random,
-    tv_mac_ipv4_tcp_l3_random,
-    tv_mac_ipv6_tcp_l3_random,
-    tv_mac_ipv4_sctp,
-    tv_mac_ipv6_sctp
-    ]
-
-tvs_mac_rss_l4 = [
-    tv_mac_ipv4_udp_l4_random,
-    tv_mac_ipv6_udp_l4_random,
-    tv_mac_ipv4_tcp_l4_random,
-    tv_mac_ipv6_tcp_l4_random
-    ]
-
-tvs_mac_rss_udp = [
-    tv_mac_ipv4_udp_l3_random,
-    tv_mac_ipv4_udp_l4_random,
-    tv_mac_ipv6_udp_l3_random,
-    tv_mac_ipv6_udp_l4_random
-    ]
-
-tvs_mac_rss_udp_l4 = [
-    tv_mac_ipv4_udp_l4_random,
-    tv_mac_ipv6_udp_l4_random
-    ]
-
-tvs_mac_rss_tcp = [
-    tv_mac_ipv4_tcp_l3_random,
-    tv_mac_ipv4_tcp_l4_random,
-    tv_mac_ipv6_tcp_l3_random,
-    tv_mac_ipv6_tcp_l4_random
-    ]
+rss_configure_to_udp = eval(str(command_line_option_rss_udp)
+                            .replace("command_line_option_rss_udp", "rss_configure_to_udp"))
 
-tvs_mac_rss_tcp_l4 = [
-    tv_mac_ipv4_tcp_l4_random,
-    tv_mac_ipv6_tcp_l4_random
-    ]
+rss_configure_to_tcp = eval(str(rss_configure_to_udp).replace("to_udp", "to_tcp")
+                            .replace("/UDP", "/UDP1")
+                            .replace("-udp", "-udp1")
+                            .replace("/TCP", "/UDP")
+                            .replace("-tcp", "-udp")
+                            .replace("/UDP1", "/TCP")
+                            .replace("-udp1", "-tcp"))
 
-tvs_mac_rss_sctp = [
-    tv_mac_ipv4_sctp,
-    tv_mac_ipv6_sctp
-    ]
+rss_configure_to_sctp = eval(str(rss_configure_to_udp).replace("to_udp", "to_sctp")
+                             .replace("/UDP", "/UDP1")
+                             .replace("-udp", "-udp1")
+                             .replace("/SCTP", "/UDP")
+                             .replace("-sctp", "-udp")
+                             .replace("/UDP1", "/SCTP")
+                             .replace("-udp1", "-sctp"))
 
-tvs_mac_rss_all = [
-    tv_mac_ip_ipv4,
-    tv_mac_ip_ipv6,
-    tv_mac_ipv4_udp_l3_random,
-    tv_mac_ipv4_udp_l4_random,
-    tv_mac_ipv6_udp_l3_random,
-    tv_mac_ipv6_udp_l4_random,
-    tv_mac_ipv4_tcp_l3_random,
-    tv_mac_ipv4_tcp_l4_random,
-    tv_mac_ipv6_tcp_l3_random,
-    tv_mac_ipv6_tcp_l4_random,
-    tv_mac_ipv4_sctp,
-    tv_mac_ipv6_sctp
-    ]
+rss_configure_to_all = eval(str(command_line_option_rss_ip).replace("to_udp", "to_all")
+                            .replace("check_hash_same", "check_hash_different"))
 
-test_results = OrderedDict()
+rss_configure_to_default = eval(str(command_line_option_rss_ip).replace("to_udp", "to_all")
+                                .replace("check_hash_same", "check_hash_different"))
 
 class RSSConfigureTest(TestCase):
 
@@ -198,6 +224,7 @@ class RSSConfigureTest(TestCase):
         Generic filter Prerequistites
         """
         self.dut_ports = self.dut.get_ports(self.nic)
+        self.dut.bind_interfaces_linux(self.drivername)
         # Verify that enough ports are available
         self.verify(len(self.dut_ports) >= 1, "Insufficient ports")
         #self.cores = "1S/8C/1T"
@@ -209,108 +236,66 @@ class RSSConfigureTest(TestCase):
         self.pf_mac = self.dut.get_mac_address(0)
         self.pf_pci = self.dut.ports_info[self.dut_ports[0]]['pci']
         self.verify(self.nic in ["columbiaville_25g","columbiaville_100g"], "%s nic not support ethertype filter" % self.nic)
+        self.rsspro = RssProcessing(self, self.pmdout, [self.__tx_iface], rxq=16)
 
     def set_up(self):
         """
         Run before each test case.
         """
-        self.dut.kill_all()
-
-    def tear_down(self):
-        """
-        Run after each test case.
-        """
-        self.dut.kill_all()
-    
-    def tear_down_all(self):
-        """
-        Run after each test suite.
-        """
-        self.dut.kill_all()
+        pass
 
-    def create_testpmd_command(self, line_option):
-        """
-        Create testpmd command for non-pipeline mode
-        """
-        #Prepare testpmd EAL and parameters 
-        all_eal_param = self.dut.create_eal_parameters(ports=[self.pf_pci])
-        print(all_eal_param)   #print eal parameters
-        command = self.dut.apps_name['test-pmd'] + all_eal_param + " -- -i --rxq=10 --txq=10" + line_option
-        return command
-
-    def _rss_validate_pattern(self, test_vectors, command, rss_type, is_rss):
-
-        global test_results
-        out = self.dut.send_expect(command, "testpmd> ", 120)
-        self.logger.debug(out)  #print the log
-        self.dut.send_expect("set fwd rxonly", "testpmd> ", 15)
-        self.dut.send_expect("set verbose 1", "testpmd> ", 15)
+    def launch_testpmd(self, line_option="", rss_type=""):
+        self.pmdout.start_testpmd(ports=[self.pf_pci], param="--rxq=16 --txq=16 " + line_option)
+        self.pmdout.execute_cmd("set fwd rxonly")
+        self.pmdout.execute_cmd("set verbose 1")
         if rss_type != "":
-            self.dut.send_expect("port config all rss %s" % rss_type, "testpmd> ", 15)
-
-        test_results.clear()
-        self.count = 1
-        self.mac_count=100
-        for tv in test_vectors:
-            self.dut.send_expect("start", "testpmd> ", 15)
-            time.sleep(2)
-            tv["check_func_param"]["expect_port"] = self.dut_ports[0]
-            print("expect_port is", self.dut_ports[0])
-
-            #send a packet
-            pkt = packet.Packet()
-            pkt.update_pkt(tv["scapy_str"])
-            pkt.send_pkt(self.tester, tx_port=self.__tx_iface, count=self.count)
-
-            out = self.dut.send_expect("stop", "testpmd> ",60)
-            print(out)
-            check_result = []
-            check_result = rfc.check_packets_of_each_queue(out)
-            self.verify(check_result[0] == is_rss, check_result[1])
-
-        self.dut.send_expect("quit", "#")
+            self.pmdout.execute_cmd("port config all rss %s" % rss_type)
+        self.pmdout.execute_cmd("start")
 
     def test_command_line_option_rss_ip(self):
-        command = self.create_testpmd_command(line_option = " --rss-ip")
-        self._rss_validate_pattern(tvs_mac_rss_l3, command, rss_type = "", is_rss = True)
-        self._rss_validate_pattern(tvs_mac_rss_l4, command, rss_type = "", is_rss = False)
+        self.launch_testpmd(line_option="--rss-ip")
+        self.rsspro.handle_rss_distribute_cases(command_line_option_rss_ip)
 
     def test_command_line_option_rss_udp(self):
-        command = self.create_testpmd_command(line_option = " --rss-udp")
-        self._rss_validate_pattern(tvs_mac_rss_udp, command, rss_type = "", is_rss = True)
-        self._rss_validate_pattern(tvs_mac_rss_ip, command, rss_type = "", is_rss = False)
-        self._rss_validate_pattern(tvs_mac_rss_tcp, command, rss_type = "", is_rss = False)
-        self._rss_validate_pattern(tvs_mac_rss_sctp, command, rss_type = "", is_rss = False)
+        self.launch_testpmd(line_option="--rss-udp")
+        self.rsspro.handle_rss_distribute_cases(command_line_option_rss_udp)
 
     def test_command_line_option_rss_disable(self):
-        command = self.create_testpmd_command(line_option = " --disable-rss")
-        self._rss_validate_pattern(tvs_mac_rss_all, command, rss_type = "", is_rss = False)
+        self.launch_testpmd(line_option="--disable-rss")
+        self.rsspro.handle_rss_distribute_cases(command_line_option_disable_rss)
 
     def test_rss_configure_to_ip(self):
-        command = self.create_testpmd_command(line_option = "")
-        self._rss_validate_pattern(tvs_mac_rss_l3, command, rss_type = "", is_rss = True)
-        self._rss_validate_pattern(tvs_mac_rss_l4, command, rss_type = "", is_rss = False)
+        self.launch_testpmd(rss_type="ip")
+        self.rsspro.handle_rss_distribute_cases(rss_configure_to_ip)
 
     def test_rss_configure_to_udp(self):
-        command = self.create_testpmd_command(line_option = "")
-        self._rss_validate_pattern(tvs_mac_rss_udp, command, rss_type = "udp", is_rss = True)
-        self._rss_validate_pattern(tvs_mac_rss_tcp_l4, command, rss_type = "udp", is_rss = False)
+        self.launch_testpmd(rss_type="udp")
+        self.rsspro.handle_rss_distribute_cases(rss_configure_to_udp)
 
     def test_rss_configure_to_tcp(self):
-        command = self.create_testpmd_command(line_option = "")
-        self._rss_validate_pattern(tvs_mac_rss_tcp, command, rss_type = "tcp", is_rss = True)
-        self._rss_validate_pattern(tvs_mac_rss_udp_l4, command, rss_type = "tcp", is_rss = False)
+        self.launch_testpmd(rss_type="tcp")
+        self.rsspro.handle_rss_distribute_cases(rss_configure_to_tcp)
 
     def test_rss_configure_to_sctp(self):
-        command = self.create_testpmd_command(line_option = "")
-        self._rss_validate_pattern(tvs_mac_rss_sctp, command, rss_type = "sctp", is_rss = True)
-        self._rss_validate_pattern(tvs_mac_rss_udp_l4, command, rss_type = "sctp", is_rss = False)
-        self._rss_validate_pattern(tvs_mac_rss_tcp_l4, command, rss_type = "sctp", is_rss = False)
+        self.launch_testpmd(rss_type="sctp")
+        self.rsspro.handle_rss_distribute_cases(rss_configure_to_sctp)
 
     def test_rss_configure_to_all(self):
-        command = self.create_testpmd_command(line_option = "")
-        self._rss_validate_pattern(tvs_mac_rss_all, command, rss_type = "all", is_rss = True)
+        self.launch_testpmd(rss_type="all")
+        self.rsspro.handle_rss_distribute_cases(rss_configure_to_all)
 
     def test_rss_configure_to_default(self):
-        command = self.create_testpmd_command(line_option = "")
-        self._rss_validate_pattern(tvs_mac_rss_all, command, rss_type = "default", is_rss = True)
+        self.launch_testpmd(rss_type="default")
+        self.rsspro.handle_rss_distribute_cases(rss_configure_to_default)
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        """
+        self.pmdout.execute_cmd("quit", "# ")
+
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
+        self.dut.kill_all()
-- 
2.17.1


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

* [dts][PATCH v3 3/3] tests/rte_flow_common: change common interface
  2021-11-24 10:58 [dts][PATCH v3 0/3] change test plan and test cases Hailin Xu
  2021-11-24 10:58 ` [dts][PATCH v3 1/3] test_plans/cvl_rss_configure: change test plan Hailin Xu
  2021-11-24 10:58 ` [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case Hailin Xu
@ 2021-11-24 10:58 ` Hailin Xu
  2 siblings, 0 replies; 5+ messages in thread
From: Hailin Xu @ 2021-11-24 10:58 UTC (permalink / raw)
  To: dts, qi.fu; +Cc: Hailin Xu

change rss common interface: support hash verify when send multiple packets

Signed-off-by: Hailin Xu <hailinx.xu@intel.com>
---
 tests/rte_flow_common.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py
index fb76bf86..969d3222 100644
--- a/tests/rte_flow_common.py
+++ b/tests/rte_flow_common.py
@@ -804,11 +804,12 @@ class RssProcessing(object):
                 self.logger.error(error_msg)
                 self.error_msgs.append(error_msg)
         else:
-            if hashes != self.hash_records[key]:
-                error_msg = 'hash value {} should be same ' \
-                            'with {} {}'.format(hashes, key, self.hash_records[key])
-                self.logger.error(error_msg)
-                self.error_msgs.append(error_msg)
+            for hash in hashes:
+                if hash not in self.hash_records[key]:
+                    error_msg = 'hash value {} should be same ' \
+                                'with {} {}'.format(hashes, key, self.hash_records[key])
+                    self.logger.error(error_msg)
+                    self.error_msgs.append(error_msg)
         if not rss_distribute:
             error_msg = 'the packet do not distribute by rss'
             self.logger.error(error_msg)
-- 
2.17.1


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

end of thread, other threads:[~2021-11-24  3:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 10:58 [dts][PATCH v3 0/3] change test plan and test cases Hailin Xu
2021-11-24 10:58 ` [dts][PATCH v3 1/3] test_plans/cvl_rss_configure: change test plan Hailin Xu
2021-11-24 10:58 ` [dts][PATCH v3 2/3] tests/cvl_rss_configure: change test case Hailin Xu
2021-11-24  3:30   ` Xu, HailinX
2021-11-24 10:58 ` [dts][PATCH v3 3/3] tests/rte_flow_common: change common interface Hailin Xu

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git