From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0AED3A0096 for ; Tue, 4 Jun 2019 10:38:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E22331BACA; Tue, 4 Jun 2019 10:38:09 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1E11F1B9B7 for ; Tue, 4 Jun 2019 10:38:09 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x548XCvh012487 for ; Tue, 4 Jun 2019 01:38:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=mJD0mD6bytfVrAhqDjmH2ztDSs1THQXs9DmKhel48KI=; b=Bt8s2VcndI3PFOTYMDLf8A2hrzke9tfYrZT78Wt0ECLZATxPsN3e1AyoV+Fps+ItW7Un FfBa0lo3LAOmEw2p+s4OzD0QtICfX8rCxTP+SsHyde1jtlTWFanGsaHRSsaq7RPfXr3K LJb+pUTjuwtOU3bGxnBDc6XTFqUZ7t3ywMoPob+lTwxZrZbZCvKtr5eyNWfGaX78Rqe+ XXGQhzTj92CwiWV7xtt2OvS0miqpgR98RBexhHniEUKR4c1RqGWgdjMhuibKCTBPoPYs 70+2JlwJNcrLNyozbBk3EtDW9zK7iKaSbOlW4JF8vuaP5bBDF9d1wS/yDQdfNKa7g0I1 ZQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2swejx9etq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 04 Jun 2019 01:38:08 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 4 Jun 2019 01:38:07 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 4 Jun 2019 01:38:07 -0700 Received: from localhost.marvell.com (unknown [10.28.10.195]) by maili.marvell.com (Postfix) with ESMTP id EF76A3F7044; Tue, 4 Jun 2019 01:38:05 -0700 (PDT) From: To: CC: , , Praneeth Reddy Date: Tue, 4 Jun 2019 14:08:03 +0530 Message-ID: <1559637483-4193-1-git-send-email-nareddy@marvell.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-04_07:, , signatures=0 Subject: [dts] [PATCH] TestSuite_userspace_ethtool.py: Modified send packet count to support vector mode X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" From: Praneeth Reddy In vector mode minimum of 4 packets are required to forward. Added packet count as 4 whenever sending a packet from scapy. Signed-off-by: Praneeth Reddy --- tests/TestSuite_userspace_ethtool.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py index f8428ea..6c19f75 100644 --- a/tests/TestSuite_userspace_ethtool.py +++ b/tests/TestSuite_userspace_ethtool.py @@ -297,10 +297,10 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) ori_rx_pkts, ori_tx_pkts = self.strip_portstats(port) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) time.sleep(1) rx_pkts, tx_pkts = self.strip_portstats(port) - self.verify((rx_pkts == (ori_rx_pkts + 1)), "Failed to record Rx/Tx packets") + self.verify((rx_pkts == (ori_rx_pkts + 4)), "Failed to record Rx/Tx packets") self.dut.send_expect("quit", "# ") # Check port link down verification result @@ -412,9 +412,9 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): pkt = Packet() tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) rx_pkts, tx_pkts = self.strip_portstats(index) - self.verify(rx_pkts == ori_rx_pkts + 1, "Failed to forward after ring parameter changed") + self.verify(rx_pkts == ori_rx_pkts + 4, "Failed to forward after ring parameter changed") self.dut.send_expect("quit", "# ") def test_ethtool_vlan(self): @@ -444,15 +444,15 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): pkt.config_layer('vlan', {'vlan': vlan}) tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) rx_pkts, tx_pkts = self.strip_portstats(port) - self.verify(rx_pkts == ori_rx_pkts + 1, "Failed to Rx vlan packet") - self.verify(tx_pkts == ori_tx_pkts + 1, "Failed to Tx vlan packet") + self.verify(rx_pkts == ori_rx_pkts + 4, "Failed to Rx vlan packet") + self.verify(tx_pkts == ori_tx_pkts + 4, "Failed to Tx vlan packet") # send incorrect vlan packet to port wrong_vlan = (vlan + 1) % 4096 pkt.config_layer('vlan', {'vlan': wrong_vlan}) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) time.sleep(2) rx_pkts_wrong, tx_pkts_wrong = self.strip_portstats(port) self.verify(tx_pkts_wrong == rx_pkts, "Failed to filter Rx vlan packet") @@ -461,7 +461,7 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): self.dut.send_expect("vlan %d del %d" % (index, vlan), "EthApp>") # send same packet and make sure not received pkt.config_layer('vlan', {'vlan': vlan}) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) time.sleep(2) rx_pkts_del, tx_pkts_del = self.strip_portstats(port) self.verify(tx_pkts_del == rx_pkts, "Failed to remove Rx vlan filter") @@ -491,9 +491,9 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): intf = self.tester.get_interface(tester_port) # send and sniff packet inst = self.tester.tcpdump_sniff_packets(intf, timeout=5) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) pkts = self.tester.load_tcpdump_sniff_packets(inst) - self.verify(len(pkts) == 1, "Packet not forwarded as expected") + self.verify(len(pkts) == 4, "Packet not forwarded as expected") src_mac = pkts[0].strip_layer_element("layer2", "src") self.verify(src_mac == valid_mac, "Forwarded packet not match default mac") @@ -525,7 +525,7 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): pkt = Packet() tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) rx_pkts, tx_pkts = self.strip_portstats(index) self.verify(rx_pkts == ori_rx_pkts, "Failed to stop port") # restart port and check packet can normally forwarded @@ -534,10 +534,10 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): # wait few time for port ready rx_pkts, tx_pkts = self.strip_portstats(index) time.sleep(2) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) rx_pkts_open, tx_pkts_open = self.strip_portstats(index) - self.verify(rx_pkts_open == rx_pkts + 1, "Failed to reopen port rx") - self.verify(tx_pkts_open == tx_pkts + 1, "Failed to reopen port tx") + self.verify(rx_pkts_open == rx_pkts + 4, "Failed to reopen port rx") + self.verify(tx_pkts_open == tx_pkts + 4, "Failed to reopen port tx") self.dut.send_expect("quit", "# ") @@ -565,11 +565,11 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): ori_rx_pkts, _ = self.strip_portstats(index) pkt_size = mtu + HEADER_SIZE['eth'] pkt = Packet(pkt_len=pkt_size) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) rx_pkts, _ = self.strip_portstats(index) self.verify(rx_pkts == ori_rx_pkts + 1, "Packet match mtu not forwarded as expected") pkt = Packet(pkt_len=mtu + 1 + HEADER_SIZE['eth']) - pkt.send_pkt(tx_port=intf) + pkt.send_pkt(tx_port=intf, count=4) rx_pkts_over, _ = self.strip_portstats(index) self.verify(rx_pkts == rx_pkts_over, "Packet over mtu should not be forwarded") -- 1.8.3.1