From patchwork Mon Sep 6 17:35:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Xia X-Patchwork-Id: 98076 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22A76A0C4D; Mon, 6 Sep 2021 11:04:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1680D40E32; Mon, 6 Sep 2021 11:04:21 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6D7B540C35 for ; Mon, 6 Sep 2021 11:04:19 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="305483810" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="305483810" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:04:18 -0700 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="468776527" Received: from unknown (HELO localhost.localdomain) ([10.240.183.102]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:04:12 -0700 From: Yan Xia To: dts@dpdk.org Cc: Yan Xia Date: Mon, 6 Sep 2021 17:35:50 +0000 Message-Id: <20210906173550.23959-1-yanx.xia@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1 1/3] tests/generic_flow_api: add and modify test cases X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" modify test cases about legcay command and move these to TestSuite_generic_flow_api Signed-off-by: Yan Xia --- tests/TestSuite_generic_flow_api.py | 325 +++++++++++++++++++++++++++- 1 file changed, 318 insertions(+), 7 deletions(-) diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index f64a5be5..daf89edf 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -59,6 +59,8 @@ from scapy.utils import rdpcap MAX_VLAN = 4095 MAX_QUEUE = 15 +testQueues = [16] +reta_lines = [] MAX_VFQUEUE = 3 MAX_PORT = 65535 MAX_TTL = 255 @@ -82,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" @@ -148,6 +154,12 @@ class TestGeneric_flow_api(TestCase): time.sleep(2) self.vf_flag = 0 + def request_mbufs(self, queue_num): + """ + default txq/rxq descriptor is 64 + """ + return 1024 * queue_num + 512 + def verify_result(self, pf_vf, expect_rxpkts, expect_queue, verify_mac): """ verify the packet to the expected queue or be dropped @@ -642,6 +654,81 @@ class TestGeneric_flow_api(TestCase): self.pkt_obj.append_pkt(pktstr) self.pkt_obj.send_pkt(self.tester, tx_port=self.tester_itf, count=count) + def send_packet(self, itf, tran_type, enable=None): + """ + Sends packets for l2_payload. + """ + global reta_lines + global name + global value + self.tester.scapy_foreground() + self.dut.send_expect("start", "testpmd>") + mac = self.dut.get_mac_address(0) + + # send packet with different source and dest ip + if tran_type == "l2_payload": + if enable == "ovlan": + packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/Dot1Q(id=0x8100,vlan=4)/Dot1Q(id=0x8100,vlan=2,type=0xaaaa)/Raw(load="x"*60)], iface="%s")' % ( + mac, itf, itf) + elif enable == "ivlan": + packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/Dot1Q(id=0x8100,vlan=1)/Dot1Q(id=0x8100,vlan=3,type=0xaaaa)/Raw(load="x"*60)], iface="%s")' % ( + mac, itf, itf) + else: + packet = r'sendp([Ether(dst="%s", src=get_if_hwaddr("%s"))/Dot1Q(id=0x8100,vlan=1)/Dot1Q(id=0x8100,vlan=2,type=0xaaaa)/Raw(load="x"*60)], iface="%s")' % ( + mac, itf, itf) + self.tester.scapy_append(packet) + self.tester.scapy_execute() + time.sleep(.5) + else: + print("\ntran_type error!\n") + + out = self.dut.get_session_output(timeout=1) + self.dut.send_expect("stop", "testpmd>") + lines = out.split("\r\n") + reta_line = {} + # collect the hash result and the queue id + for line in lines: + line = line.strip() + if len(line) != 0 and line.strip().startswith("port "): + reta_line = {} + rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets" + m = re.match(rexp, line.strip()) + if m: + reta_line["port"] = m.group(1) + reta_line["queue"] = m.group(2) + + elif len(line) != 0 and line.startswith(("src=",)): + for item in line.split("-"): + item = item.strip() + + if(item.startswith("RSS hash")): + name, value = item.split("=", 1) + + reta_line[name.strip()] = value.strip() + reta_lines.append(reta_line) + + self.append_result_table() + + def append_result_table(self): + """ + Append the hash value and queue id into table. + """ + + global reta_lines + + # append the the hash value and queue id into table + self.result_table_create( + ['packet index', 'hash value', 'hash index', 'queue id']) + i = 0 + + for tmp_reta_line in reta_lines: + + # compute the hash result of five tuple into the 7 LSBs value. + hash_index = int(tmp_reta_line["RSS hash"], 16) + self.result_table_add( + [i, tmp_reta_line["RSS hash"], hash_index, tmp_reta_line["queue"]]) + i = i + 1 + def test_syn_filter(self): """ Only supported by ixgbe and igb. @@ -854,11 +941,6 @@ class TestGeneric_flow_api(TestCase): self.session_third.send_expect("start", "testpmd> ") time.sleep(2) - # Enabling ability of parsing E-tag packet - self.dut.send_expect("port config 0 l2-tunnel E-tag enable", "testpmd> ") - # Enable E-tag packet forwarding, set on pf - self.dut.send_expect("E-tag set forwarding on port 0", "testpmd> ") - # create the flow rules basic_flow_actions = [ {'create': 'validate', 'flows': ['etag'], 'actions': ['vf0']}, @@ -870,8 +952,6 @@ class TestGeneric_flow_api(TestCase): ] extrapkt_rulenum = self.all_flows_process(basic_flow_actions) extra_packet = extrapkt_rulenum['extrapacket'] - self.sendpkt('Ether(dst="%s")/Dot1BR(GRP=0x2, ECIDbase=%s)/Raw("x" * 20)' % (self.pf_mac, extra_packet[0]['etag'])) - self.verify_result("pf", expect_rxpkts="0", expect_queue="NULL", verify_mac=self.pf_mac) rule_num = extrapkt_rulenum['rulenum'] self.verify_rulenum(rule_num) @@ -2399,6 +2479,237 @@ class TestGeneric_flow_api(TestCase): self.sendpkt(pktstr='Ether(dst="%s")/IP()/UDP(dport=32)/Raw("x" * 20)' % self.pf_mac) self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac=self.pf_mac) + def test_dual_vlan(self): + """ + Test with flow type dual vlan(QinQ). + """ + + self.verify(self.nic in ["fortville_eagle", "fortville_spirit", + "fortville_spirit_single", "fortville_25g", "carlsville"], + "NIC Unsupported: " + str(self.nic)) + for queue in testQueues: + self.pmdout.start_testpmd( + "Default", " --portmask=0x1 --rxq=%d --txq=%d" % (queue, queue)) + + self.dut.send_expect("set verbose 8", "testpmd> ") + self.dut.send_expect("set fwd rxonly", "testpmd> ") + + self.dut.send_expect("port stop all", "testpmd> ") + self.dut.send_expect("vlan set extend on 0", "testpmd> ") + self.dut.send_expect( + "flow create 0 ingress pattern eth / end actions rss types l2-payload end queues end func toeplitz / end", "testpmd> ") + self.dut.send_expect("port start all", "testpmd> ") + res = self.pmdout.wait_link_status_up("all") + self.verify(res is True, "link is down") + + self.send_packet(self.tester_itf, "l2_payload") + + # set flow rss type s-vlan c-vlan set by testpmd on dut + self.dut.send_expect("flow create 0 ingress pattern eth / end actions rss types s-vlan c-vlan end key_len 0 queues end / end", "testpmd> ") + self.send_packet(self.tester_itf, "l2_payload") + + self.send_packet(self.tester_itf, "l2_payload", enable="ovlan") + + self.send_packet(self.tester_itf, "l2_payload", enable="ivlan") + + self.dut.send_expect("quit", "# ", 30) + + self.result_table_print() + result_rows = self.result_table_getrows() + self.verify(len(result_rows) > 1, "There is no data in the table, testcase failed!") + + # check the results + self.verify(result_rows[1][1] != result_rows[2][1], "The hash values should be different when setting rss to 'l2-payload' and 's-vlan c-vlan and sending the same packets.") + self.verify(result_rows[1][1] != result_rows[3][1], "The hash values should be different when setting rss to 'l2-payload' and 's-vlan c-vlan' and sending packets with differernt ovlan.") + self.verify(result_rows[1][1] != result_rows[4][1], "The hash values should be different when setting rss to 'l2-payload' and 's-vlan c-vlan' and sending packets with differernt ivlan.") + self.verify(result_rows[2][1] != result_rows[3][1], "The hash values should be different when setting rss to 's-vlan c-vlan' and sending packet with differernt ovlan.") + 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 differernt 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 differernt 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_128_queues(self): + + set_filter_flag = 1 + packet_flag = 1 + if self.kdriver == "ixgbe": + self.dut.send_expect("sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h", "# ",30) + self.dut.build_install_dpdk(self.target) + global valports + total_mbufs = self.request_mbufs(128) * len(valports) + self.pmdout.start_testpmd( + "all", "--disable-rss --rxq=128 --txq=128 --portmask=%s --nb-cores=4 --total-num-mbufs=%d" % (portMask, total_mbufs)) + self.dut.send_expect( + "set stat_qmap rx %s 0 0" % valports[0], "testpmd> ") + self.dut.send_expect( + "set stat_qmap rx %s 0 0" % valports[1], "testpmd> ") + self.dut.send_expect( + "vlan set strip off %s" % valports[0], "testpmd> ") + self.dut.send_expect( + "vlan set strip off %s" % valports[1], "testpmd> ") + self.dut.send_expect( + "vlan set filter off %s" % valports[0], "testpmd> ") + self.dut.send_expect( + "vlan set filter off %s" % valports[1], "testpmd> ") + queue = ['64', '127', '128'] + + for i in [0, 1, 2]: + if i == 2: + out = self.dut.send_expect( + "set stat_qmap rx %s %s %s" % (valports[0], queue[i], (i + 1)), "testpmd> ") + if 'Invalid RX queue %s' % (queue[i]) not in out: + set_filter_flag = 0 + break + cmd = "flow create {} ingress pattern eth / ".format( + valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1 / ".format( + i + 1) + "end actions queue index {} / end".format(queue[i]) + out = self.dut.send_expect(cmd, "testpmd> ") + if 'Invalid argument' not in out: + set_filter_flag = 0 + break + continue + else: + self.dut.send_expect("set stat_qmap rx %s %s %s" % + (valports[0], queue[i], (i + 1)), "testpmd> ") + cmd = "flow create {} ingress pattern eth / ".format( + valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is {} src is 1 / ".format( + i + 1) + "end actions queue index {} / end".format(queue[i]) + self.dut.send_expect(cmd, "testpmd> ") + self.dut.send_expect("start", "testpmd> ", 120) + global filters_index + filters_index = i + if (filters_index == 0): + self.sendpkt(pktstr='Ether(dst="%s")/IP(src="2.2.2.4",dst="2.2.2.5")/TCP(sport=1,dport=1,flags=0)' % self.pf_mac) + if (filters_index == 1): + self.sendpkt(pktstr='Ether(dst="%s")/Dot1Q(prio=3)/IP(src="2.2.2.4",dst="2.2.2.5")/TCP(sport=1,dport=2,flags=0)' % self.pf_mac) + time.sleep(1) + out = self.dut.send_expect("stop", "testpmd> ") + p = re.compile(r"Forward Stats for RX Port= \d+/Queue=(\s?\d+)") + res = p.findall(out) + queues = [int(i) for i in res] + if queues[0] != int(queue[i]): + packet_flag = 0 + break + self.dut.send_expect("quit", "#", timeout=30) + self.dut.send_expect("sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64/' drivers/net/ixgbe/ixgbe_ethdev.h", "# ",30) + self.dut.build_install_dpdk(self.target) + self.verify(set_filter_flag == 1, "set filters error") + self.verify(packet_flag == 1, "packet pass assert error") + else: + self.verify(False, "%s not support this test" % self.nic) + + def test_jumbo_frame_size(self): + + self.verify(self.nic not in ["fortville_spirit_single", "fortpark_TLV","fortpark_BASE-T", "carlsville"], "%s nic not support this test" % 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. From patchwork Mon Sep 6 17:36:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Xia X-Patchwork-Id: 98077 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C005A0C4D; Mon, 6 Sep 2021 11:04:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44657410E6; Mon, 6 Sep 2021 11:04:35 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 43AE140C35 for ; Mon, 6 Sep 2021 11:04:34 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="305483863" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="305483863" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:04:33 -0700 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="468776621" Received: from unknown (HELO localhost.localdomain) ([10.240.183.102]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:04:31 -0700 From: Yan Xia To: dts@dpdk.org Cc: Yan Xia Date: Mon, 6 Sep 2021 17:36:09 +0000 Message-Id: <20210906173609.24015-1-yanx.xia@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1 2/3] test_plans/generic_flow_api: add and modify test plan of test cases X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" modify test cases about legcay command and move these to generic_flow_api_test_plan Signed-off-by: Yan Xia --- test_plans/generic_flow_api_test_plan.rst | 160 ++++++++++++++++++++-- 1 file changed, 150 insertions(+), 10 deletions(-) diff --git a/test_plans/generic_flow_api_test_plan.rst b/test_plans/generic_flow_api_test_plan.rst index d1fa33bd..519f0453 100644 --- a/test_plans/generic_flow_api_test_plan.rst +++ b/test_plans/generic_flow_api_test_plan.rst @@ -831,14 +831,6 @@ Test case: IXGBE L2-tunnel(supported by x552 and x550) testpmd> set verbose 1 testpmd> start - Enabling ability of parsing E-tag packet, set on pf:: - - testpmd> port config 0 l2-tunnel E-tag enable - - Enable E-tag packet forwarding, set on pf:: - - testpmd> E-tag set forwarding on port 0 - 2. create filter rules:: testpmd> flow create 0 ingress pattern e_tag grp_ecid_b is 0x1309 / end actions queue index 0 / end @@ -850,10 +842,8 @@ Test case: IXGBE L2-tunnel(supported by x552 and x550) pkt1 = Ether(dst="00:11:22:33:44:55")/Dot1BR(GRP=0x1, ECIDbase=0x309)/Raw('x' * 20) pkt2 = Ether(dst="00:11:22:33:44:55")/Dot1BR(GRP=0x1, ECIDbase=0x308)/Raw('x' * 20) pkt3 = Ether(dst="00:11:22:33:44:55")/Dot1BR(GRP=0x1, ECIDbase=0x307)/Raw('x' * 20) - pkt4 = Ether(dst="00:11:22:33:44:55")/Dot1BR(GRP=0x2, ECIDbase=0x309)/Raw('x' * 20) verify pkt1 to vf0 queue0, pkt2 to vf1 queue0, pkt3 to pf queue0, - pkt4 can't received by pf and vfs. 4. verify rules can be listed and destroyed:: @@ -2042,3 +2032,153 @@ Test case: create different rule after destroy pkt2 = Ether()/IP()/UDP(dport=32)/Raw('x' * 20) verify match pkt2 to queue 2, verify mismatch pkt1 to queue 0. + +Test Case: 10GB Multiple filters +====================================== + +1. config testpmd on DUT + + 1. set up testpmd with Fortville NICs:: + + ./testpmd -l 1,2,3,4,5,6,7,8 -n 4 -- -i --disable-rss --rxq=16 --txq=16 + + 2. verbose configuration:: + + testpmd> set verbose 1 + + 3. PMD fwd only receive the packets:: + + testpmd> set fwd rxonly + + 4. start packet receive:: + + testpmd> start + + 5. create rule,Enable ethertype filter, SYN filter and 5-tuple Filter on the port 0 at same + time. Assigning different filters to different queues on port 0:: + + testpmd> flow validate 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 1 / end + testpmd> flow validate 0 ingress pattern eth type is 0x0806 / end actions queue index 2 / end + testpmd> 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 + testpmd> flow create 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 1 / end + testpmd> flow create 0 ingress pattern eth type is 0x0806 / end actions queue index 2 / end + testpmd> 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 + +2. Configure the traffic generator to send different packets. Such as,SYN packets, ARP packets, IP packets and +packets with(`dst_ip` = 2.2.2.5 `src_ip` = 2.2.2.4 `dst_port` = 1 `src_port` = 1 `protocol` = udp):: + + sendp([Ether(dst="90:e2:ba:36:99:34")/IP(src="192.168.0.1", dst="192.168.0.2")/TCP(dport=80,flags="S")/Raw("x" * 20)],iface="ens224f0",count=1,inter=0,verbose=False) + sendp([Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.1")/Raw("x" * 20)],iface="ens224f0",count=1,inter=0,verbose=False) + sendp([Ether(dst="90:e2:ba:36:99:34")/Dot1Q(prio=3)/IP(src="2.2.2.4",dst="2.2.2.5")/UDP(sport=1,dport=1)],iface="ens224f0",count=1,inter=0,verbose=False) + +3. Verify that all packets are received (RX-packets incremented)on the assigned +queue, remove 5-tuple filter:: + + testpmd> stop + testpmd> start + testpmd> flow destroy 0 rule 2 + +4. Send different packets such as,SYN packets, ARP packets, packets with +(`dst_ip` = 2.2.2.5 `src_ip` = 2.2.2.4 `dst_port` = 1 `src_port` = 1 +`protocol` = udp):: + + testpmd> stop + +5. Verify that different packets are received (RX-packets incremented)on the +assigned queue export 5-tuple filter, remove ethertype filter:: + + testpmd> start + testpmd> flow destroy 0 rule 1 + +Send different packets such as,SYN packets, ARP packets, packets with +(`dst_ip` = 2.2.2.5 `src_ip` = 2.2.2.4 `dst_port` = 1 `src_port` = 1 +`protocol` = udp):: + + testpmd>stop + +Verify that only SYN packets are received (RX-packets incremented)on the +assigned queue set off SYN filter,remove syn filter:: + + testpmd>start + testpmd>flow destroy 0 rule 0 + +Configure the traffic generator to send SYN packets:: + + testpmd>stop + +Verify that the packets are not received (RX-packets do not increased)on the +queue 1. + +Test Case: 128 queues +======================== + +This case is designed for NIC(niantic). Since NIC(niantic) has 128 transmit +queues, it should be supports 128 kinds of filter if Hardware have enough +cores. +DPDK enable 64 queues in ixgbe driver by default. Enlarge queue number to 128 +for 128 queues test:: + + sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h + +Launch the app ``testpmd`` with the following arguments:: + + ./testpmd -l 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53 -n 4 -- -i --disable-rss --rxq=128 --txq=128 --portmask=0x3 --nb-cores=4 --total-num-mbufs=263168 + + testpmd>set stat_qmap rx 0 0 0 + testpmd>set stat_qmap rx 1 0 0 + testpmd>vlan set strip off 0 + testpmd>vlan set strip off 1 + testpmd>vlan set filter off 0 + testpmd>vlan set filter off 1 + +Create the 5-tuple Filters with different queues (64,127) on port 0 for +niantic:: + + testpmd> set stat_qmap rx 0 64 1 + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is 1 src is 1 / end actions queue index 64 / end + testpmd> set stat_qmap rx 0 127 2 + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 2.2.2.5 src is 2.2.2.4 / tcp dst is 2 src is 1 / end actions queue index 127 / end + +Send packets(`dst_ip` = 2.2.2.5 `src_ip` = 2.2.2.4 `dst_port` = 1 `src_port` = +1 `protocol` = tcp) and (`dst_ip` = 2.2.2.5 `src_ip` = 2.2.2.4 `dst_port` = 2 +`src_port` = 1 `protocol` = tcp ). Then reading the stats for port 0 after +sending packets. packets are received on the queue 64 and queue 127 When +setting 5-tuple Filter with queue(128), it will display failure because the +number of queues no more than 128. + +Test Case: jumbo framesize filter +=================================== + +This case is designed for NIC (niantic,I350, 82576 and 82580). Since +``Testpmd`` could transmits packets with jumbo frame size , it also could +transmit above packets on assigned queue. Launch the app ``testpmd`` with the +following arguments:: + + testpmd -l 1,2,3,4,5,6,7,8 -n 4 -- -i --disable-rss --rxq=4 --txq=4 --portmask=0x3 --nb-cores=4 --nb-ports=1 --mbcache=200 --mbuf-size=2048 --max-pkt-len=9600 + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +Enable the syn filters with large size:: + + testpmd> flow validate 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 2 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / tcp flags spec 0x02 flags mask 0x02 / end actions queue index 2 / end + +Configure the traffic generator to send syn packets:: + + sendp([Ether(dst="90:e2:ba:36:99:34")/IP(src="2.2.2.5",dst="2.2.2.4")/TCP(dport=80,flags="S")/Raw(load="P"*8962)],iface="ens224f0",count=1,inter=0,verbose=False) + testpmd> stop + +Then Verify that the packet are received on the queue 2. Configure the traffic generator to send arp packets:: + + testpmd> start + sendp([Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst="192.168.1.1")],iface="ens224f0",count=1,inter=0,verbose=False) + +Then Verify that the packet are not received on the queue 2. Remove the filter:: + + testpmd> flow destroy 0 rule 0 + +Configure the traffic generator to send syn packets. Then Verify that +the packet are not received on the queue 2:: + + testpmd> stop From patchwork Mon Sep 6 17:36:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Xia X-Patchwork-Id: 98078 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7C2B7A0C4D; Mon, 6 Sep 2021 11:05:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73E6B40E32; Mon, 6 Sep 2021 11:05:08 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B7DB740C35 for ; Mon, 6 Sep 2021 11:05:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="219942344" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="219942344" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:05:05 -0700 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="468776723" Received: from unknown (HELO localhost.localdomain) ([10.240.183.102]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:05:04 -0700 From: Yan Xia To: dts@dpdk.org Cc: Yan Xia Date: Mon, 6 Sep 2021 17:36:41 +0000 Message-Id: <20210906173641.24071-1-yanx.xia@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1 3/3] conf/test_case_checklist: add and modify not support NIC of test cases X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" add and modify not support NIC of test cases about legcay command Signed-off-by: Yan Xia --- conf/test_case_checklist.json | 42 ++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/conf/test_case_checklist.json b/conf/test_case_checklist.json index 8cd47dd1..27def487 100644 --- a/conf/test_case_checklist.json +++ b/conf/test_case_checklist.json @@ -108,14 +108,49 @@ "Comments": "the nic not support this case" } ], + "dual_vlan": [ + { + "OS": [ + "ALL" + ], + "NIC": [ + "niantic", + "kawela_4", + "springville", + "ironpond", + "springfountain", + "twinpond", + "cavium_a034", + "cavium_a011", + "fortpark_TLV", + "fortpark_BASE-T", + "foxville", + "columbiaville_25g", + "columbiaville_100g" + ], + "Target": [ + "ALL" + ], + "Bug ID": "", + "Comments": "the nic not support this case" + } + ], "jumbo_frame_size": [ { "OS": [ "ALL" ], "NIC": [ + "fortville_25g", + "fortville_eagle", + "fortville_spirit", "fortville_spirit_single", "springville", + "ironpond", + "springfountain", + "twinpond", + "cavium_a034", + "cavium_a011", "fortpark_TLV", "fortpark_BASE-T", "carlsville" @@ -136,6 +171,9 @@ "kawela_4", "bartonhills", "powerville", + "fortville_25g", + "fortville_eagle", + "fortville_spirit", "fortville_spirit_single", "springville", "ironpond", @@ -146,7 +184,9 @@ "fortpark_TLV", "fortpark_BASE-T", "carlsville", - "foxville" + "columbiaville_25g", + "columbiaville_100g", + "foxville" ], "Target": [ "ALL"