test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2 1/2] add fdir test case in plan
@ 2017-03-01  2:16 xu,huilong
  2017-03-01  2:16 ` [dts] [PATCH V2 2/2] add fdir test code for new case xu,huilong
  2017-03-08  7:53 ` [dts] [PATCH V2 1/2] add fdir test case in plan Liu, Yong
  0 siblings, 2 replies; 5+ messages in thread
From: xu,huilong @ 2017-03-01  2:16 UTC (permalink / raw)
  To: dts; +Cc: xu,huilong

update list:
1. Add url for fdir cmdline describe
2. Expand Flow Director for fortville to support ipv4 TOS, ipv4 PROTO, ipv4 TTL and ipv6 tc, ipv6 next-header, ipv6 hop-limits and ivlan

Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
 test_plans/fdir_test_plan.rst | 366 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 365 insertions(+), 1 deletion(-)

diff --git a/test_plans/fdir_test_plan.rst b/test_plans/fdir_test_plan.rst
index 95a2926..3bbdfeb 100644
--- a/test_plans/fdir_test_plan.rst
+++ b/test_plans/fdir_test_plan.rst
@@ -77,7 +77,7 @@ be given but other fields must be as shown::
     IP(src="192.168.0.1", dst="192.168.0.2")/GRE(proto=0xff)/IP()/UDP()
 
 The test commands below assume that port 0 on the DUT is the port that is
-connected to the traffic generator. If this is not the case, the following
+connected to the traffic generator. All fdir cmdline please see doc on http://www.dpdk.org/doc/guides/testpmd_app_ug/testpmd_funcs.html#filter-functions.  If this is not the case, the following
 ``testpmd`` commands must be changed, and also the ``--portmask`` parameter.
 
   * ``show port fdir <port>``
@@ -684,3 +684,367 @@ and then to 0x0017. The packets should still match the filter:::
   PKT_RX_PKT_RX_FDIR
   PKT_RX_IP_CKSUM
   PKT_RX_IPV4_HDR
+
+ 
+Test Case : test with ipv4 TOS, PROTO, TTL
+===========================================
+
+1) start testpmd and initialize flow director flex payload configuration::
+
+  ./testpmd -c fffff -n 4 -- -i --disable-rss --pkt-filter-mode=perfect --rxq=8 --txq=8 --nb-cores=8
+  testpmd> port stop 0
+  testpmd> flow_director_flex_payload 0 l2 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_payload 0 l3 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_payload 0 l4 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_mask 0 flow all (0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff)
+  testpmd> port start 0
+  testpmd> set verbose 1
+  testpmd> set fwd rxonly
+  testpmd> start
+
+Note::
+  assume FLEXBYTES = "0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88"
+  assume payload = "\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88"
+
+2) setup the fdir input set of IPv4::
+
+  testpmd> set_fdir_input_set 0 ipv4-other none select
+  testpmd> set_fdir_input_set 0 ipv4-other src-ipv4 add
+  testpmd> set_fdir_input_set 0 ipv4-other dst-ipv4 add
+
+3) add ipv4-tos to fdir input set, set tos to 16 and 8::
+
+  testpmd> set_fdir_input_set 0 ipv4-other ipv4-tos add
+  setup flow director filter rules,
+
+rule_1::
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 16 proto 255 ttl 255 vlan 0 \
+  flexbytes (FLEXBYTES) fwd pf queue 1 fd_id 1
+
+rule_2::
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 8 proto 255 ttl 255 vlan 0 \
+  flexbytes (FLEXBYTES) fwd pf queue 2 fd_id 2
+
+send packet to DUT, 
+
+packet_1::
+  'sendp([Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2", tos=16, proto=255, ttl=255)/Raw(%s)], iface="%s")'\
+   %(dst_mac, payload, itf) 
+
+packet_1 should be received by queue 1.
+
+packet_2::
+  'sendp([Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2", tos=8, proto=255, ttl=255)/Raw(%s)], iface="%s")'\
+   %(dst_mac, payload, itf) 
+
+packet_2 should be received by queue 2.
+
+delete rule_1, send packet_1 again, packet_1 should be received by queue 0.
+delete rule_2, send packet_2 again, packet_2 should be received by queue 0.
+
+4) add ipv4-proto to fdir input set, set proto to 253 and 254::
+
+  testpmd> set_fdir_input_set 0 ipv4-other ipv4-proto add
+
+setup flow director filter rules  
+rule_3::
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 16 proto 253 ttl 255 vlan 0 \
+  flexbytes (FLEXBYTES) fwd pf queue 3 fd_id 3
+
+rule_4::
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 8 proto 254 ttl 255 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 4 fd_id 4
+
+send packet to DUT, 
+
+packet_3::
+  'sendp([Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2", tos=16, proto=253, ttl=255)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_3 should be received by queue 3.
+
+packet_4::
+  'sendp([Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2", tos=8, proto=254, ttl=255)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_4 should be received by queue 4.
+
+delete rule_3, send packet_3 again, packet_3 should be received by queue 0.
+delete rule_4, send packet_4 again, packet_4 should be received by queue 0.
+
+5) test ipv4-ttl, set ttl to 32 and 64::
+ 
+ testpmd> set_fdir_input_set 0 ipv4-other ipv4-ttl add
+
+setup flow director filter rules,  
+rule_5::
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 16 proto 253 ttl 32 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 5 fd_id 5
+
+rule_6::
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 8 proto 254 ttl 64 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 6 fd_id 6
+
+send packet to DUT, 
+
+packet_5::
+  'sendp([Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2", tos=16, proto=253, ttl=32)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_5 should be received by queue 5.
+
+packet_6::
+  'sendp([Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2", tos=8, proto=254, ttl=64)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_6 should be received by queue 6.
+
+delete rule_5, send packet_5 again, packet_5 should be received by queue 0.
+delete rule_6, send packet_6 again, packet_6 should be received by queue 0.
+
+6) removed all entry of fdir::
+
+  testpmd>flush_flow_director 0
+  testpmd>show port fdir 0
+
+example::
+
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 16 proto 255 ttl 255 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 1 fd_id 1
+
+  flow_director_filter 0 mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 tos 8 proto 255 ttl 255 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 2 fd_id 2
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IP(src="192.168.1.1", dst="192.168.1.2", tos=8, proto=255, ttl=255)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+Test Case 2: test with ipv6 tc, next-header, hop-limits
+=======================================================
+1) start testpmd and initialize flow director flex payload configuration::
+
+  ./testpmd -c fffff -n 4 -- -i --disable-rss --pkt-filter-mode=perfect --rxq=8 --txq=8 --nb-cores=8
+  testpmd> port stop 0
+  testpmd> flow_director_flex_payload 0 l2 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_payload 0 l3 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_payload 0 l4 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_mask 0 flow all (0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff)
+  testpmd> port start 0
+  testpmd> set verbose 1
+  testpmd> set fwd rxonly
+  testpmd> start
+
+Note::
+  assume FLEXBYTES = "0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88"
+  assume payload = "\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88"
+
+2) setup the fdir input set of IPv6::
+
+  testpmd> set_fdir_input_set 0 ipv6-other none select
+  testpmd> set_fdir_input_set 0 ipv6-other src-ipv6 add
+  testpmd> set_fdir_input_set 0 ipv6-other dst-ipv6 add
+
+3) add ipv6-tc to fdir input set, set tc to 16 and 8:: 
+
+  testpmd> set_fdir_input_set 0 ipv6-other ipv6-tc add
+ 
+setup flow director filter rules,
+
+rule_1::
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 16 proto 255 ttl 64 vlan 0 \
+  flexbytes (FLEXBYTES) fwd pf queue 1 fd_id 1
+
+rule_2::
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 8 proto 255 ttl 64 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 2 fd_id 2
+
+send packet to DUT, 
+
+packet_1::
+  'sendp([Ether(dst="%s")/IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64)/Raw(%s)], iface="%s")' \
+  %(dst_mac, payload, itf) 
+
+packet_1 should be received by queue 1.
+
+packet_2::
+  'sendp([Ether(dst="%s")/IPv6(src="2000::1", dst="2000::2", tc=8, nh=255, hlim=64)/Raw(%s)], iface="%s")' \
+  %(dst_mac, payload, itf)
+
+packet_2 should be received by queue 2.
+
+delete rule_1, send packet_1 again, packet_1 should be received by queue 0.
+delete rule_2, send packet_2 again, packet_2 should be received by queue 0.
+
+4) add ipv6-next-header to fdir input set, set nh to 253 and 254::
+
+  testpmd> set_fdir_input_set 0 ipv6-other ipv6-next-header add
+
+setup flow director filter rules,  
+rule_3::
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 16 proto 253 ttl 255 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 3 fd_id 3
+
+rule_4::
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 8 proto 254 ttl 255 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 4 fd_id 4
+
+send packet to DUT, 
+
+packet_3::
+  'sendp([Ether(dst="%s")/IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=64)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_3 should be received by queue 3.
+
+packet_4::
+  'sendp([Ether(dst="%s")/IPv6(src="2000::1", dst="2000::2", tc=8, nh=254, hlim=64)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_4 should be received by queue 4.
+
+delete rule_3, send packet_3 again, packet_3 should be received by queue 0.
+delete rule_4, send packet_4 again, packet_4 should be received by queue 0.
+
+5) add ipv6-hop-limits to fdir input set, set hlim to 32 and 64::
+ 
+  testpmd> set_fdir_input_set 0 ipv6-other ipv6-hop-limits add
+
+setup flow director filter rules,  
+rule_5::
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 16 proto 253 ttl 32 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 5 fd_id 5
+
+rule_6::
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 8 proto 254 ttl 64 vlan 0  \
+  flexbytes (FLEXBYTES) fwd pf queue 6 fd_id 6
+
+send packet to DUT, 
+
+packet_5::
+  'sendp([Ether(dst="%s")/IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=32)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_5 should be received by queue 5.
+
+packet_6::
+  'sendp([Ether(dst="%s")/IPv6(src="2000::1", dst="2000::2", tc=8, nh=254, hlim=64)/Raw(%s)], iface="%s")'\
+  %(dst_mac, payload, itf) 
+
+packet_6 should be received by queue 6.
+
+delete rule_5, send packet_5 again, packet_5 should be received by queue 0.
+delete rule_6, send packet_6 again, packet_6 should be received by queue 0.
+
+6) removed all entry of fdir::
+
+  testpmd>flush_flow_director 0
+  testpmd>show port fdir 0
+
+example::
+
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 16 proto 255 ttl 64 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 1 fd_id 1
+
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 8 proto 255 ttl 64 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 2 fd_id 2
+
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 16 proto 253 ttl 64 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 3 fd_id 3
+
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 8 proto 254 ttl 64 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 4 fd_id 4
+
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 16 proto 253 ttl 32 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 5 fd_id 5
+
+  flow_director_filter 0 mode IP add flow ipv6-other src 2000::1 dst 2000::2 tos 8 proto 254 ttl 48 vlan 0 flexbytes (0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88) fwd pf queue 6 fd_id 6
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IPv6(src="2000::1", dst="2000::2", tc=8, nh=255, hlim=64)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=64)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IPv6(src="2000::1", dst="2000::2", tc=8, nh=254, hlim=64)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=32)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+  sendp([Ether(src="00:00:00:00:00:01", dst="00:00:00:00:01:00")/IPv6(src="2000::1", dst="2000::2", tc=8, nh=254, hlim=48)/Raw(load="\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88")], iface="ens260f0")
+
+
+Test Case 3: test with ivlan  (qinq not work)
+============================
+1) start testpmd and initialize flow director flex payload configuration::
+
+  ./testpmd -c fffff -n 4 -- -i --disable-rss --pkt-filter-mode=perfect --rxq=8 --txq=8 --nb-cores=8
+  testpmd> port stop 0
+  testpmd> flow_director_flex_payload 0 l2 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_payload 0 l3 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_payload 0 l4 (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
+  testpmd> flow_director_flex_mask 0 flow all (0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff)
+  testpmd> port start 0
+
+  testpmd> vlan set qinq on 0  
+
+  testpmd> set verbose 1
+  testpmd> set fwd rxonly
+  testpmd> start
+
+Note::
+  assume FLEXBYTES = "0x11,0x11,0x22,0x22,0x33,0x33,0x44,0x44,0x55,0x55,0x66,0x66,0x77,0x77,0x88,0x88"
+  assume payload = "\x11\x11\x22\x22\x33\x33\x44\x44\x55\x55\x66\x66\x77\x77\x88\x88"
+
+2) setup the fdir input set::
+
+  testpmd> set_fdir_input_set 0 ipv4-udp none select
+  testpmd> set_fdir_input_set 0 ipv4-udp ivlan add
+
+ 
+3) setup flow director filter rules,
+
+rule_1:: 
+  flow_director_filter 0 mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 tos 16 ttl 255 \
+  vlan 1 flexbytes (FLEXBYTES) fwd pf queue 1 fd_id 1
+
+rule_2:: 
+  flow_director_filter 0 mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 tos 16 ttl 255 \
+  vlan 15 flexbytes (FLEXBYTES) fwd pf queue 2 fd_id 2
+
+rule_3:: 
+  flow_director_filter 0 mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 tos 16 ttl 255 \
+  vlan 255 flexbytes (FLEXBYTES) fwd pf queue 3 fd_id 3
+
+rule_4::
+  flow_director_filter 0 mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 tos 16 ttl 255 \
+  vlan 4095 flexbytes (FLEXBYTES) fwd pf queue 4 fd_id 4
+
+4) send packet to DUT, 
+
+packet_1::
+
+  'sendp([Ether(dst="%s")/Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=1)/IP(src="192.168.0.1",dst="192.168.0.2", \
+  tos=16, ttl=255)/UDP(sport="1021",dport="1022")/Raw(%s)], iface="%s")' % (dst_mac, payload, itf)
+
+packet_1 should be received by queue 1.
+
+packet_2::
+  'sendp([Ether(dst="%s")/Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=15)/IP(src="192.168.0.1",dst="192.168.0.2", \
+  tos=16, ttl=255)/UDP(sport="1021",dport="1022")/Raw(%s)], iface="%s")' % (dst_mac, payload, itf)
+
+packet_2 should be received by queue 2.
+
+packet_3::
+  'sendp([Ether(dst="%s")/Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=255)/IP(src="192.168.0.1",dst="192.168.0.2", \
+  tos=16, ttl=255)/UDP(sport="1021",dport="1022")/Raw(%s)], iface="%s")' % (dst_mac, payload, itf)
+
+packet_3 should be received by queue 3.
+
+packet_4::
+  'sendp([Ether(dst="%s")/Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=4095)/IP(src="192.168.0.1",dst="192.168.0.2", \
+  tos=16, ttl=255)/UDP(sport="1021",dport="1022")/Raw(%s)], iface="%s")' % (dst_mac, payload, itf)
+
+packet_4 should be received by queue 4.
+
+delete rule_1, send packet_1 again, packet_1 should be received by queue 0.
+delete rule_2, send packet_2 again, packet_2 should be received by queue 0.
+delete rule_3, send packet_3 again, packet_3 should be received by queue 0.
+delete rule_4, send packet_4 again, packet_4 should be received by queue 0.
+
+5) removed all entry of fdir::
+
+  testpmd>flush_flow_director 0
+  testpmd>show port fdir 0
+
-- 
1.9.3

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

* [dts] [PATCH V2 2/2] add fdir test code for new case
  2017-03-01  2:16 [dts] [PATCH V2 1/2] add fdir test case in plan xu,huilong
@ 2017-03-01  2:16 ` xu,huilong
  2017-03-08  2:40   ` Xu, HuilongX
  2017-03-08  7:54   ` Liu, Yong
  2017-03-08  7:53 ` [dts] [PATCH V2 1/2] add fdir test case in plan Liu, Yong
  1 sibling, 2 replies; 5+ messages in thread
From: xu,huilong @ 2017-03-01  2:16 UTC (permalink / raw)
  To: dts; +Cc: xu,huilong

update list:
1. update send_and_verify function for support check designated  queue
2. add fdir_tos_proto_ttl, fdir_ipv6_tc, fdir_ivlan test case

Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
 tests/TestSuite_fdir.py | 348 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 347 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_fdir.py b/tests/TestSuite_fdir.py
index aa0ec52..ce220fa 100644
--- a/tests/TestSuite_fdir.py
+++ b/tests/TestSuite_fdir.py
@@ -64,7 +64,7 @@ class TestFdir(TestCase, IxiaPacketGenerator):
     #
     ###########################################################################
 
-    def send_and_verify(self, condition, packet):
+    def send_and_verify(self, condition, packet, queueid = -2):
         """
         Send packages and verify behavior.
         """
@@ -89,6 +89,8 @@ class TestFdir(TestCase, IxiaPacketGenerator):
                     self.queue = 0
                 else:
                     self.queue = -1
+            else:
+                self.queue = queueid
 
             result_scanner = r"port ([0-9]+)/queue ([0-9]+): received ([0-9]+) packets\s*src=[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2} - dst=[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}"
             scanner = re.compile(result_scanner, re.DOTALL)
@@ -764,6 +766,350 @@ class TestFdir(TestCase, IxiaPacketGenerator):
 
             self.dut.send_expect("quit", "# ", 30)
 
+    def test_ipv4_tos_proto_ttl(self):
+        """
+        Expand Flow Director for fortville to support ipv4 TOS, ipv4 PROTO, ipv4 TTL
+        """
+        if not self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
+            self.verify(False, "This case only support fortville nic")
+        self.dut.kill_all()
+        self.dut.send_expect("./%s/app/testpmd -c %s -n 4 -- -i --portmask=%s --disable-rss --rxq=4 --txq=4 --nb-cores=4 --nb-ports=1 --pkt-filter-mode=perfect" % (self.target, self.coreMask, utils.create_mask([self.dut_ports[0]])), "testpmd>", 120)
+        self.dut.send_expect("set verbose 1", "testpmd>")
+        self.dut.send_expect("set fwd rxonly", "testpmd>")
+
+        self.fdir_set_rule()
+        self.fdir_get_flexbytes()
+        # fwd comand testing
+        self.fdir_type = " "
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other none select" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other src-ipv4 add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other dst-ipv4 add" % self.dut_ports[0], "testpmd>")
+            
+        # test add and remove  tso rule
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other ipv4-tos add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1" 
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2" 
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+            
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=8, proto=255, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=8, proto=255, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+        # test add and remove proto reul
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other ipv4-proto add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=253, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=254, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=253, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=254, ttl=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+        # test add and remove ttl rule
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other ipv4-ttl add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=32) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-other src 192.168.1.1 dst 192.168.1.2 \
+                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=32) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+    def test_fdir_ipv6_tc(self):
+        """
+        Expand Flow Director for fortville to support ipv6 TC, next-header, hop-limits
+        """
+        if not self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
+            self.verify(False, "This case only support fortville nic")
+        self.dut.kill_all()
+        self.dut.send_expect("./%s/app/testpmd -c %s -n 4 -- -i --portmask=%s --disable-rss --rxq=4 --txq=4 --nb-cores=4 --nb-ports=1 --pkt-filter-mode=perfect" % (self.target, self.coreMask, utils.create_mask([self.dut_ports[0]])), "testpmd>", 120)
+        self.dut.send_expect("set verbose 1", "testpmd>")
+        self.dut.send_expect("set fwd rxonly", "testpmd>")
+
+        self.fdir_set_rule()
+        self.fdir_get_flexbytes()
+        # fwd comand testing
+        self.fdir_type = " "
+        self.dut.send_expect("set_fdir_input_set %d ipv6-other none select" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv6-other src-ipv6 add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv6-other dst-ipv6 add" % self.dut_ports[0], "testpmd>")
+
+        # test add and remove ipv6 tc reul
+        self.dut.send_expect("set_fdir_input_set %d ipv6-other ipv6-tc add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=8, nh=255, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=8, nh=255, hlim=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+        # test add and remove pv6-next-header  reul
+        self.dut.send_expect("set_fdir_input_set %d ipv6-other ipv6-next-header add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=254, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=254, hlim=255) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+        # test add and remove ipv6-hop-limits rule
+        self.dut.send_expect("set_fdir_input_set %d ipv6-other ipv6-hop-limits add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=32) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-other src 2000::1 dst 2000::2 \
+                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=32) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+    def test_fdir_ivlan(self):
+        """
+        Expand Flow Director for fortville to support ipv4 TOS, ipv4 PROTO, ipv4 TTL
+        """
+        if not self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
+            self.verify(False, "This case only support fortville nic")
+        self.dut.kill_all()
+        self.dut.send_expect("./%s/app/testpmd -c %s -n 4 -- -i --portmask=%s --disable-rss --rxq=4 --txq=4 --nb-cores=4 --nb-ports=1 --pkt-filter-mode=perfect" % (self.target, self.coreMask, utils.create_mask([self.dut_ports[0]])), "testpmd>", 120)
+        self.dut.send_expect("set verbose 1", "testpmd>")
+        self.dut.send_expect("set fwd rxonly", "testpmd>")
+
+        self.fdir_set_rule()
+        self.fdir_get_flexbytes()
+        # fwd comand testing
+        self.fdir_type = " "
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other none select" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other src-ipv4 add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv4-other dst-ipv4 add" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("vlan set qinq on %d" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv4-udp none select" % self.dut_ports[0], "testpmd>")
+        self.dut.send_expect("set_fdir_input_set %d ipv4-udp ivlan add" % self.dut_ports[0], "testpmd>")
+        
+
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 1 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 15 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 255 flexbytes (%s) fwd pf queue 3 fd_id 3"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 4095 flexbytes (%s) fwd pf queue 4 fd_id 4"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=1) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 1)
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=15) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 2)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=255) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 3)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=4095) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 4)
+
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 1 flexbytes (%s) fwd pf queue 1 fd_id 1"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 15 flexbytes (%s) fwd pf queue 2 fd_id 2"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 255 flexbytes (%s) fwd pf queue 3 fd_id 3"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
+                              tos 16 proto 255 ttl 32 vlan 4095 flexbytes (%s) fwd pf queue 4 fd_id 4"
+                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=1) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=15) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=255) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"), dst="00:1B:21:8E:B2:30") \
+                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=4095) \
+                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255, ttl=255) \
+                             /UDP(sport="1021",dport="1022") \
+                             /Raw(load="%s")], iface="%s")' \
+                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
+
+
+
     def failed_test_fdir_flush(self):
         """
         FDir flush in Fortville.
-- 
1.9.3

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

* Re: [dts] [PATCH V2 2/2] add fdir test code for new case
  2017-03-01  2:16 ` [dts] [PATCH V2 2/2] add fdir test code for new case xu,huilong
@ 2017-03-08  2:40   ` Xu, HuilongX
  2017-03-08  7:54   ` Liu, Yong
  1 sibling, 0 replies; 5+ messages in thread
From: Xu, HuilongX @ 2017-03-08  2:40 UTC (permalink / raw)
  To: dts, Pei, Yulong

Hi yulong,
Could you help me review this test case?
Thanks a lot

> -----Original Message-----
> From: Xu, HuilongX
> Sent: Wednesday, March 01, 2017 10:16 AM
> To: dts@dpdk.org
> Cc: Xu, HuilongX
> Subject: [PATCH V2 2/2] add fdir test code for new case
> 
> update list:
> 1. update send_and_verify function for support check designated  queue 2.
> add fdir_tos_proto_ttl, fdir_ipv6_tc, fdir_ivlan test case
> 
> Signed-off-by: xu,huilong <huilongx.xu@intel.com>
> ---
>  tests/TestSuite_fdir.py | 348
> +++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 347 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/TestSuite_fdir.py b/tests/TestSuite_fdir.py index
> aa0ec52..ce220fa 100644
> --- a/tests/TestSuite_fdir.py
> +++ b/tests/TestSuite_fdir.py
> @@ -64,7 +64,7 @@ class TestFdir(TestCase, IxiaPacketGenerator):
>      #
> 
> ##########################################################
> #################
> 
> -    def send_and_verify(self, condition, packet):
> +    def send_and_verify(self, condition, packet, queueid = -2):
>          """
>          Send packages and verify behavior.
>          """
> @@ -89,6 +89,8 @@ class TestFdir(TestCase, IxiaPacketGenerator):
>                      self.queue = 0
>                  else:
>                      self.queue = -1
> +            else:
> +                self.queue = queueid
> 
>              result_scanner = r"port ([0-9]+)/queue ([0-9]+): received ([0-9]+)
> packets\s*src=[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-
> F\d]{2} - dst=[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-
> F\d]{2}"
>              scanner = re.compile(result_scanner, re.DOTALL) @@ -764,6 +766,350
> @@ class TestFdir(TestCase, IxiaPacketGenerator):
> 
>              self.dut.send_expect("quit", "# ", 30)
> 
> +    def test_ipv4_tos_proto_ttl(self):
> +        """
> +        Expand Flow Director for fortville to support ipv4 TOS, ipv4 PROTO, ipv4
> TTL
> +        """
> +        if not self.nic in ["fortville_eagle", "fortville_spirit",
> "fortville_spirit_single"]:
> +            self.verify(False, "This case only support fortville nic")
> +        self.dut.kill_all()
> +        self.dut.send_expect("./%s/app/testpmd -c %s -n 4 -- -i --portmask=%s
> --disable-rss --rxq=4 --txq=4 --nb-cores=4 --nb-ports=1 --pkt-filter-
> mode=perfect" % (self.target, self.coreMask,
> utils.create_mask([self.dut_ports[0]])), "testpmd>", 120)
> +        self.dut.send_expect("set verbose 1", "testpmd>")
> +        self.dut.send_expect("set fwd rxonly", "testpmd>")
> +
> +        self.fdir_set_rule()
> +        self.fdir_get_flexbytes()
> +        # fwd comand testing
> +        self.fdir_type = " "
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other none select" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other src-ipv4 add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other dst-ipv4
> + add" % self.dut_ports[0], "testpmd>")
> +
> +        # test add and remove  tso rule
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other ipv4-tos add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 1)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=8, proto=255,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 2)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=8, proto=255,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +        # test add and remove proto reul
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other ipv4-proto
> add" % self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=253,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 1)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=254,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 2)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=253,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=254,
> ttl=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +        # test add and remove ttl rule
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other ipv4-ttl add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=32) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 1)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 2)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> other src 192.168.1.1 dst 192.168.1.2 \
> +                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=32) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +    def test_fdir_ipv6_tc(self):
> +        """
> +        Expand Flow Director for fortville to support ipv6 TC, next-header, hop-
> limits
> +        """
> +        if not self.nic in ["fortville_eagle", "fortville_spirit",
> "fortville_spirit_single"]:
> +            self.verify(False, "This case only support fortville nic")
> +        self.dut.kill_all()
> +        self.dut.send_expect("./%s/app/testpmd -c %s -n 4 -- -i --portmask=%s
> --disable-rss --rxq=4 --txq=4 --nb-cores=4 --nb-ports=1 --pkt-filter-
> mode=perfect" % (self.target, self.coreMask,
> utils.create_mask([self.dut_ports[0]])), "testpmd>", 120)
> +        self.dut.send_expect("set verbose 1", "testpmd>")
> +        self.dut.send_expect("set fwd rxonly", "testpmd>")
> +
> +        self.fdir_set_rule()
> +        self.fdir_get_flexbytes()
> +        # fwd comand testing
> +        self.fdir_type = " "
> +        self.dut.send_expect("set_fdir_input_set %d ipv6-other none select" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv6-other src-ipv6 add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv6-other dst-ipv6
> + add" % self.dut_ports[0], "testpmd>")
> +
> +        # test add and remove ipv6 tc reul
> +        self.dut.send_expect("set_fdir_input_set %d ipv6-other ipv6-tc add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 1)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=8, nh=255, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 2)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 8 proto 255 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=8, nh=255, hlim=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +        # test add and remove pv6-next-header  reul
> +        self.dut.send_expect("set_fdir_input_set %d ipv6-other ipv6-next-
> header add" % self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 1)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=254, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 2)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 253 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 254 ttl 255 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=253, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=254, hlim=255) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +        # test add and remove ipv6-hop-limits rule
> +        self.dut.send_expect("set_fdir_input_set %d ipv6-other ipv6-hop-
> limits add" % self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=32) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 1)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 2)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 255 ttl 32 vlan 0 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv6-
> other src 2000::1 dst 2000::2 \
> +                              tos 16 proto 255 ttl 64 vlan 0 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=32) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /IPv6(src="2000::1", dst="2000::2", tc=16, nh=255, hlim=64) \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +    def test_fdir_ivlan(self):
> +        """
> +        Expand Flow Director for fortville to support ipv4 TOS, ipv4 PROTO, ipv4
> TTL
> +        """
> +        if not self.nic in ["fortville_eagle", "fortville_spirit",
> "fortville_spirit_single"]:
> +            self.verify(False, "This case only support fortville nic")
> +        self.dut.kill_all()
> +        self.dut.send_expect("./%s/app/testpmd -c %s -n 4 -- -i --portmask=%s
> --disable-rss --rxq=4 --txq=4 --nb-cores=4 --nb-ports=1 --pkt-filter-
> mode=perfect" % (self.target, self.coreMask,
> utils.create_mask([self.dut_ports[0]])), "testpmd>", 120)
> +        self.dut.send_expect("set verbose 1", "testpmd>")
> +        self.dut.send_expect("set fwd rxonly", "testpmd>")
> +
> +        self.fdir_set_rule()
> +        self.fdir_get_flexbytes()
> +        # fwd comand testing
> +        self.fdir_type = " "
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other none select" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other src-ipv4 add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-other dst-ipv4 add" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("vlan set qinq on %d" % self.dut_ports[0],
> "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-udp none select" %
> self.dut_ports[0], "testpmd>")
> +        self.dut.send_expect("set_fdir_input_set %d ipv4-udp ivlan add"
> + % self.dut_ports[0], "testpmd>")
> +
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 1 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 15 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 255 flexbytes (%s) fwd pf queue 3
> fd_id 3"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP add flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 4095 flexbytes (%s) fwd pf queue
> 4 fd_id 4"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=1) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 1)
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=15) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 2)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=255) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 3)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=4095) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 4)
> +
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 1 flexbytes (%s) fwd pf queue 1
> fd_id 1"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 15 flexbytes (%s) fwd pf queue 2
> fd_id 2"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 255 flexbytes (%s) fwd pf queue 3
> fd_id 3"
> +                              % (self.dut_ports[0], self.flexbytes), "testpmd>")
> +        self.dut.send_expect("flow_director_filter %d mode IP del flow ipv4-
> udp src 192.168.1.1 1021 dst 192.168.1.2 1022 \
> +                              tos 16 proto 255 ttl 32 vlan 4095 flexbytes (%s) fwd pf queue
> 4 fd_id 4"
> +                              % (self.dut_ports[0], self.flexbytes),
> + "testpmd>")
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=1) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=15) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=255) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface),
> queueid = 0)
> +        self.send_and_verify(True, 'sendp([Ether(src=get_if_hwaddr("%s"),
> dst="00:1B:21:8E:B2:30") \
> +                             /Dot1Q(id=0x8100,vlan=16)/Dot1Q(id=0x8100,vlan=4095) \
> +                             /IP(src="192.168.1.1", dst="192.168.1.2", tos=16, proto=255,
> ttl=255) \
> +                             /UDP(sport="1021",dport="1022") \
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload,
> + self.dut_rx_interface), queueid = 0)
> +
> +
> +
>      def failed_test_fdir_flush(self):
>          """
>          FDir flush in Fortville.
> --
> 1.9.3

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

* Re: [dts] [PATCH V2 1/2] add fdir test case in plan
  2017-03-01  2:16 [dts] [PATCH V2 1/2] add fdir test case in plan xu,huilong
  2017-03-01  2:16 ` [dts] [PATCH V2 2/2] add fdir test code for new case xu,huilong
@ 2017-03-08  7:53 ` Liu, Yong
  1 sibling, 0 replies; 5+ messages in thread
From: Liu, Yong @ 2017-03-08  7:53 UTC (permalink / raw)
  To: xu,huilong, dts

Huilong,
Please try your best to keep each line in 79 characters. Another comment 
is that, need indication about which kind of NICs support IPv4 
tos/proto/ttl and ipv6 tc/nh/hop-limits.

Thanks,
Marvin

On 03/01/2017 10:16 AM, xu,huilong wrote:
> -connected to the traffic generator. If this is not the case, the following
> +connected to the traffic generator. All fdir cmdline please see doc onhttp://www.dpdk.org/doc/guides/testpmd_app_ug/testpmd_funcs.html#filter-functions.  If this is not the case, the following
>   ``testpmd`` commands must be changed, and also the ``--portmask`` parameter.
>   

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

* Re: [dts] [PATCH V2 2/2] add fdir test code for new case
  2017-03-01  2:16 ` [dts] [PATCH V2 2/2] add fdir test code for new case xu,huilong
  2017-03-08  2:40   ` Xu, HuilongX
@ 2017-03-08  7:54   ` Liu, Yong
  1 sibling, 0 replies; 5+ messages in thread
From: Liu, Yong @ 2017-03-08  7:54 UTC (permalink / raw)
  To: xu,huilong, dts

Huilong,
Please add blank line between functions.

On 03/01/2017 10:16 AM, xu,huilong wrote:
> +                             /Raw(load="%s")], iface="%s")' \
> +                             % (self.dut_rx_interface, self.payload, self.dut_rx_interface), queueid = 0)
> +    def test_fdir_ivlan(self):

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

end of thread, other threads:[~2017-03-08  8:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01  2:16 [dts] [PATCH V2 1/2] add fdir test case in plan xu,huilong
2017-03-01  2:16 ` [dts] [PATCH V2 2/2] add fdir test code for new case xu,huilong
2017-03-08  2:40   ` Xu, HuilongX
2017-03-08  7:54   ` Liu, Yong
2017-03-08  7:53 ` [dts] [PATCH V2 1/2] add fdir test case in plan Liu, Yong

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