From patchwork Mon Apr 17 17:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 126169 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 06D4A4296B; Mon, 17 Apr 2023 11:24:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02EA6410EA; Mon, 17 Apr 2023 11:24:24 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 12DFB40144 for ; Mon, 17 Apr 2023 11:24:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681723462; x=1713259462; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DTxGgg+LL+xPeFWAXop+V/BSufA1QyhiGnNJkdWsjLk=; b=Aaxc7Eg0ESVHnsKOTScqOUx0p0sJjulO4xp5UJHNAu90KQLaW87/lb2u iF+9EAqFLhiIioScqN24OUUF77IHPNx41UjJpHcUIbqEqaNtC4M4fe6+x ABWESbVKAaciNaMUH90ZZl4fXhFlbB7GZuBlQqDzzDVcdgvznJrePqooH 3foQjP9oLH0UwQNF/myewbNHub9Hn9fJ1XNejHggQRUPd25wg+DHwyFH8 cTn6syfaxuQFXLKB+gZXNZAd9HNPu6hve4vEPqxrSBP4JF/Yx6rD+9kb+ PoUL0C1J/mAGX0HH81DaPjzJpwvHaH8Ygc2TPM37rxAa6t+NL0X9Ao9kX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="333642301" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="333642301" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="640897816" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="640897816" Received: from unknown (HELO localhost.localdomain) ([10.239.252.96]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:20 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 1/4] test_plans/kernelpf_iavf: add testing steps to test vlan priority value Date: Mon, 17 Apr 2023 17:41:52 +0000 Message-Id: <20230417174155.146540-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230417174155.146540-1-songx.jiale@intel.com> References: <20230417174155.146540-1-songx.jiale@intel.com> MIME-Version: 1.0 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 add testing steps to test vlan priority value. Signed-off-by: Jiale Song --- test_plans/kernelpf_iavf_test_plan.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test_plans/kernelpf_iavf_test_plan.rst b/test_plans/kernelpf_iavf_test_plan.rst index cab1106f..ed6d9488 100644 --- a/test_plans/kernelpf_iavf_test_plan.rst +++ b/test_plans/kernelpf_iavf_test_plan.rst @@ -391,7 +391,7 @@ Test case: IAVF DUAL VLAN filtering 3. tester send qinq pkt and single vlan pkt which outer vlan id is 1 to VF:: - sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0") + sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100,prio=1)/Dot1Q(vlan=2,type=0x0800,prio=2)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0") sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0") 4. check the pkts can't be received in VF, but if the kernel cannot set ``vf-vlan-pruning``, check can receive 2 pkts in VF. @@ -402,6 +402,7 @@ Test case: IAVF DUAL VLAN filtering 6. repeat step 3, check the pkts can be received by VF and fwd to tester:: + check the pkts can be received by PF and fwd to tester with inner and outer correct vlan ID and priority value. testpmd> port 0/queue 0: received 1 packets src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN - l2_len=18 - inner_l2_len=4 - Receive queue=0x0 ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN @@ -411,15 +412,15 @@ Test case: IAVF DUAL VLAN filtering tcpdump -i ens786f0 -nn -e -v - 16:50:38.807158 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype 0x0800, - 16:50:38.807217 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype 0x0800, + 16:50:38.807158 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 1, ethertype 802.1Q, vlan 2, p 2, ethertype 0x0800, + 16:50:38.807217 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 1, ethertype 802.1Q, vlan 2, p 2, ethertype 0x0800, 16:51:06.083084 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype 0x0800, 16:51:06.083127 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype 0x0800, 7. tester send qinq pkt and single vlan pkt which outer vlan id is 11 to VF:: - sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0") + sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x8100,prio=1)/Dot1Q(vlan=2,type=0x0800,prio=2)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0") sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0") 8. check the pkts can not be received by VF. From patchwork Mon Apr 17 17:41:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 126170 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 2BC984296C; Mon, 17 Apr 2023 11:24:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27CFE42B8C; Mon, 17 Apr 2023 11:24:25 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6FABE40144 for ; Mon, 17 Apr 2023 11:24:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681723463; x=1713259463; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=spC9K2FevmmpO5rhqR6QJFIOwUtaTA6bc002UCbwxjs=; b=BiRnsX5DFSWE1jUlpb9ADHHUvo/+5UJhj6v4UWVLUuh9O5YMzN2fiiGf 8XL3gzYbYcVSrH8Qgcbm51XBZcecnOxeZyzutFuxFlJvH72nDzTq3KnBB l6tgbLdFQf4In88SyBabDAfsVJ6RQ8+/2DX680dC33DbB5gw0qwaICoGq 05Jr0+HuF69CSuK4/LR86bxLCKXYiJ74D1lZ8yeMOOCaQ0KOpiaoXENRr D2/xuTn384n45zF2y4x78pWJlqmz9JpSCP9ryXwMd+wGpgjEqRnF97bdQ buLIOswT+CjH9rQANw1QakjSbThOSaWsjymp2egySSozEPhMFgU4cr+JN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="333642302" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="333642302" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="640897825" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="640897825" Received: from unknown (HELO localhost.localdomain) ([10.239.252.96]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:21 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 2/4] tests/kernelpf_iavf: add testing steps to test vlan priority value Date: Mon, 17 Apr 2023 17:41:53 +0000 Message-Id: <20230417174155.146540-3-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230417174155.146540-1-songx.jiale@intel.com> References: <20230417174155.146540-1-songx.jiale@intel.com> MIME-Version: 1.0 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 1. add testing steps to test vlan priority value. 2. modify test scripts to support i40e nic. Signed-off-by: Jiale Song --- tests/TestSuite_kernelpf_iavf.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index 6b6c573c..c69b8748 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -128,10 +128,9 @@ class TestKernelpfIavf(TestCase): self.verify(res, "%s link status is down" % self.host_intf) out = self.dut.send_expect("ethtool %s" % self.host_intf, "#") self.speed = int(re.findall("Speed: (\d*)", out)[0]) // 1000 - if self.is_eth_series_nic(800): - self.dut.send_expect( - "ip link set %s vf 0 spoofchk off" % (self.host_intf), "# " - ) + self.dut.send_expect( + "ip link set %s vf 0 spoofchk off" % (self.host_intf), "# " + ) if self.running_case == "test_vf_multicast": self.dut.send_expect( "ethtool --set-priv-flags %s vf-true-promisc-support on" @@ -849,14 +848,13 @@ class TestKernelpfIavf(TestCase): packets = len(re.findall("received 1 packets", out)) self.verify(packets == 10, "Not receive expected packet") - @check_supported_nic(ice_nic) def test_iavf_dual_vlan_filter(self): """ Test case: IAVF DUAL VLAN filtering """ self.skip_case(not self.dcf_mode, "the case not support dcf mode") pkt_list1 = [ - 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' + 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100,prio=1)/Dot1Q(vlan=2,type=0x0800,prio=2)/IP(src="196.222.232.221")/("X"*480)' % self.vf_mac, 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf_mac, @@ -888,8 +886,16 @@ class TestKernelpfIavf(TestCase): tcpdump_out = self.get_tcpdump_package() receive_pkt = re.findall("dst=%s" % self.vf_mac, out) self.verify(len(receive_pkt) == 2, "Failed error received vlan packet!") - tester_pkt = re.findall("vlan \d+", tcpdump_out) - self.verify(len(tester_pkt) == 6, "Failed pass received vlan packet!") + tester_pkt = re.findall("vlan\s+\d+, p\s+\d+", tcpdump_out) + vlan_prio_1 = re.findall("vlan\s+\d+, p\s+1", tcpdump_out) + vlan_prio_2 = re.findall("vlan\s+\d+, p\s+2", tcpdump_out) + self.verify(len(tester_pkt) == 6, "Received incorrect vlan packet!") + self.verify( + len(vlan_prio_1) == 2, "Received incorrect priority 1 vlan packet!!" + ) + self.verify( + len(vlan_prio_2) == 2, "Received incorrect priority 2 vlan packet!!!" + ) out = self.send_pkts_getouput(self.tester_intf, pkt_list2) receive_pkt = re.findall("dst=%s" % self.vf_mac, out) @@ -903,7 +909,6 @@ class TestKernelpfIavf(TestCase): else: self.verify(len(receive_pkt) == 2, "Failed error received vlan packet!") - @check_supported_nic(ice_nic) def test_iavf_dual_vlan_strip(self): """ Test case: IAVF DUAL VLAN header stripping @@ -1047,7 +1052,6 @@ class TestKernelpfIavf(TestCase): return [] return value_list - @check_supported_nic(ice_nic) def test_iavf_dual_vlan_insert(self): """ Test case: IAVF DUAL VLAN header insertion From patchwork Mon Apr 17 17:41:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 126171 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 53B174296B; Mon, 17 Apr 2023 11:24:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E698410E4; Mon, 17 Apr 2023 11:24:27 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 0054140144 for ; Mon, 17 Apr 2023 11:24:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681723465; x=1713259465; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fx0oVAZjz7MypWS/Yd2TvS0vos/udtKhko88esSBF5I=; b=ajs0Zs1U+eQWG+F/0RmrU7vAZarnrAArOy3uDOAn/PoOUUP7ARhqqbYM 5gikYyXtM0Pbx9TGZx+3KVQbX9B5IddRfbHlZ3PhW75enpwmiTMxKbTXG vsrtlA6w/AOkuvMKD9XYY+SoJwAz5pfjc3IPTn9oCofrJFRsTsUVeaFJ2 22/DgT4WHqzQ/MfmNyQT6uOrHywSFn8jgDO49rJp8yps0fDPCVfOwxsAn u+s+kRgIZMYE1+elctczocfzwUPbSNcduV3GpQSNIXDU59PEL+ccnG8SY 30uo0+ZHwMtvLghIXvcCd74QBFzhrMYlDnq/vZ3Mm6soAlRQZHTk/mBbB w==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="333642304" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="333642304" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="640897829" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="640897829" Received: from unknown (HELO localhost.localdomain) ([10.239.252.96]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:23 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 3/4] test_plans/dual_vlan: add a case to test vlan priority value Date: Mon, 17 Apr 2023 17:41:54 +0000 Message-Id: <20230417174155.146540-4-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230417174155.146540-1-songx.jiale@intel.com> References: <20230417174155.146540-1-songx.jiale@intel.com> MIME-Version: 1.0 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 Signed-off-by: Jiale Song --- test_plans/dual_vlan_test_plan.rst | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test_plans/dual_vlan_test_plan.rst b/test_plans/dual_vlan_test_plan.rst index 11dfa332..e8e54eac 100644 --- a/test_plans/dual_vlan_test_plan.rst +++ b/test_plans/dual_vlan_test_plan.rst @@ -445,3 +445,40 @@ Choose the above table's item randomly 30 times and verify that the result is ri At last, stop packet forwarding and quit the application:: testpmd> stop testpmd> quit + +Test Case: dual vlan priority rx/tx test +======================================== + +#. blind port to vfio-pci:: + + ./usertools/dpdk-devbind.py -b vfio-pci {pf0_pci} {pf1_pci} + +#. launch testpmd with NICs:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -a {pf0_pci} -a {pf1_pci} -n 4 -- -i + +#. set testpmd:: + + testpmd> set verbose 1 + testpmd> set fwd mac + testpmd> start + +#. start tcpdump with tester rx port:: + + tcpdump -ei {rx_iface} + +#. send dual vlan packet with tester tx port:: + + sendp(Ether(dst="FE:EF:65:4C:2C:D0",type=0x8100)/Dot1Q(vlan=1,type=0x8100,prio=1)/Dot1Q(vlan=2,type=0x0800,prio=2)/IP(src="196.222.232.221")/("X"*480),iface="{tx_iface}",count=1,inter=0,verbose=False) + +#. check the pkts can be received:: + + testpmd> port 0/queue 0: received 1 packets + src=00:00:00:00:00:00 - dst=FE:EF:65:4C:2C:D0 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN - l2_len=18 - inner_l2_len=4 - Receive queue=0x0 + ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN + +#. check the tcpdump packet:: + + check the pkts can be received by PF and fwd to tester with inner and outer correct vlan ID and priority value. + 16:50:38.807217 FE:EF:65:4C:2C:D0 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 1, ethertype 802.1Q, vlan 2, p 2, ethertype 0x0800, + From patchwork Mon Apr 17 17:41:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 126172 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 7A8D74296C; Mon, 17 Apr 2023 11:24:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 737EF42C24; Mon, 17 Apr 2023 11:24:27 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 89D5B40144 for ; Mon, 17 Apr 2023 11:24:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681723466; x=1713259466; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tDcJXC024CZpJ36l/s/YMJBCicBb0sAX8r4+SWpdEfM=; b=Kb3WeHc5g2BE5vetOfJEjYSPaHP+Db/SdGcw3OXOSlPhs4Ota06jq3Wv 862ywt5Q+ij8OhdwAun37pzmABmTOh3zIn82rUJSbJC4vQtUKjXp/W47l jo7BfL4n+bOcume1lizPm2z4JkN5AKiGuxEKO0eUPGs53Iznc7iK4w6zV HhZNBq4Q96igKN+bC3V2uyAFPiESWWuWPBWiFUDu3o5eyhMHXmjP0Hf6a pRciZpNPhaQB4Y1E0K9a0bp9qwkcYR8ZGDF1S99asgH2E+3Dos/Rhl8NC fNWWV3ksVWOY/YISmEE+NXM61dHmGmmLoEAVd/mBzWQXtcR+VTeWt6koh Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="333642310" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="333642310" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="640897833" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="640897833" Received: from unknown (HELO localhost.localdomain) ([10.239.252.96]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 02:24:24 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 4/4] tests/dual_vlan: add a case to test vlan priority value Date: Mon, 17 Apr 2023 17:41:55 +0000 Message-Id: <20230417174155.146540-5-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230417174155.146540-1-songx.jiale@intel.com> References: <20230417174155.146540-1-songx.jiale@intel.com> MIME-Version: 1.0 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 add a case to test vlan priority value. Signed-off-by: Jiale Song Acked-by: Yuan Peng Acked-by: Lijuan Tu --- tests/TestSuite_dual_vlan.py | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/TestSuite_dual_vlan.py b/tests/TestSuite_dual_vlan.py index 70395663..59b39eb3 100644 --- a/tests/TestSuite_dual_vlan.py +++ b/tests/TestSuite_dual_vlan.py @@ -14,6 +14,7 @@ import re import time import framework.utils as utils +from framework.packet import Packet from framework.pmd_output import PmdOutput from framework.test_case import TestCase @@ -68,6 +69,7 @@ class TestDualVlan(TestCase): out = self.dut.send_expect("set fwd mac", "testpmd> ") self.verify("Set mac packet forwarding mode" in out, "set fwd mac error") + self.dut.send_expect("set verbose 1", "testpmd> ") out = self.dut.send_expect("start", "testpmd> ", 120) # Vlan id @@ -387,6 +389,25 @@ class TestDualVlan(TestCase): for line in resultList: self.verify(line in out, "receive packet is wrong:%s" % out) + def send_pkts_get_testpmd_tcpdump_output( + self, dut_rx_port, dut_tx_port, pkts, count=1 + ): + tester_tx_port = self.tester.get_local_port(dut_rx_port) + tester_tx_port_iface = self.tester.get_interface(tester_tx_port) + tester_rx_port = self.tester.get_local_port(dut_tx_port) + tester_rx_port_ifac = self.tester.get_interface(tester_rx_port) + self.start_tcpdump(tester_rx_port_ifac) + self.pkt = Packet() + self.pkt.update_pkt(pkts) + self.pkt.send_pkt(crb=self.tester, tx_port=tester_tx_port_iface, count=count) + time.sleep(1) + out = self.pmdout.get_output() + port_stats = self.pmdout.execute_cmd("show port stats all") + self.pmdout.execute_cmd("clear port stats all") + pmd_out = out + port_stats + tcpdump_out = self.get_tcpdump_package() + return pmd_out, tcpdump_out + def set_up(self): """ Run before each test case. @@ -674,6 +695,32 @@ class TestDualVlan(TestCase): rand = random.randint(0, 15) self.multimode_test(rand) + def test_dual_vlan_priority_rxtx(self): + """ + Test Case: dual vlan priority rx/tx test + """ + mac = self.dut.get_mac_address(dutRxPortId) + pkts = [ + 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100,prio=1)/Dot1Q(vlan=2,type=0x0800,prio=2)/IP(src="196.222.232.221")/("X"*480)' + % mac, + ] + self.mode_config(filter="off", extend="off", strip="off") + pmd_output, tcpdump_out = self.send_pkts_get_testpmd_tcpdump_output( + dutRxPortId, dutTxPortId, pkts, count=1 + ) + receive_pkt = re.findall("(?i)dst=%s" % mac, pmd_output) + self.verify(len(receive_pkt) == 1, "Failed error received vlan packet!") + tester_pkt = re.findall("vlan\s+\d+, p\s+\d+", tcpdump_out) + vlan_prio_1 = re.findall("vlan\s+\d+, p\s+1", tcpdump_out) + vlan_prio_2 = re.findall("vlan\s+\d+, p\s+2", tcpdump_out) + self.verify(len(tester_pkt) == 2, "Received incorrect vlan packet!") + self.verify( + len(vlan_prio_1) == 1, "Received incorrect priority 1 vlan packet!!" + ) + self.verify( + len(vlan_prio_2) == 1, "Received incorrect priority 2 vlan packet!!!" + ) + def tear_down(self): """ Run after each test case.