test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yan Xia <yanx.xia@intel.com>
To: dts@dpdk.org
Cc: Yan Xia <yanx.xia@intel.com>
Subject: [dts] [PATCH V1 1/5] tests/generic_flow_api: move two cases from generic_filter to generic_flow_api
Date: Tue, 28 Sep 2021 18:05:29 +0000	[thread overview]
Message-ID: <20210928180533.143020-1-yanx.xia@intel.com> (raw)

move two cases from generic_filter to generic_flow_api

Signed-off-by: Yan Xia <yanx.xia@intel.com>
---
 tests/TestSuite_generic_flow_api.py | 118 ++++++++++++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py
index 3ea76b64..32805e46 100644
--- a/tests/TestSuite_generic_flow_api.py
+++ b/tests/TestSuite_generic_flow_api.py
@@ -84,6 +84,10 @@ class TestGeneric_flow_api(TestCase):
             MAX_QUEUE = 3
         # Based on h/w type, choose how many ports to use
         self.dut_ports = self.dut.get_ports(self.nic)
+        global valports
+        valports = [_ for _ in self.dut_ports if self.tester.get_local_port(_) != -1]
+        global portMask
+        portMask = utils.create_mask(valports[:2])
         # Verify that enough ports are available
         self.verify(len(self.dut_ports) >= 1, "Insufficient ports")
         self.cores = "1S/8C/1T"
@@ -2520,6 +2524,120 @@ class TestGeneric_flow_api(TestCase):
         self.verify(result_rows[2][1] != result_rows[4][1], "The hash values should be different when setting rss to 's-vlan c-vlan' and sending packet with different ivlan.")
         self.verify(result_rows[3][1] != result_rows[4][1], "The hash values should be different when setting rss to 's-vlan c-vlan' and sending packet with different ovlan and ivlan")
 
+    def test_multiple_filters_10GB(self):
+        """
+        only supported by ixgbe and igb
+        """
+        self.verify(self.nic in ["niantic", "kawela_4", "kawela",
+                        "twinville", "foxville"], "%s nic not support n-tuple filter" % self.nic)
+        self.pmdout.start_testpmd("%s" % self.cores, "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE+1, MAX_QUEUE+1))
+        self.dut.send_expect("set fwd rxonly", "testpmd> ", 120)
+        self.dut.send_expect("set verbose 1", "testpmd> ", 120)
+        self.dut.send_expect("start", "testpmd> ", 120)
+        time.sleep(2)
+
+        self.dut.send_expect(
+            "flow validate 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 1 / end", "validated")
+        self.dut.send_expect(
+            "flow validate 0 ingress pattern eth type is 0x0806  / end actions queue index 2 /  end", "validated")
+        self.dut.send_expect(
+            "flow validate 0 ingress pattern eth / ipv4 dst is 2.2.2.5 src is 2.2.2.4 proto is 17 / udp dst is 1 src is 1  / end actions queue index 3 /  end",
+            "validated")
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 1 / end", "created")
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth type is 0x0806  / end actions queue index 2 /  end", "created")
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 dst is 2.2.2.5 src is 2.2.2.4 proto is 17 / udp dst is 1 src is 1  / end actions queue index 3 /  end", "create")
+        time.sleep(2)
+        self.sendpkt(pktstr='Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2")/TCP(dport=80,flags="S")/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="1", verify_mac=self.pf_mac)
+
+        self.sendpkt(pktstr='Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.1")/Raw("x" * 20)')
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac="ff:ff:ff:ff:ff:ff")
+
+        self.sendpkt(pktstr='Ether(dst="%s")/Dot1Q(prio=3)/IP(src="2.2.2.4",dst="2.2.2.5")/UDP(sport=1,dport=1)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="3", verify_mac=self.pf_mac)
+        # destroy rule 2
+        out = self.dut.send_expect("flow destroy 0 rule 2", "testpmd> ")
+        p = re.compile(r"Flow rule #(\d+) destroyed")
+        m = p.search(out)
+        self.verify(m, "flow rule 2 delete failed" )
+        self.sendpkt(pktstr='Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2")/TCP(dport=80,flags="S")/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="1", verify_mac=self.pf_mac)
+
+        self.sendpkt(pktstr='Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.1")/Raw("x" * 20)')
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac="ff:ff:ff:ff:ff:ff")
+
+        self.sendpkt(pktstr='Ether(dst="%s")/Dot1Q(prio=3)/IP(src="2.2.2.4",dst="2.2.2.5")/UDP(sport=1,dport=1)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac)
+        # destroy rule 1
+        out = self.dut.send_expect("flow destroy 0 rule 1", "testpmd> ")
+        p = re.compile(r"Flow rule #(\d+) destroyed")
+        m = p.search(out)
+        self.verify(m, "flow rule 1 delete failed" )
+
+        self.sendpkt(pktstr='Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.1")/Raw("x" * 20)')
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac="ff:ff:ff:ff:ff:ff")
+
+        self.sendpkt(pktstr='Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2")/TCP(dport=80,flags="S")/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="1", verify_mac=self.pf_mac)
+        # destroy rule 0
+        out = self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ")
+        p = re.compile(r"Flow rule #(\d+) destroyed")
+        m = p.search(out)
+        self.verify(m, "flow rule 0 delete failed" )
+
+        self.sendpkt(pktstr='Ether(dst="%s")/IP(src="192.168.0.1", dst="192.168.0.2")/TCP(dport=80,flags="S")/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac)
+        self.dut.send_expect("stop", "testpmd> ")
+
+    def test_jumbo_frame_size(self):
+
+        self.verify(self.nic in ["niantic", "kawela_4", "kawela", "bartonhills", "twinville", "sagepond", "sageville",
+                                 "powerville", "foxville"], "%s nic not support" % self.nic)
+        if (self.nic in ["cavium_a063", "cavium_a064", "foxville"]):
+            self.pmdout.start_testpmd(
+                "%s" % self.cores, "--disable-rss --rxq=4 --txq=4 --portmask=%s --nb-cores=4 --nb-ports=1 --mbcache=200 --mbuf-size=2048 --max-pkt-len=9200" % portMask)
+        else:
+            self.pmdout.start_testpmd(
+                "%s" % self.cores, "--disable-rss --rxq=4 --txq=4 --portmask=%s --nb-cores=4 --nb-ports=1 --mbcache=200 --mbuf-size=2048 --max-pkt-len=9600" % portMask)
+        port = self.tester.get_local_port(valports[0])
+        txItf = self.tester.get_interface(port)
+
+        port = self.tester.get_local_port(valports[1])
+        rxItf = self.tester.get_interface(port)
+        self.tester.send_expect("ifconfig %s mtu %s" % (txItf, 9200), "# ")
+        self.tester.send_expect("ifconfig %s mtu %s" % (rxItf, 9200), "# ")
+        self.dut.send_expect("set fwd rxonly", "testpmd> ", 120)
+        self.dut.send_expect("set verbose 1", "testpmd> ", 120)
+        self.dut.send_expect("start", "testpmd> ", 120)
+        time.sleep(2)
+
+        self.dut.send_expect(
+            "flow validate 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 2 / end",
+            "validated")
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 2 / end",
+            "created")
+
+        self.sendpkt(pktstr='Ether(dst="%s")/IP(src="2.2.2.5",dst="2.2.2.4")/TCP(dport=80,flags="S")/Raw(load="\x50"*8962)' % self.pf_mac)
+        time.sleep(1)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac=self.pf_mac)
+
+        self.sendpkt(pktstr='Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.1")')
+        time.sleep(1)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac="ff:ff:ff:ff:ff:ff")
+        # destroy rule
+        self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ")
+        self.sendpkt(pktstr='Ether(dst="%s")/IP(src="2.2.2.5",dst="2.2.2.4")/TCP(dport=80,flags="S")/Raw(load="\x50"*8962)' % self.pf_mac)
+        time.sleep(1)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac)
+        self.dut.send_expect("stop", "testpmd> ")
+
+        self.tester.send_expect("ifconfig %s mtu %s" % (txItf, 1500), "# ")
+        self.tester.send_expect("ifconfig %s mtu %s" % (rxItf, 1500), "# ")
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.32.0


             reply	other threads:[~2021-09-28 10:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 18:05 Yan Xia [this message]
2021-09-28 18:05 ` [dts] [PATCH V1 3/5] test_plans/generic_flow_api_test_plan: " Yan Xia
2021-09-28 18:05 ` [dts] [PATCH V1 2/5] test_plans/generic_filter_test_plan: " Yan Xia
2021-09-28 18:05 ` [dts] [PATCH V1 4/5] tests/generic_filter: " Yan Xia
2021-09-29  1:50   ` Peng, Yuan
2021-09-28 18:05 ` [dts] [PATCH V1 5/5] conf/test_case_checklist: add cases not support NIC Yan Xia
2021-09-28 10:10   ` Chen, LingliX
2021-10-09  7:54     ` Tu, Lijuan

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=20210928180533.143020-1-yanx.xia@intel.com \
    --to=yanx.xia@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).