From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DEA02A0518; Fri, 24 Jul 2020 04:35:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D11E01D609; Fri, 24 Jul 2020 04:35:03 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0265F1D608 for ; Fri, 24 Jul 2020 04:35:01 +0200 (CEST) IronPort-SDR: 7aR8JNSyubgPSl8j7hHY0sECfaddr/YwNQJzkF5Z2JGQAEHlNdlk75mDoO9NHqj7ph8WfbJdOT nMdmV1F90RMA== X-IronPort-AV: E=McAfee;i="6000,8403,9691"; a="130725144" X-IronPort-AV: E=Sophos;i="5.75,389,1589266800"; d="scan'208";a="130725144" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2020 19:35:00 -0700 IronPort-SDR: GTC/S8OMG4CGeCQWfPdzPvpaJ7O/V8qqOudm8a+cn7GaDYI37lE2I15ryzlKZEcy1/oLwW1p8S JX0oTSALXVHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,389,1589266800"; d="scan'208";a="284792524" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 23 Jul 2020 19:35:00 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jul 2020 19:35:00 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 23 Jul 2020 19:34:57 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 23 Jul 2020 19:34:57 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.22]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.32]) with mapi id 14.03.0439.000; Fri, 24 Jul 2020 10:34:54 +0800 From: "Tu, Lijuan" To: Owen Hilyard , "dts@dpdk.org" CC: "Zhang, Qi Z" , "matan@mellanox.com" , "stephen@networkplumber.org" , "jerinj@marvell.com" , "suanmingm@mellanox.com" , "thomas@monjalon.net" , "lylavoie@iol.unh.edu" Thread-Topic: [dts] [PATCH] mac_filter: Add multicast filtering test case Thread-Index: AQHWW6mHP5/3G1P1806k1lcuDQbuk6kQCU+AgAYFLfA= Date: Fri, 24 Jul 2020 02:34:53 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC84088@SHSMSX101.ccr.corp.intel.com> References: <20200716194237.137641-1-ohilyard@iol.unh.edu> <20200720143803.212272-1-ohilyard@iol.unh.edu> In-Reply-To: <20200720143803.212272-1-ohilyard@iol.unh.edu> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH] mac_filter: Add multicast filtering test case 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" Applied with comment changed. > -----Original Message----- > From: dts On Behalf Of Owen Hilyard > Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B20=1B$BF|=1B(B 22:38 > To: dts@dpdk.org > Cc: Zhang, Qi Z ; matan@mellanox.com; > stephen@networkplumber.org; jerinj@marvell.com; > suanmingm@mellanox.com; ohilyard@iol.unh.edu; thomas@monjalon.net; > lylavoie@iol.unh.edu > Subject: [dts] [PATCH] mac_filter: Add multicast filtering test case >=20 > Sorry about sending this twice, I noticed after todays meeting that this = was > caught in the moderator queue and I want to get it out to the mailing lis= t at > large asap. >=20 > add multicast filtering test case > add multicast test case test plan >=20 > Signed-off-by: Owen Hilyard > --- > test_plans/mac_filter_test_plan.rst | 27 ++++++++++++++++++++ > tests/TestSuite_mac_filter.py | 39 ++++++++++++++++++++++++++--- > 2 files changed, 62 insertions(+), 4 deletions(-) >=20 > diff --git a/test_plans/mac_filter_test_plan.rst > b/test_plans/mac_filter_test_plan.rst > index 1335e9f..e8a4f66 100644 > --- a/test_plans/mac_filter_test_plan.rst > +++ b/test_plans/mac_filter_test_plan.rst > @@ -172,3 +172,30 @@ Add one more different address:: > testpmd> mac_addr add 0 >=20 > Verify that the response is "No space left on device" (-ENOSPC) > + > +Test Case: Multicast Filter > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > + > +Initialize first port without ``promiscuous mode``:: > + > + testpmd> set promisc 0 off > + > + > +Add the multicast MAC address to the multicast filter:: > + > + testpmd> mcast_addr add 0 01:00:5E:00:00:00 > + > +Send a packet with multicast destination MAC address to port 0:: > + > + port 0/queue 0: received 1 packets > + src=3D52:00:00:00:00:00 - dst=3D01:00:5E:00:00:00 - type=3D0x0800 -= length=3D60 - > nb_segs=3D1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_UDP - sw > ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=3D14 - l3_len=3D20 - l4_len=3D8 = - Receive > queue=3D0x0 > + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD > + PKT_RX_OUTER_L4_CKSUM_UNKNOWN > + > + > +Remove the multicast MAC address from the multicast filter:: > + > + testpmd> mcast_addr remove 0 01:00:5E:00:00:00 > + > +Send a packet with multicast destination MAC address to port 0 > + > +Verify that the packet was not received (Check for "received" in the out= put). > There will be no output if the nic responds properly. > \ No newline at end of file > diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.p= y index > 9912d23..b762c91 100644 > --- a/tests/TestSuite_mac_filter.py > +++ b/tests/TestSuite_mac_filter.py > @@ -82,14 +82,18 @@ class TestMacFilter(TestCase): > """ > pass >=20 > - def whitelist_send_packet(self, portid, destMac=3D"00:11:22:33:44:55= "): > + def whitelist_send_packet(self, portid, destMac=3D"00:11:22:33:44:55= ", > count=3D-1): > """ > Send 1 packet to portid. > """ > + # You can't have an optional parameter use a class attribute as = it's default > value > + if count =3D=3D -1: > + count =3D self.frames_to_send > + > itf =3D self.tester.get_interface(self.tester.get_local_port(por= tid)) > pkt =3D Packet(pkt_type=3D'UDP') > pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst': de= stMac}) > - pkt.send_pkt(self.tester, tx_port=3Ditf, count=3D4) > + pkt.send_pkt(self.tester, tx_port=3Ditf, count=3Dcount) >=20 > def test_add_remove_mac_address(self): > """ > @@ -119,7 +123,7 @@ class TestMacFilter(TestCase): > out =3D self.dut.get_session_output() > # check the packet DO NOT increase > self.verify("received" not in out, > - "Packet has been received on a new MAC address that = has not been > added yet") > + "Packet has been received on a new MAC address that > + has been removed from the port") >=20 > # add the different MAC address > self.dut.send_expect("mac_addr add %d" % portid + " %s" % > fake_mac_addr, "testpmd>") @@ -128,7 +132,7 @@ class > TestMacFilter(TestCase): > out =3D self.dut.get_session_output() > cur_rxpkt =3D utils.regexp(out, "received ([0-9]+) packets") > # check the packet increase > - self.verify(int(cur_rxpkt)*self.frames_to_send =3D=3D self.frame= s_to_send, > + self.verify(int(cur_rxpkt) * self.frames_to_send =3D=3D > + self.frames_to_send, > "Packet has not been received on a new MAC address t= hat has been > added to the port") >=20 > # remove the fake MAC address > @@ -176,6 +180,33 @@ class TestMacFilter(TestCase): >=20 > self.verify("No space left on device" in out, "added 1 address m= ore than > max MAC addresses") >=20 > + def test_multicast_filter(self): > + """ > + Add mac address and check packet can received > + Remove mac address and check packet can't received > + """ > + # initialise first port without promiscuous mode > + mcast_addr =3D "01:00:5E:00:00:00" > + portid =3D self.dutPorts[0] > + self.dut.send_expect(f"set promisc {portid:d} off", "testpmd> ") > + self.dut.send_expect("clear port stats all", "testpmd> ") > + > + self.dut.send_expect(f"mcast_addr add {portid:d} {mcast_addr}", > "testpmd>") > + self.whitelist_send_packet(portid, mcast_addr, count=3D1) > + time.sleep(1) > + out =3D self.dut.get_session_output() > + self.verify("received" in out, > + "Packet has not been received when it should have > + on a broadcast address") > + > + self.dut.send_expect(f"mcast_addr remove {portid:d} {mcast_addr}= ", > "testpmd>") > + self.whitelist_send_packet(portid, mcast_addr, count=3D1) > + time.sleep(1) > + out =3D self.dut.get_session_output() > + self.verify("received" not in out, > + "Packet has been received when it should have > + ignored the broadcast") > + > + self.dut.send_expect("stop", "testpmd> ") > + > def tear_down(self): > """ > Run after each test case. > -- > 2.25.1