test suite reviews and discussions
 help / color / mirror / Atom feed
From: "xu,huilong" <huilongx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,huilong" <huilongx.xu@intel.com>
Subject: [dts] [PATCH V3 2/2] add fdir test code for new case
Date: Thu,  9 Mar 2017 15:22:49 +0800	[thread overview]
Message-ID: <1489044169-9629-2-git-send-email-huilongx.xu@intel.com> (raw)
In-Reply-To: <1489044169-9629-1-git-send-email-huilongx.xu@intel.com>

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 | 349 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 348 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_fdir.py b/tests/TestSuite_fdir.py
index aa0ec52..f49ec24 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,351 @@ 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

      reply	other threads:[~2017-03-09  7:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09  7:22 [dts] [PATCH V3 1/2] add fdir test case in plan xu,huilong
2017-03-09  7:22 ` xu,huilong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489044169-9629-2-git-send-email-huilongx.xu@intel.com \
    --to=huilongx.xu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).