From patchwork Fri Dec 9 07:08:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 120687 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 D81A9A0093; Fri, 9 Dec 2022 09:04:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1BFB427EE; Fri, 9 Dec 2022 09:04:58 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 5F105427EE for ; Fri, 9 Dec 2022 09:04:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670573096; x=1702109096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+HhOKBhtZFM9iX8KMb1dIIzS+H7/sLSA49bt29ON1qI=; b=JP9S5NGBRpNZHE367xm6Qu1trC/G0AYgaN9/oFUZihQulHXQjZ+To+Jr EFeBWe3lEnw5VWYlcyI1U1/0v4KCi69HidnOZTN00kcpz5VjTUuWhQl/N nILBZWP2JkGBcrdmfHDMD4F8cKDdwA6o9BXIC+3POZmjcMkdh07QkVWuH 8PqKTkhz+KutDLwqytGdTYzPxo06ZJD9jPShMcRUmsuKH5aD1yzmnydJi l0N9krYSxkhlJOp92B/nN82zup5wEfQ1sURme1vhHFiiE3nPJkAIro/Cc rvTawnEVowP2MY1scOdEVAPEfeuGaFAWK85tO2IAILoxhT1jeKxj9S8IV w==; X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="305051958" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="305051958" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:04:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="678074561" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="678074561" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:04:53 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V2 1/5] test_plans/generic_flow_api: add pf action subcase Date: Fri, 9 Dec 2022 02:08:03 -0500 Message-Id: <20221209070807.1134-2-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209070807.1134-1-linglix.chen@intel.com> References: <20221209070807.1134-1-linglix.chen@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. According to dpdk commit 5007ac1318 (ethdev: remove deprecated Flow Director configuration) remove --pkt-filter-mode. 2. This dpdk commit (5007ac1318) also removed '--pkt-filter-report-hash', so test_fdir_for_match_report no need test on NNT. 3. add 5 pf action subcase (bind the pf to vfio-pci). 4. According to dpdk commit 5c45fde3e9 (ethdev: remove deprecated flow item VF) remove fdir_wrong_parameters case create vf rule part. Signed-off-by: Lingli Chen --- V2: modify structure of testplan test_plans/generic_flow_api_test_plan.rst | 419 ++++++++++++++-------- 1 file changed, 274 insertions(+), 145 deletions(-) diff --git a/test_plans/generic_flow_api_test_plan.rst b/test_plans/generic_flow_api_test_plan.rst index 2da0c9f5..204d705f 100644 --- a/test_plans/generic_flow_api_test_plan.rst +++ b/test_plans/generic_flow_api_test_plan.rst @@ -17,7 +17,7 @@ Prerequisites 3. bind the pf to dpdk driver:: - ./usertools/dpdk-devbind.py -b igb_uio 05:00.0 + ./usertools/dpdk-devbind.py -b igb_uio/vfio-pci 05:00.0 Note: validate the rules first before create it in each case. All the rules that can be validated correctly should be created successfully. @@ -70,7 +70,7 @@ Test case: Intel® Ethernet 700 Series fdir for L2 payload 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -104,7 +104,7 @@ Test case: Intel® Ethernet 700 Series fdir for flexbytes 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -179,6 +179,9 @@ Test case: Intel® Ethernet 700 Series fdir for flexbytes Test case: Intel® Ethernet 700 Series fdir for ipv4 =================================================== +Subcase1: fdir for ipv4 (bind the pf to igb_uio) +------------------------------------------------ + Prerequisites: add two vfs on dpdk pf, then bind the vfs to vfio-pci:: @@ -188,17 +191,17 @@ Test case: Intel® Ethernet 700 Series fdir for ipv4 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e0000 -n 4 -a 05:02.0 --file-prefix=vf0 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e0000 -n 4 -a 05:02.0 --file-prefix=vf0 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e00000 -n 4 -a 05:02.1 --file-prefix=vf1 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e00000 -n 4 -a 05:02.1 --file-prefix=vf1 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -280,10 +283,75 @@ Test case: Intel® Ethernet 700 Series fdir for ipv4 testpmd> flow flush 0 testpmd> flow list 0 +Subcase2: fdir for ipv4 (bind the pf to vfio-pci) +------------------------------------------------- + +1. Launch the app ``testpmd`` with the following arguments:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +2. validate and create the filter rules:: + + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 157.141.168.166 src is 86.233.197.55 proto is 255 / end actions queue index 2 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 144.91.80.195 src is 244.178.159.128 ttl is 131 / udp dst is 63365 src is 62851 / end actions queue index 2 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 38.114.30.109 src is 42.1.193.75 tos is 93 / tcp dst is 9460 src is 58942 / end actions queue index 3 / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 3691 / ipv4 dst is 58.172.170.63 src is 203.118.95.141 tos is 211 ttl is 56 / sctp dst is 51725 src is 43652 tag is 1 / end actions queue index 8 / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 434 / ipv4 dst is 71.116.114.22 src is 173.153.191.177 tos is 2 ttl is 37 / sctp dst is 17941 src is 38115 tag is 1 / end actions drop / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 3287 / ipv4 dst is 219.249.106.92 src is 42.187.118.192 tos is 25 ttl is 161 / sctp dst is 5762 src is 58896 tag is 1 / end actions passthru / flag / end + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 29.191.154.55 src is 69.31.207.25 ttl is 134 / udp dst is 997 src is 42348 / end actions queue index 1 / flag / end + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 53.166.31.5 src is 158.221.82.64 tos is 90 / tcp dst is 28429 src is 36277 / end actions queue index 7 / mark id 3 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 195.39.132.177 src is 65.239.163.18 proto is 255 / end actions passthru / mark id 3 / end + + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 33.178.41.216 src is 157.159.41.179 proto is 255 / end actions queue index 1 / end + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 141.4.179.232 src is 38.102.237.108 ttl is 47 / udp dst is 50235 src is 55057 / end actions queue index 2 / end + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 109.167.0.48 src is 2.233.109.45 tos is 130 / tcp dst is 20779 src is 64541 / end actions queue index 3 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 1881 / ipv4 dst is 100.140.14.188 src is 210.226.229.15 tos is 105 ttl is 190 / sctp dst is 62829 src is 39503 tag is 1 / end actions queue index 4 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 3893 / ipv4 dst is 141.77.203.35 src is 99.49.193.226 tos is 227 ttl is 22 / sctp dst is 33682 src is 22991 tag is 1 / end actions drop / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 1575 / ipv4 dst is 160.99.116.93 src is 123.114.110.144 tos is 21 ttl is 72 / sctp dst is 31363 src is 34136 tag is 1 / end actions passthru / flag / end + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 213.99.143.236 src is 55.130.28.195 ttl is 201 / udp dst is 25119 src is 31609 / end actions queue index 5 / flag / end + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 224.12.140.222 src is 118.34.141.171 tos is 41 / tcp dst is 32602 src is 17691 / end actions queue index 6 / mark id 3 / end + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 124.168.113.3 src is 253.237.216.240 proto is 255 / end actions passthru / mark id 3 / end + +3. send packets:: + + pkt1 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP(dst='33.178.41.216', src='157.159.41.179', proto=255)/Raw('x' * 20) + pkt2 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP(dst='141.4.179.232', src='38.102.237.108', ttl=47)/UDP(dport=50235, sport=55057)/Raw('x' * 20) + pkt3 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP(dst='109.167.0.48', src='2.233.109.45', tos=130)/TCP(dport=20779, sport=64541)/Raw('x' * 20) + pkt4 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=1881)/IP(dst='100.140.14.188', src='210.226.229.15', tos=105, ttl=190)/SCTP(dport=62829, sport=39503, tag=1)/Raw('x' * 20) + pkt5 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=3893)/IP(dst='141.77.203.35', src='99.49.193.226', tos=227, ttl=22)/SCTP(dport=33682, sport=22991, tag=1)/Raw('x' * 20) + pkt6 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=1575)/IP(dst='160.99.116.93', src='123.114.110.144', tos=21, ttl=72)/SCTP(dport=31363, sport=34136, tag=1)/Raw('x' * 20) + pkt7 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP(dst='213.99.143.236', src='55.130.28.195', ttl=201)/UDP(dport=25119, sport=31609)/Raw('x' * 20) + pkt8 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP(dst='224.12.140.222', src='118.34.141.171', tos=41)/TCP(dport=32602, sport=17691)/Raw('x' * 20) + pkt9 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP(dst='124.168.113.3', src='253.237.216.240', proto=255)/Raw('x' * 20) + pkt10 = Ether(dst="3c:fd:fe:9c:5b:b8")/IP(src="192.168.0.3", dst="192.168.0.4", proto=255)/Raw("x" * 20) + + verify packet + pkt1 to queue 1, pkt2 to queue 2, pkt3 to queue 3, pkt4 to queue 4, pkt5 can't be received, + pkt6/9/10 to queue 0, pkt7 to queue 5, pkt8 to queue 6. + +4. verify rules can be listed and destroyed:: + + testpmd> flow list 0 + ID Group Prio Attr Rule + 0 0 0 i-- ETH IPV4 => QUEUE + 1 0 0 i-- ETH IPV4 UDP => QUEUE + 2 0 0 i-- ETH IPV4 TCP => QUEUE + 3 0 0 i-- ETH VLAN IPV4 SCTP => QUEUE + 4 0 0 i-- ETH VLAN IPV4 SCTP => DROP + 5 0 0 i-- ETH VLAN IPV4 SCTP => PASSTHRU FLAG + 6 0 0 i-- ETH IPV4 UDP => QUEUE FLAG + 7 0 0 i-- ETH IPV4 TCP => QUEUE MARK + 8 0 0 i-- ETH IPV4 => PASSTHRU MARK Test case: Intel® Ethernet 700 Series fdir for ipv6 =================================================== +Subcase1: fdir for ipv6 (bind the pf to igb_uio) +------------------------------------------------ + Prerequisites: add two vfs on dpdk pf, then bind the vfs to vfio-pci:: @@ -293,17 +361,17 @@ Test case: Intel® Ethernet 700 Series fdir for ipv6 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e0000 -n 4 -a 05:02.0 --file-prefix=vf0 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e0000 -n 4 -a 05:02.0 --file-prefix=vf0 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e00000 -n 4 -a 05:02.1 --file-prefix=vf1 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e00000 -n 4 -a 05:02.1 --file-prefix=vf1 --socket-mem=1024,1024 -- -i --rxq=4 --txq=4 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -366,9 +434,59 @@ Test case: Intel® Ethernet 700 Series fdir for ipv6 testpmd> flow flush 0 testpmd> flow list 0 +Subcase2: fdir for ipv6 (bind the pf to vfio-pci) +------------------------------------------------- + +1. Launch the app ``testpmd`` with the following arguments:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +2. validate and create the filter rules:: + + testpmd> flow validate 0 ingress pattern eth / vlan tci is 1615 / ipv6 src is f47e:d08c:3856:2e75:2f6b:7b92:c5ee:8f3c dst is 3d29:55bc:c137:3bd9:32b6:afe7:2db6:358f proto is 255 tc is 31 hop is 47 / end actions queue index 0 / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 2144 / ipv6 src is 776c:1445:230:8421:7813:c142:5eab:3224 dst is 32c0:348d:90c:cd0a:5e7:f950:6db9:f686 tc is 70 hop is 185 / udp dst is 18871 src is 40861 / end actions queue index 7 / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 827 / ipv6 src is 79a1:1122:ab30:112:bbc4:f043:a68b:2261 dst is 14a4:d730:69d1:d6b3:f39a:6f9c:398e:e510 tc is 245 hop is 72 / tcp dst is 63094 src is 13170 / end actions queue index 15 / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 1063 / ipv6 src is cb74:80d7:c1fd:b5ad:1016:1b4d:29a6:24f1 dst is 22c9:69f:a52d:6826:3f95:5ac:be54:f88c tc is 216 hop is 180 / sctp dst is 2661 src is 24787 tag is 1 / end actions queue index 1 / end + testpmd> flow validate 0 ingress pattern eth / vlan tci is 2212 / ipv6 src is a457:e86a:a531:d6d1:af33:c06a:b1f6:e96f dst is f13b:3245:f84f:af9c:42b7:cd48:63c:c168 tc is 243 hop is 11 / sctp dst is 31788 src is 10570 tag is 1 / end actions drop / end + + testpmd> flow create 0 ingress pattern eth / vlan tci is 120 / ipv6 src is 3a69:6b77:3c17:87b:dad1:3559:c2d4:f8f9 dst is f15e:7045:9ce9:c217:5cda:8710:6704:1166 proto is 255 tc is 63 hop is 175 / end actions queue index 1 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 1438 / ipv6 src is 3d0a:40ca:7efa:6501:f13e:5559:a3da:fab dst is 23f5:1:fe7d:c59e:160b:22ec:f102:82c5 tc is 107 hop is 34 / udp dst is 46416 src is 57148 / end actions queue index 2 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 78 / ipv6 src is 4701:9a42:995:f2c:b75a:87eb:8dde:991d dst is 24ec:dd03:991d:5fb6:5e07:47ba:531a:e897 tc is 180 hop is 137 / tcp dst is 3940 src is 52731 / end actions queue index 3 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 59 / ipv6 src is caeb:64ff:2216:5334:16df:e93c:c5f5:9680 dst is 46a:6625:57f9:915:19a6:ecc7:3131:f702 tc is 52 hop is 253 / sctp dst is 48514 src is 49861 tag is 1 / end actions queue index 4 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 4014 / ipv6 src is a484:b7d9:ee51:e67c:d668:6304:f612:b814 dst is 8ff1:1185:2084:454d:ff90:a7b1:675d:31c4 tc is 248 hop is 22 / sctp dst is 54472 src is 48229 tag is 1 / end actions drop / end + + +3. send packets:: + + pkt1 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=120)/IPv6(src='3a69:6b77:3c17:87b:dad1:3559:c2d4:f8f9', dst='f15e:7045:9ce9:c217:5cda:8710:6704:1166', nh=255, tc=63, hlim=175)/Raw('x' * 20) + pkt2 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=1438)/IPv6(src='3d0a:40ca:7efa:6501:f13e:5559:a3da:fab', dst='23f5:1:fe7d:c59e:160b:22ec:f102:82c5', tc=107, hlim=34)/UDP(dport=46416, sport=57148)/Raw('x' * 20) + pkt3 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=78)/IPv6(src='4701:9a42:995:f2c:b75a:87eb:8dde:991d', dst='24ec:dd03:991d:5fb6:5e07:47ba:531a:e897', tc=180, hlim=137)/TCP(dport=3940, sport=52731)/Raw('x' * 20) + pkt4 = Ether(dst='3c:fd:fe:9c:5b:b8')/Dot1Q(vlan=59)/IPv6(src='caeb:64ff:2216:5334:16df:e93c:c5f5:9680', dst='46a:6625:57f9:915:19a6:ecc7:3131:f702', tc=52, hlim=253, nh=132)/SCTP(dport=48514, sport=49861, tag=1)/Raw('x' * 20) + pkt5 = Ether(dst="3c:fd:fe:9c:5b:b8")/Dot1Q(vlan=1438)/IPv6(src="2001::1", dst="2001::2", tc=2, hlim=20)/UDP(sport=22,dport=23)/Raw("x" * 20) + pkt6 = Ether(dst="3c:fd:fe:9c:5b:b8")/Dot1Q(vlan=2734)/IPv6(src="2001::1", dst="2001::2", tc=2, hlim=20)/UDP(sport=22,dport=23)/Raw("x" * 20) + + verify packet + pkt1 to queue 1, pkt2 to queue 2, pkt3 to queue 3, pkt4 to queue 4, pkt5 can't be received, pkt6 to queue 0. + +4. verify rules can be listed and destroyed:: + + testpmd> flow list 0 + ID Group Prio Attr Rule + 0 0 0 i-- ETH VLAN IPV6 => QUEUE + 1 0 0 i-- ETH VLAN IPV6 UDP => QUEUE + 2 0 0 i-- ETH VLAN IPV6 TCP => QUEUE + 3 0 0 i-- ETH VLAN IPV6 SCTP => QUEUE + 4 0 0 i-- ETH VLAN IPV6 SCTP => DROP + Test case: Intel® Ethernet 700 Series fdir for vlan =================================================== +Subcase1: fdir for vlan (bind the pf to igb_uio) +------------------------------------------------ + Prerequisites: add 2 vf on dpdk pf, then bind the vf to vfio-pci:: @@ -383,12 +501,15 @@ Prerequisites: testpmd> set verbose 1 testpmd> start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e0000 -n 4 -a 05:02.0 --file-prefix=vf0 --socket-mem=1024,1024 --legacy-mem -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect + if the i40e firmware version >= 8.4 the dpdk can only add 'extend on' to make the single VLAN filter work normally: + testpmd> vlan set extend on 0 + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e0000 -n 4 -a 05:02.0 --file-prefix=vf0 --socket-mem=1024,1024 --legacy-mem -- -i --rxq=4 --txq=4 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e00000 -n 4 -a 05:02.1 --file-prefix=vf1 --socket-mem=1024,1024 --legacy-mem -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1e00000 -n 4 -a 05:02.1 --file-prefix=vf1 --socket-mem=1024,1024 --legacy-mem -- -i --rxq=4 --txq=4 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -505,12 +626,49 @@ Prerequisites: testpmd> flow flush 0 testpmd> flow list 0 +Subcase2: fdir for vlan (bind the pf to vfio-pci) +------------------------------------------------- + +1. Launch the app ``testpmd`` with the following arguments:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 --legacy-mem -- -i --rxq=16 --txq=16 --disable-rss + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + + if the i40e firmware version >= 8.4 the dpdk can only add 'extend on' to make the single VLAN filter work normally: + testpmd> vlan set extend on 0 + +2. create and validated filter rules:: + + testpmd> flow create 0 ingress pattern eth / vlan tci is 91 / ipv4 / end actions queue index 1 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 1978 / ipv4 / udp / end actions queue index 2 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 2391 / ipv4 / tcp / end actions queue index 3 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 4028 / ipv4 / sctp / end actions queue index 4 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 986 / ipv4 / sctp / end actions drop / end + + testpmd> flow create 0 ingress pattern eth / vlan tci is 2477 / ipv6 / end actions queue index 1 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 3407 / ipv6 / udp / end actions queue index 2 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 2283 / ipv6 / tcp / end actions queue index 3 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 2709 / ipv6 / sctp / end actions queue index 4 / end + testpmd> flow create 0 ingress pattern eth / vlan tci is 3734 / ipv6 / sctp / end actions drop / end + +3. send the packets:: + + verify packet + pkt1,pkt2 to queue 1, pkt3,pkt4 to queue 2, pkt5,pkt6 to queue 3, + pkt7,pkt8 to queue 4, pkt9,pkt10 to queue 0, pkt13, pkt14 can't be received by pf, + pkt17,pkt18 to queue 1, pkt19,pkt20 to queue 2, pkt21,pkt22 to queue 3, + pkt23,pkt24 to queue 4, pkt27, pkt28 can't be received by pf. + +4. verify rules can be listed and destroyed. + Test case: Intel® Ethernet 700 Series fdir wrong parameters =========================================================== 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -548,15 +706,6 @@ Test case: Intel® Ethernet 700 Series fdir wrong parameters it shows "Caught error type 11 (specific action): cause: 0x7ffc7bb9a338, Invalid queue ID for FDIR". - If create a rule on vf that has invalid queue ID:: - - testpmd> flow validate 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end - testpmd> flow create 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end - - it shows "Caught error type 11 (specific action): cause: 0x7ffc7bb9a338, - Invalid queue ID for FDIR". - - Note: /// not support IP fragment /// @@ -565,6 +714,9 @@ Note: Test case: Intel® Ethernet 700 Series tunnel vxlan ================================================== +Subcase1: tunnel vxlan (bind the pf to igb_uio) +----------------------------------------------- + Prerequisites: add a vf on dpdk pf, then bind the vf to vfio-pci:: @@ -664,10 +816,59 @@ Test case: Intel® Ethernet 700 Series tunnel vxlan testpmd> flow flush 0 testpmd> flow list 0 +Subcase2: tunnel vxlan (bind the pf to vfio-pci) +------------------------------------------------ + +1. Launch the app ``testpmd`` with the following arguments:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 --legacy-mem -- -i --rxq=16 --txq=16 --disable-rss + testpmd> rx_vxlan_port add 4789 0 + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +2. create filter rules:: + + testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 1 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan vni is 794 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 2 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan / eth dst is 00:11:22:33:44:66 / vlan tci is 3478 / end actions pf / queue index 3 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan vni is 2611 / eth dst is 00:11:22:33:44:66 / vlan tci is 2434 / end actions pf / queue index 4 / end + testpmd> flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / ipv4 / udp / vxlan vni is 1909 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 5 / end + + testpmd> flow validate 0 ingress pattern eth / ipv4 / udp / vxlan / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 2 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 / udp / vxlan vni is 423 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 5 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 / udp / vxlan / eth dst is 00:11:22:33:44:66 / vlan tci is 2503 / end actions pf / queue index 4 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 / udp / vxlan vni is 330 / eth dst is 00:11:22:33:44:66 / vlan tci is 1503 / end actions pf / queue index 8 / end + testpmd> flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / ipv4 / udp / vxlan vni is 513 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 9 / end + +3. send packets:: + + pkt1 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/UDP()/VXLAN()/Ether(dst='00:11:22:33:44:66')/Raw('x' * 20) + pkt2 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/UDP()/VXLAN(vni=794, flags=8)/Ether(dst='00:11:22:33:44:66')/Raw('x' * 20) + pkt3 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/UDP()/VXLAN()/Ether(dst='00:11:22:33:44:66')/Dot1Q(vlan=3478)/Raw('x' * 20) + pkt4 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/UDP()/VXLAN(vni=2611, flags=8)/Ether(dst='00:11:22:33:44:66')/Dot1Q(vlan=2434)/Raw('x' * 20) + pkt5 = Ether(dst='00:11:22:33:44:55')/IP()/UDP()/VXLAN(vni=1909, flags=8)/Ether(dst='00:11:22:33:44:66')/Raw('x' * 20) + pkt6 = Ether(dst="00:11:22:33:44:55")/IP()/UDP()/VXLAN()/Ether(dst="00:11:22:33:44:66")/Dot1Q(vlan=11)/IP()/TCP()/Raw("x" * 20) + pkt7 = Ether(dst="00:11:22:33:44:55")/IP()/UDP()/VXLAN(vni=5)/Ether(dst="00:11:22:33:44:77")/IP()/TCP()/Raw("x" * 20) + + verify pkt1 received by pf queue 1, pkt2 to pf queue 2, pkt3 to pf queue 3, pkt4 to pf queue 4, pkt5 to pf queue 5, pkt6 to pf queue 1, pkt7 to pf queue 0. + +4. verify rules can be listed and destroyed:: + + testpmd> flow list 0 + ID Group Prio Attr Rule + 0 0 0 i-- ETH IPV4 UDP VXLAN ETH => PF QUEUE + 1 0 0 i-- ETH IPV4 UDP VXLAN ETH => PF QUEUE + 2 0 0 i-- ETH IPV4 UDP VXLAN ETH VLAN => PF QUEUE + 3 0 0 i-- ETH IPV4 UDP VXLAN ETH VLAN => PF QUEUE + 4 0 0 i-- ETH IPV4 UDP VXLAN ETH => PF QUEUE Test case: Intel® Ethernet 700 Series tunnel nvgre ================================================== +Subcase1: tunnel nvgre (bind the pf to igb_uio) +----------------------------------------------- + Prerequisites: add two vfs on dpdk pf, then bind the vfs to vfio-pci:: @@ -773,6 +974,51 @@ Test case: Intel® Ethernet 700 Series tunnel nvgre testpmd> flow flush 0 testpmd> flow list 0 +Subcase2: tunnel nvgre (bind the pf to vfio-pci) +------------------------------------------------ + +1. Launch the app ``testpmd`` with the following arguments:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -a 05:00.0 --file-prefix=pf --socket-mem=1024,1024 --legacy-mem -- -i --rxq=16 --txq=16 --disable-rss + testpmd> set fwd rxonly + testpmd> set verbose 1 + testpmd> start + +2. create filter rules:: + + testpmd> flow create 0 ingress pattern eth / ipv4 / nvgre / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 1 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / nvgre tni is 2835 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 2 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / nvgre / eth dst is 00:11:22:33:44:66 / vlan tci is 1009 / end actions pf / queue index 3 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / nvgre tni is 2570 / eth dst is 00:11:22:33:44:66 / vlan tci is 170 / end actions pf / queue index 4 / end + testpmd> flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / ipv4 / nvgre tni is 568 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 5 / end + + testpmd> flow validate 0 ingress pattern eth / ipv4 / nvgre / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 11 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 / nvgre tni is 1987 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 0 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 / nvgre / eth dst is 00:11:22:33:44:66 / vlan tci is 266 / end actions pf / queue index 8 / end + testpmd> flow validate 0 ingress pattern eth / ipv4 / nvgre tni is 3114 / eth dst is 00:11:22:33:44:66 / vlan tci is 1776 / end actions pf / queue index 9 / end + testpmd> flow validate 0 ingress pattern eth dst is 00:11:22:33:44:55 / ipv4 / nvgre tni is 836 / eth dst is 00:11:22:33:44:66 / end actions pf / queue index 1 / end + +3. send packets:: + + pkt1 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/GRE(key_present=1,proto=0x6558,key=0x00000100)/Ether(dst='00:11:22:33:44:66')/Raw('x' * 20) + pkt2 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/GRE(key_present=1,proto=0x6558,key=725760)/Ether(dst='00:11:22:33:44:66')/Raw('x' * 20) + pkt3 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/GRE(key_present=1,proto=0x6558,key=0x00000100)/Ether(dst='00:11:22:33:44:66')/Dot1Q(vlan=1009)/Raw('x' * 20) + pkt4 = Ether(dst='3c:fd:fe:9c:5b:b8')/IP()/GRE(key_present=1,proto=0x6558,key=657920)/Ether(dst='00:11:22:33:44:66')/Dot1Q(vlan=170)/Raw('x' * 20) + pkt5 = Ether(dst='00:11:22:33:44:55')/IP()/GRE(key_present=1,proto=0x6558,key=145408)/Ether(dst='00:11:22:33:44:66')/Raw('x' * 20) + pkt6 = Ether(dst="00:11:22:33:44:55")/IP()/GRE(key_present=1,proto=0x6558,key=0x00000100)/Ether(dst="00:11:22:33:44:66")/Dot1Q(vlan=1)/IP()/TCP()/Raw("x" * 20) + pkt7 = Ether(dst="00:11:22:33:44:55")/IP()/GRE(key_present=1,proto=0x6558,key=145408)/Ether(dst="00:11:22:33:44:77")/IP()/TCP()/Raw("x" * 20) + + verify pkt1 received by pf queue 1, pkt2 to pf queue 2, pkt3 to pf queue 3, pkt4 to pf queue 4, pkt5 to pf queue 5, pkt6 to pf queue 1, pkt7 to pf queue 0. + +4. verify rules can be listed and destroyed:: + + testpmd> flow list 0 + ID Group Prio Attr Rule + 0 0 0 i-- ETH IPV4 NVGRE ETH => PF QUEUE + 1 0 0 i-- ETH IPV4 NVGRE ETH => PF QUEUE + 2 0 0 i-- ETH IPV4 NVGRE ETH VLAN => PF QUEUE + 3 0 0 i-- ETH IPV4 NVGRE ETH VLAN => PF QUEUE + 4 0 0 i-- ETH IPV4 NVGRE ETH => PF QUEUE Test case: IXGBE SYN ==================== @@ -921,7 +1167,7 @@ Test case: IXGBE fdir for ipv4 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -1023,7 +1269,7 @@ Test case: IXGBE fdir for signature(ipv4/ipv6) 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=signature + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -1176,7 +1422,7 @@ Test case: IXGBE fdir for mac/vlan(support by x540, x552, x550) 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect-mac-vlan + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -1201,130 +1447,13 @@ Test case: IXGBE fdir for mac/vlan(support by x540, x552, x550) testpmd> flow flush 0 testpmd> flow list 0 -Test case: IXGBE fdir for Control levels of FDir match reporting(supported by 82599) -==================================================================================== - -The status of FDir filter matching for each packet can be reported by the -hardware through the RX descriptor of each received packet, and this information -is copied into the packet mbuf, that can be examined by the application. - -There are three different reporting modes, that can be set in testpmd using the -``--pkt-filter-report-hash`` command line argument: - - -Sub-case: ``--pkt-filter-report-hash=none`` mode ------------------------------------------------- - -In this mode FDir reporting mode, matches are never reported. -Start the ``testpmd`` application as follows:: - - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=none - testpmd> set verbose 1 - testpmd> set fwd rxonly - testpmd> start - -Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed:: - - packet: pkt0=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20) - testpmd> port 0/queue 0: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 - ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - -Add flow filter rule, and send the matched packet again. -No Dir information is printed, but it can be seen that the packet goes to queue 1:: - - testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end - testpmd> port 0/queue 1: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x1 - ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - testpmd> quit - -Sub-case: ``--pkt-filter-report-hash=match`` mode -------------------------------------------------- - -In this mode FDir reporting mode, FDir information is printed for packets that match a filter. -Start the ``testpmd`` application as follows:: - - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=match - testpmd> set verbose 1 - testpmd> set fwd rxonly - testpmd> start - -Send pkt0 packet with Scapy on the traffic generator and check that no FDir information is printed:: - - packet: pkt0=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20) - testpmd> port 0/queue 0: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 - ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - -Add flow filter rule, and send the pkt0 packet again. -This time, the match is indicated (``RTE_MBUF_F_RX_FDIR``), and its details (hash, id) printed :: - - testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end - testpmd> port 0/queue 1: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x1 - ol_flags: RTE_MBUF_F_RX_FDIR RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - -Add flow filter rule by using different src,dst, and send the matched pkt1 packet again. -This time, the match is indicated (``RTE_MBUF_F_RX_FDIR``), and its details (hash, id) printed :: - - packet: pkt1=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.1.1", dst="192.168.1.2")/Raw('x' * 20) - testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / mark id 2 / end - testpmd> port 0/queue 2: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=64 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x2 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x2 - ol_flags: RTE_MBUF_F_RX_FDIR RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - -Remove rule1 and send the matched pkt0 packet again. Check that no FDir information is printed:: - - testpmd> flow destroy 0 rule 0 - Flow rule #0 destroyed - testpmd> port 0/queue 0: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 - ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - -Remove rule2, and send the match pkt1 packet again. Check that no FDir information is printed:: - - testpmd> flow destroy 0 rule 1 - Flow rule #1 destroyed - testpmd> port 0/queue 0: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 - ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - testpmd> quit - -Sub-case: ``--pkt-filter-report-hash=always`` mode --------------------------------------------------- - -In this mode FDir reporting mode, FDir information is printed for every received packet. -Start the ``testpmd`` application as follows:: - - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -- -i --rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect --pkt-filter-report-hash=always - testpmd> set verbose 1 - testpmd> set fwd rxonly - testpmd> start - - -Send matched pkt0 packet with Scapy on the traffic generator and check the output (FDIR id=0x0):: - - packet: pkt0=Ether(dst="90:E2:BA:AC:99:FC")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20) - testpmd> port 0/queue 0: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x0 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x0 - ol_flags: RTE_MBUF_F_RX_FDIR RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - -Add flow filter rule, and send the matched pkt0 packet again. -This time, the filter ID is different, and the packet goes to queue 1 :: - - testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end - testpmd> port 0/queue 1: received 1 packets - src=00:0C:29:B3:0E:82 - dst=90:E2:BA:AC:99:FC - type=0x0800 - length=60 - nb_segs=1 - FDIR matched hash=0x2f3 ID=0x1 - hw ptype: L2_ETHER L3_IPV4 - sw ptype: L2_ETHER L3_IPV4 - l2_len=14 - l3_len=20 - Receive queue=0x1 - ol_flags: RTE_MBUF_F_RX_FDIR RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN - testpmd> quit Test case: IXGBE fdir for tunnel (vxlan and nvgre)(support by x540, x552, x550) =============================================================================== 1. Launch the app ``testpmd`` with the following arguments:: - ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss --pkt-filter-mode=perfect-tunnel + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=16 --txq=16 --disable-rss testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start @@ -2116,7 +2245,7 @@ Test case: Intel® Ethernet 700 Series fdir for l2 mac Verify second rule can not be created. Test case: Dual vlan(QinQ) -================================= +========================== 1. config testpmd on DUT @@ -2293,7 +2422,7 @@ Verify that the packets are not received (RX-packets do not increased)on the queue 1. Test Case: jumbo framesize filter -=================================== +================================= This case is designed for NIC (82599, I350, 82576 and 82580). Since ``Testpmd`` could transmits packets with jumbo frame size , it also could @@ -2330,7 +2459,7 @@ the packet are not received on the queue 2:: testpmd> stop Test Case: 64 queues -======================== +==================== This case is designed for NIC(82599). Default use 64 queues for test From patchwork Fri Dec 9 07:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 120688 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 06812A0093; Fri, 9 Dec 2022 09:05:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00FAF42D23; Fri, 9 Dec 2022 09:05:01 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 71FFF40E0F for ; Fri, 9 Dec 2022 09:04:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670573098; x=1702109098; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nw+IXKao+2VhsO5FlAPpl4dyQsNkCISvnP1eHkG6JNw=; b=MnDsCro6uf5bUebSm7JKYJhrSqw32eN13InpINbD0sltawY/ZLS2ajiU eFhuLtmdrZLiEF80vb7wc921Ig3P2F31g2vDIpafCTv8jiotV++sv4RDH 4y6CaKtkl7r34v6+paWQ52uuMX/eUrBoa5TyH1KWYISVzBDCdFIq/VzJF d4/FqRyjJuVU2SmFRCJkNBDvA3HNM3Bta+7S12vhK+1yQoxo2TaD7qDTW qWwgisw093PDsGI7U4u87YzAW7RrdKstYGPEdyUNZTycH8dhQc1yjEO3r 0Q9cgiiLomNbfxkoI1h3wgA/BgqnyLEIgS1gVBz7XBc/axmdu5sntrNd/ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="305051965" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="305051965" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:04:58 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="678074577" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="678074577" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:04:56 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V2 2/5] tests/generic_flow_api: add pf action subcase Date: Fri, 9 Dec 2022 02:08:04 -0500 Message-Id: <20221209070807.1134-3-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209070807.1134-1-linglix.chen@intel.com> References: <20221209070807.1134-1-linglix.chen@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. According to dpdk commit 5007ac1318 (ethdev: remove deprecated Flow Director configuration) remove --pkt-filter-mode. 2. This commit also removed '--pkt-filter-report-hash', so test_fdir_for_match_report no need test on NNT. 3. add 5 pf action subcase (bind the pf to vfio-pci). 4. According to dpdk commit 5c45fde3e9 (ethdev: remove deprecated flow item VF) remove fdir_wrong_parameters case create vf rule part. Signed-off-by: Lingli Chen --- V2: modify case name xxx_PF_vfio/xxxx_PF_igb_uio tests/TestSuite_generic_flow_api.py | 1167 ++++++++++++++++++++------- 1 file changed, 883 insertions(+), 284 deletions(-) diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py index 417131f2..84fa9ccf 100644 --- a/tests/TestSuite_generic_flow_api.py +++ b/tests/TestSuite_generic_flow_api.py @@ -25,7 +25,11 @@ from framework.exception import VerifyFailure from framework.pmd_output import PmdOutput from framework.project_dpdk import DPDKdut from framework.settings import DRIVERS, HEADER_SIZE -from framework.test_case import TestCase, check_supported_nic +from framework.test_case import ( + TestCase, + check_supported_nic, + skip_unsupported_host_driver, +) from framework.virt_dut import VirtDut MAX_VLAN = 4095 @@ -222,41 +226,6 @@ class TestGeneric_flow_api(TestCase): self.session_third.send_expect("start", "testpmd> ") return out_pf - def launch_start_testpmd( - self, - queue="", - pkt_filter_mode="", - report_hash="", - disable_rss=False, - fwd="", - verbose="", - ): - """ - Launch and start testpmd - """ - param = "" - eal_param = "" - if queue: - param += "--rxq={} --txq={} ".format(queue, queue) - if pkt_filter_mode: - param += "--pkt-filter-mode={} ".format(pkt_filter_mode) - if disable_rss: - param += "--disable-rss " - if report_hash: - param += "--pkt-filter-report-hash={} ".format(report_hash) - self.pmdout.start_testpmd( - "{}".format(self.cores), param=param, eal_param=eal_param - ) - if fwd: - self.pmdout.execute_cmd( - "set fwd rxonly", - ) - if verbose: - self.pmdout.execute_cmd("set verbose 1") - self.pmdout.execute_cmd("start") - self.pmdout.execute_cmd("show port info all") - self.pmdout.wait_link_status_up(self.dut_ports[0]) - def compare_memory_rules(self, expectedRules): """ dump all flow rules that have been created in memory and compare that total rules number with the given expected number @@ -2043,7 +2012,249 @@ class TestGeneric_flow_api(TestCase): "Invalid", ) - def test_fdir_for_vlan(self): + support_nic = [ + "I40E_10G-SFP_XL710", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_10G-10G_BASE_T_BC", + "I40E_40G-QSFP_B", + "I40E_10G-SFP_X722", + "I40E_10G-10G_BASE_T_X722", + ] + + @check_supported_nic(support_nic) + def test_fdir_for_vlan_PF_vfio(self): + """ + only supported by i40e + """ + # start testpmd on pf + self.pmdout.start_testpmd( + "%s" % self.pf_cores, + "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem" % self.pf_pci, + ) + 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) + # Get the firmware version information + try: + fwversion, _, _ = self.pmdout.get_firmware_version( + self.dut_ports[0] + ).split() + except ValueError: + # nic IXGBE, IGC + fwversion = self.pmdout.get_firmware_version(self.dut_ports[0]).split() + # Because the kernel forces enable Qinq and cannot be closed, + # the dpdk can only add 'extend on' to make the single VLAN filter work normally. + if self.kdriver == "i40e" and fwversion >= "8.40": + self.dut.send_expect("vlan set extend on 0", "testpmd> ") + self.dut.send_expect("show port info all", "testpmd> ", 120) + + # create the flow rules + basic_flow_actions = [ + {"create": "create", "flows": ["vlan", "ipv4"], "actions": ["queue"]}, + { + "create": "create", + "flows": ["vlan", "ipv4", "udp"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["vlan", "ipv4", "tcp"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["vlan", "ipv4", "sctp"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["vlan", "ipv4", "sctp"], + "actions": ["drop"], + }, + {"create": "create", "flows": ["vlan", "ipv6"], "actions": ["queue"]}, + { + "create": "create", + "flows": ["vlan", "ipv6", "udp"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["vlan", "ipv6", "tcp"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["vlan", "ipv6", "sctp"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["vlan", "ipv6", "sctp"], + "actions": ["drop"], + }, + {"create": "validate", "flows": ["vlan", "ipv4"], "actions": ["queue"]}, + { + "create": "validate", + "flows": ["vlan", "ipv4", "udp"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["vlan", "ipv4", "tcp"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["vlan", "ipv4", "sctp"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["vlan", "ipv4", "sctp"], + "actions": ["drop"], + }, + {"create": "validate", "flows": ["vlan", "ipv6"], "actions": ["queue"]}, + { + "create": "validate", + "flows": ["vlan", "ipv6", "udp"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["vlan", "ipv6", "tcp"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["vlan", "ipv6", "sctp"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["vlan", "ipv6", "sctp"], + "actions": ["drop"], + }, + ] + extrapkt_rulenum = self.all_flows_process(basic_flow_actions) + extra_packet = extrapkt_rulenum["extrapacket"] + # send the packets with dst/src ip and dst/src port. + self.sendpkt( + pktstr='Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="192.168.0.1", dst="192.168.0.2", proto=3)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[0]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][0], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="192.168.0.1", dst="192.168.0.2", tos=3)/UDP()/Raw("x" * 20)' + % (self.pf_mac, extra_packet[1]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][1], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="192.168.0.1", dst="192.168.0.2", ttl=3)/TCP()/Raw("x" * 20)' + % (self.pf_mac, extra_packet[2]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][2], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="192.168.0.1", dst="192.168.0.2", tos=3, ttl=3)/SCTP()/Raw("x" * 20)' + % (self.pf_mac, extra_packet[3]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][3], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="192.168.0.1", dst="192.168.0.2", ttl=3)/TCP()/Raw("x" * 20)' + % (self.pf_mac, extra_packet[3]["vlan"]) + ) + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IP()/UDP()/Raw("x" * 20)' + % (self.pf_mac, extra_packet[2]["vlan"]) + ) + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="192.168.0.5", dst="192.168.0.6", tos=3, ttl=3)/SCTP(sport=44,dport=45,tag=1)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[4]["vlan"]) + ) + self.verify_result( + "pf", expect_rxpkts="0", expect_queue="NULL", verify_mac=self.pf_mac + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IPv6(src="2001::1", dst="2001::2", tc=1, nh=5, hlim=10)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[5]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][5], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IPv6(src="2001::1", dst="2001::2", tc=2, hlim=20)/UDP(sport=22,dport=23)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[6]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][6], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IPv6(src="2001::1", dst="2001::2", tc=2, hlim=20)/TCP(sport=32,dport=33)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[7]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][7], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IPv6(src="2001::1", dst="2001::2", tc=4, nh=132, hlim=40)/SCTP(sport=44,dport=45,tag=1)/SCTPChunkData(data="X" * 20)' + % (self.pf_mac, extra_packet[8]["vlan"]) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][8], + verify_mac=self.pf_mac, + ) + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IPv6(src="2001::1", dst="2001::2", tc=4, nh=132, hlim=40)/SCTP(sport=44,dport=45,tag=1)/SCTPChunkData(data="X" * 20)' + % (self.pf_mac, extra_packet[9]["vlan"]) + ) + 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) + + @skip_unsupported_host_driver(["vfio-pci"]) + def test_fdir_for_vlan_PF_igb_uio(self): """ only supported by i40e """ @@ -2373,9 +2584,10 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num) - def test_fdir_for_ipv4(self): + @skip_unsupported_host_driver(["vfio-pci"]) + def test_fdir_for_ipv4_PF_igb_uio(self): """ - only supported by i40e and ixgbe + only supported by i40e """ self.verify( self.nic @@ -2671,32 +2883,243 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num) - # ixgbe - else: - self.pmdout.start_testpmd( - "%s" % self.cores, - "--pkt-filter-mode=perfect --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) - - if self.nic in ["IXGBE_10G-X550EM_X_10G_T", "IXGBE_10G-X550T"]: - # create the flow rules - basic_flow_actions = [ - { - "create": "validate", - "flows": ["ipv4", "sip", "dip", "udp", "sport", "dport"], - "actions": ["queue"], - }, - { - "create": "validate", - "flows": ["ipv4", "sip", "dip", "tcp", "sport", "dport"], - "actions": ["queue"], - }, - { + def test_fdir_for_ipv4_PF_vfio(self): + """ + only supported by i40e and ixgbe + """ + self.verify( + self.nic + in [ + "IXGBE_10G-82599_SFP", + "IXGBE_10G-X550EM_X_10G_T", + "IXGBE_10G-X550T", + "I40E_10G-SFP_XL710", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_10G-10G_BASE_T_BC", + "I40E_40G-QSFP_B", + "I40E_10G-SFP_X722", + "I40E_10G-10G_BASE_T_X722", + ], + "%s nic not support fdir ipv4 filter" % self.nic, + ) + # i40e + if self.nic in [ + "I40E_10G-SFP_XL710", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_40G-QSFP_B", + "I40E_10G-SFP_X722", + "I40E_10G-10G_BASE_T_X722", + "I40E_10G-10G_BASE_T_BC", + ]: + # start testpmd on pf + self.pmdout.start_testpmd( + "%s" % self.pf_cores, + "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem" + % self.pf_pci, + ) + 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) + + # validate and create the flow rules + basic_flow_actions = [ + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "proto"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "ttl", "udp", "sport", "dport"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "tos", "tcp", "sport", "dport"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv4", + "sip", + "dip", + "tos", + "ttl", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv4", + "sip", + "dip", + "tos", + "ttl", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["drop"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv4", + "sip", + "dip", + "tos", + "ttl", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["passthru", "flag"], + }, + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "ttl", "udp", "sport", "dport"], + "actions": ["queue", "flag"], + }, + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "tos", "tcp", "sport", "dport"], + "actions": ["queue", "mark"], + }, + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "proto"], + "actions": ["passthru", "mark"], + }, + { + "create": "create", + "flows": ["ipv4", "sip", "dip", "proto"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["ipv4", "sip", "dip", "ttl", "udp", "sport", "dport"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": ["ipv4", "sip", "dip", "tos", "tcp", "sport", "dport"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv4", + "sip", + "dip", + "tos", + "ttl", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["queue"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv4", + "sip", + "dip", + "tos", + "ttl", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["drop"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv4", + "sip", + "dip", + "tos", + "ttl", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["passthru", "flag"], + }, + { + "create": "create", + "flows": ["ipv4", "sip", "dip", "ttl", "udp", "sport", "dport"], + "actions": ["queue", "flag"], + }, + { + "create": "create", + "flows": ["ipv4", "sip", "dip", "tos", "tcp", "sport", "dport"], + "actions": ["queue", "mark"], + }, + { + "create": "create", + "flows": ["ipv4", "sip", "dip", "proto"], + "actions": ["passthru", "mark"], + }, + ] + extrapkt_rulenum = self.all_flows_process(basic_flow_actions) + extra_packet = extrapkt_rulenum["extrapacket"] + self.sendpkt( + 'Ether(dst="%s")/IP(src="192.168.0.3", dst="192.168.0.4", proto=%s)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[0]["proto"]) + ) + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac + ) + rule_num = extrapkt_rulenum["rulenum"] + self.verify_rulenum(rule_num) + # ixgbe + else: + 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) + + if self.nic in ["IXGBE_10G-X550EM_X_10G_T", "IXGBE_10G-X550T"]: + # create the flow rules + basic_flow_actions = [ + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "udp", "sport", "dport"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "sip", "dip", "tcp", "sport", "dport"], + "actions": ["queue"], + }, + { "create": "validate", "flows": ["ipv4", "sip", "dip", "sctp", "sport", "dport"], "actions": ["queue"], @@ -2799,9 +3222,10 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num) - def test_fdir_for_ipv6(self): + @skip_unsupported_host_driver(["vfio-pci"]) + def test_fdir_for_ipv6_PF_igb_uio(self): """ - only supported by i40e and ixgbe + only supported by i40e """ self.verify( self.nic @@ -3108,12 +3532,203 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num) + def test_fdir_for_ipv6_PF_vfio(self): + """ + only supported by i40e and ixgbe + """ + self.verify( + self.nic + in [ + "IXGBE_10G-82599_SFP", + "IXGBE_10G-X550EM_X_10G_T", + "IXGBE_10G-X550T", + "I40E_10G-SFP_XL710", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_10G-10G_BASE_T_BC", + "I40E_40G-QSFP_B", + "I40E_10G-SFP_X722", + "I40E_10G-10G_BASE_T_X722", + "IGC-I225_LM", + "IGC-I226_LM", + ], + "%s nic not support fdir ipv6 filter" % self.nic, + ) + # i40e + if self.nic in [ + "I40E_10G-SFP_XL710", + "I40E_25G-25G_SFP28", + "I40E_40G-QSFP_A", + "I40E_40G-QSFP_B", + "I40E_10G-SFP_X722", + "I40E_10G-10G_BASE_T_X722", + "I40E_10G-10G_BASE_T_BC", + ]: + self.pmdout.start_testpmd( + "%s" % self.pf_cores, + "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem" + % self.pf_pci, + ) + 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) + + # create the flow rules + basic_flow_actions = [ + { + "create": "validate", + "flows": ["vlan", "ipv6", "sip", "dip", "proto", "tc", "hop"], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "udp", + "sport", + "dport", + ], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "tcp", + "sport", + "dport", + ], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["queue"], + }, + { + "create": "validate", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["drop"], + }, + { + "create": "create", + "flows": ["vlan", "ipv6", "sip", "dip", "proto", "tc", "hop"], + "actions": ["queue"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "udp", + "sport", + "dport", + ], + "actions": ["queue"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "tcp", + "sport", + "dport", + ], + "actions": ["queue"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["queue"], + }, + { + "create": "create", + "flows": [ + "vlan", + "ipv6", + "sip", + "dip", + "tc", + "hop", + "sctp", + "sport", + "dport", + "tag", + ], + "actions": ["drop"], + }, + ] + extrapkt_rulenum = self.all_flows_process(basic_flow_actions) + extra_packet = extrapkt_rulenum["extrapacket"] + self.sendpkt( + 'Ether(dst="%s")/Dot1Q(vlan=%s)/IPv6(src="2001::1", dst="2001::2", tc=2, hlim=20)/UDP(sport=22,dport=23)/Raw("x" * 20)' + % (self.pf_mac, extra_packet[1]["vlan"]) + ) + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac + ) + rule_num = extrapkt_rulenum["rulenum"] + self.verify_rulenum(rule_num) + # ixgbe signature else: self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=signature --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -3442,26 +4057,14 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num + 1) - support_nic = [ - "I40E_10G-SFP_XL710", - "I40E_25G-25G_SFP28", - "I40E_40G-QSFP_A", - "I40E_10G-10G_BASE_T_BC", - "I40E_40G-QSFP_B", - "I40E_10G-SFP_X722", - "I40E_10G-10G_BASE_T_X722", - ] - @check_supported_nic(support_nic) def test_fdir_wrong_parameters(self): """ Test case: Intel® Ethernet 700 Series fdir wrong parameters """ - self.pmdout.start_testpmd( "%s" % self.pf_cores, - "--disable-rss --rxq=%d --txq=%d --pkt-filter-mode=perfect" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE + 1, MAX_QUEUE + 1), "-a %s --socket-mem 1024,1024 --file-prefix=pf " % self.pf_pci, ) self.dut.send_expect("set fwd rxonly", "testpmd> ") @@ -3512,29 +4115,6 @@ class TestGeneric_flow_api(TestCase): self.dut.send_expect("quit", "# ") time.sleep(2) - self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1, self.kdriver) - self.vf_port = self.dut.ports_info[self.dut_ports[0]]["vfs_port"][0] - self.vf_port.bind_driver(driver="vfio-pci") - self.vf_port_pci = self.dut.ports_info[self.dut_ports[0]]["sriov_vfs_pci"][0] - # start testpmd on vf0 - self.pmdout.start_testpmd( - "default", - "--rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect", - eal_param="-a %s --socket-mem 1024,1024 --file-prefix=vf" - % self.vf_port_pci, - ) - self.dut.send_expect("start", "testpmd>") - time.sleep(2) - # create a rule on vf that has invalid queue ID - self.dut.send_expect( - "flow validate 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end", - "error", - ) - self.dut.send_expect( - "flow create 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end", - "error", - ) - def test_fdir_for_flexbytes(self): """ The filter structure is different between igb, ixgbe and i40e @@ -3761,8 +4341,7 @@ class TestGeneric_flow_api(TestCase): else: self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=perfect --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -3794,8 +4373,7 @@ class TestGeneric_flow_api(TestCase): # the second flexbytes rule should be created after the testpmd reset, because the flexbytes rule is global bit masks self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=perfect --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -3840,8 +4418,7 @@ class TestGeneric_flow_api(TestCase): # signature mode self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=signature --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -3891,8 +4468,7 @@ class TestGeneric_flow_api(TestCase): self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=signature --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -4160,8 +4736,7 @@ class TestGeneric_flow_api(TestCase): self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=perfect-mac-vlan --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -4232,8 +4807,7 @@ class TestGeneric_flow_api(TestCase): self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=perfect-tunnel --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -4284,8 +4858,7 @@ class TestGeneric_flow_api(TestCase): self.pmdout.start_testpmd( "%s" % self.cores, - "--pkt-filter-mode=perfect-tunnel --disable-rss --rxq=%d --txq=%d" - % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "--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) @@ -4319,7 +4892,102 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num) - def test_tunnel_filter_vxlan(self): + @check_supported_nic(support_nic) + def test_tunnel_filter_vxlan_PF_vfio(self): + """ + only supported by i40e + """ + self.pmdout.start_testpmd( + "%s" % self.pf_cores, + "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem" % self.pf_pci, + ) + self.dut.send_expect("rx_vxlan_port add 4789 0", "testpmd> ", 120) + 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) + + # create the flow rules + basic_flow_actions = [ + { + "create": "create", + "flows": ["ipv4", "udp", "vxlan", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["ipv4", "udp", "vxlan", "vni", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["ipv4", "udp", "vxlan", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["ipv4", "udp", "vxlan", "vni", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["dst_mac", "ipv4", "udp", "vxlan", "vni", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "udp", "vxlan", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "udp", "vxlan", "vni", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "udp", "vxlan", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "udp", "vxlan", "vni", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["dst_mac", "ipv4", "udp", "vxlan", "vni", "ineth"], + "actions": ["pf", "queue"], + }, + ] + extrapkt_rulenum = self.all_flows_process(basic_flow_actions) + extra_packet = extrapkt_rulenum["extrapacket"] + + self.sendpkt( + 'Ether(dst="%s")/IP()/UDP()/VXLAN()/Ether(dst="%s")/Dot1Q(vlan=11)/IP()/TCP()/Raw("x" * 20)' + % (self.outer_mac, self.inner_mac) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][0], + verify_mac=self.outer_mac, + ) + + self.sendpkt( + 'Ether(dst="%s")/IP()/UDP()/VXLAN(vni=5)/Ether(dst="%s")/IP()/TCP()/Raw("x" * 20)' + % (self.outer_mac, self.wrong_mac) + ) + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.outer_mac + ) + + rule_num = extrapkt_rulenum["rulenum"] + self.verify_rulenum(rule_num) + + @skip_unsupported_host_driver(["vfio-pci"]) + def test_tunnel_filter_vxlan_PF_igb_uio(self): """ only supported by i40e """ @@ -4491,7 +5159,101 @@ class TestGeneric_flow_api(TestCase): rule_num = extrapkt_rulenum["rulenum"] self.verify_rulenum(rule_num) - def test_tunnel_filter_nvgre(self): + @check_supported_nic(support_nic) + def test_tunnel_filter_nvgre_PF_vfio(self): + """ + only supported by i40e + """ + self.pmdout.start_testpmd( + "%s" % self.pf_cores, + "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE + 1, MAX_QUEUE + 1), + "-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem" % self.pf_pci, + ) + 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) + + # create the flow rules + basic_flow_actions = [ + { + "create": "create", + "flows": ["ipv4", "nvgre", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["ipv4", "nvgre", "tni", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["ipv4", "nvgre", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["ipv4", "nvgre", "tni", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "create", + "flows": ["dst_mac", "ipv4", "nvgre", "tni", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "nvgre", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "nvgre", "tni", "ineth"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "nvgre", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["ipv4", "nvgre", "tni", "ineth", "invlan"], + "actions": ["pf", "queue"], + }, + { + "create": "validate", + "flows": ["dst_mac", "ipv4", "nvgre", "tni", "ineth"], + "actions": ["pf", "queue"], + }, + ] + extrapkt_rulenum = self.all_flows_process(basic_flow_actions) + extra_packet = extrapkt_rulenum["extrapacket"] + + self.sendpkt( + 'Ether(dst="%s")/IP()/NVGRE()/Ether(dst="%s")/Dot1Q(vlan=1)/IP()/TCP()/Raw("x" * 20)' + % (self.outer_mac, self.inner_mac) + ) + self.verify_result( + "pf", + expect_rxpkts="1", + expect_queue=extrapkt_rulenum["queue"][0], + verify_mac=self.outer_mac, + ) + + self.sendpkt( + 'Ether(dst="%s")/IP()/NVGRE(TNI=%s)/Ether(dst="%s")/IP()/TCP()/Raw("x" * 20)' + % (self.outer_mac, extra_packet[4]["tni"], self.wrong_mac) + ) + self.verify_result( + "pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.outer_mac + ) + + rule_num = extrapkt_rulenum["rulenum"] + self.verify_rulenum(rule_num) + + @skip_unsupported_host_driver(["vfio-pci"]) + def test_tunnel_filter_nvgre_PF_igb_uio(self): """ only supported by i40e """ @@ -5115,169 +5877,6 @@ class TestGeneric_flow_api(TestCase): else: self.verify(False, "%s not support this test" % self.nic) - @check_supported_nic(["IXGBE_10G-82599_SFP"]) - def test_fdir_for_match_report(self): - """ - Test case: IXGBE fdir for Control levels of FDir match reporting - only supported by ixgbe - """ - fdir_scanner = re.compile("FDIR matched hash=(0x\w+) ID=(0x\w+)") - pkt0 = 'Ether(dst="{}")/IP(src="192.168.0.1", dst="192.168.0.2")/Raw("x" * 20)'.format( - self.pf_mac - ) - pkt1 = 'Ether(dst="{}")/IP(src="192.168.1.1", dst="192.168.1.2")/Raw("x" * 20)'.format( - self.pf_mac - ) - rule0 = "flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end" - rule1 = "flow create 0 ingress pattern eth / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / mark id 2 / end" - - self.logger.info("Sub-case1: ``--pkt-filter-report-hash=none`` mode") - pkt_filter_report_hash = "none" - self.launch_start_testpmd( - queue=MAX_QUEUE + 1, - pkt_filter_mode="perfect", - report_hash=pkt_filter_report_hash, - disable_rss=True, - fwd="rxonly", - verbose="1", - ) - - # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed - self.sendpkt(pktstr=pkt0) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="0", - verify_mac=self.pf_mac, - check_fdir="non-exist", - ) - - # Add flow filter rule, and send the matched packet again. - # No FDir information is printed, but it can be seen that the packet went to queue 1 - self.pmdout.execute_cmd(rule0) - self.sendpkt(pktstr=pkt0) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="1", - verify_mac=self.pf_mac, - check_fdir="non-exist", - ) - self.pmdout.quit() - - self.logger.info("Sub-case2: ``--pkt-filter-report-hash=match`` mode") - pkt_filter_report_hash = "match" - self.launch_start_testpmd( - queue=MAX_QUEUE + 1, - pkt_filter_mode="perfect", - report_hash=pkt_filter_report_hash, - disable_rss=True, - fwd="rxonly", - verbose="1", - ) - - # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed - self.sendpkt(pktstr=pkt0) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="0", - verify_mac=self.pf_mac, - check_fdir="non-exist", - ) - - # Add flow filter rule, and send the matched packet again. - # the match is indicated (``RTE_MBUF_F_FDIR``), and its details (hash, id) printed - self.pmdout.execute_cmd(rule0) - self.sendpkt(pktstr=pkt0) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="1", - verify_mac=self.pf_mac, - check_fdir="exist", - ) - - # Add flow filter rule by using different scr,dst, and send the matched pkt1 packet again. - # the match is indicated (``RTE_MBUF_F_FDIR``), and its details (hash, id) printed - self.pmdout.execute_cmd(rule1) - self.sendpkt(pktstr=pkt1) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="2", - verify_mac=self.pf_mac, - check_fdir="exist", - ) - - # Remove rule1 and send the matched pkt0 packet again. Check that no FDir information is printed - self.pmdout.execute_cmd("flow destroy 0 rule 0") - self.sendpkt(pktstr=pkt0) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="0", - verify_mac=self.pf_mac, - check_fdir="non-exist", - ) - - # Remove rule2, and send the match pkt1 packet again. Check that no FDir information is printed - self.pmdout.execute_cmd("flow destroy 0 rule 1") - self.sendpkt(pktstr=pkt1) - self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="0", - verify_mac=self.pf_mac, - check_fdir="non-exist", - ) - self.pmdout.quit() - - self.logger.info("Sub-case3: ``--pkt-filter-report-hash=always`` mode") - pkt_filter_report_hash = "always" - self.launch_start_testpmd( - queue=MAX_QUEUE + 1, - pkt_filter_mode="perfect", - report_hash=pkt_filter_report_hash, - disable_rss=True, - fwd="rxonly", - verbose="1", - ) - - # Send matched pkt0 packet with Scapy on the traffic generator and check the output (FDIR id=0x0) - self.sendpkt(pktstr=pkt0) - out1 = self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="0", - verify_mac=self.pf_mac, - check_fdir="exist", - ) - - # Add flow filter rule, and send the matched pkt0 packet again. - # the filter ID is different, and the packet goes to queue 1Add flow filter rule, and send the matched packet again. - self.pmdout.execute_cmd(rule0) - self.sendpkt(pktstr=pkt0) - out2 = self.verify_result( - "pf", - expect_rxpkts="1", - expect_queue="1", - verify_mac=self.pf_mac, - check_fdir="exist", - ) - - # check fdir id is different - self.logger.info( - "FDIR ID1=" - + fdir_scanner.search(out1).group(0) - + "; FDIR ID2=" - + fdir_scanner.search(out2).group(0) - ) - self.verify( - fdir_scanner.search(out1).group(0) != fdir_scanner.search(out2).group(0), - "Sub-case3.3: FDIR ID should be different", - ) - def tear_down(self): """ Run after each test case. From patchwork Fri Dec 9 07:08:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 120689 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 2BBB7A00C2; Fri, 9 Dec 2022 09:05:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24E9242D2A; Fri, 9 Dec 2022 09:05:02 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3C08F40E0F for ; Fri, 9 Dec 2022 09:05:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670573100; x=1702109100; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QmEbzqt+LD//KFlHkQmrzsuPt5OWfndTVAQzNFdfZtg=; b=H/MLxfqoWZLBuI0h2I9JID2aJcb/h+eyxuYAZK0DcEArQB1t430NqGcU 9Q+cPhyy6QQVdwxVxshDpQhnF6NKurKcEBir6CYGqTRKw+XebONwjYbo5 uVy70Sr4p3sOlzmUnknQc9EDA7Rxc7ovzyD8kXUqxVBDrTzHqDs0jEsJ2 MyMvkAEHBjt0zpxk6uFrNn+ekgn5emo2wlJBTe0GW+IVZyqVx72Z+7UiX s1MdKHGbhH9TqhjcFzwyiHiC6Kzh9O1yXreJZ0EvNdlXImE8RH37mvNeF 1/gURrt+ol7PQ3kd8o9xoYBgtzXEmNgBpuN7pH7gU3R3zVvHQ+L7HvrEp Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="305051970" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="305051970" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:04:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="678074593" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="678074593" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:04:58 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V2 3/5] conf/test_case_*: add pf action subcase Date: Fri, 9 Dec 2022 02:08:05 -0500 Message-Id: <20221209070807.1134-4-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209070807.1134-1-linglix.chen@intel.com> References: <20221209070807.1134-1-linglix.chen@intel.com> 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 pf action subcase supportlist Signed-off-by: Lingli Chen --- V2: modify case name conf/test_case_checklist.json | 11 ++++++----- conf/test_case_supportlist.json | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/test_case_checklist.json b/conf/test_case_checklist.json index f88f5be1..613af2e7 100644 --- a/conf/test_case_checklist.json +++ b/conf/test_case_checklist.json @@ -2935,7 +2935,7 @@ "Comments": "NIC not support this case" } ], - "fdir_for_vlan": [ + "fdir_for_vlan_PF_vfio": [ { "OS": [ "ALL" @@ -3203,7 +3203,7 @@ "Comments": "only i40e and ixgbe driver support this case" } ], - "tunnel_filter_nvgre": [ + "tunnel_filter_nvgre_PF_vfio": [ { "OS": [ "ALL" @@ -3274,7 +3274,7 @@ "Comments": "NIC not support this case" } ], - "tunnel_filter_vxlan": [ + "tunnel_filter_vxlan_PF_vfio": [ { "OS": [ "ALL" @@ -3302,12 +3302,13 @@ "Comments": "testpmd not support socket-mem and file-prefix param in freebsd" } ], - "fdir_for_ipv4": [ + "fdir_for_ipv4_PF_vfio": [ { "OS": [ "ALL" ], "NIC": [ + "IGC-I226_LM", "IGC-I225_LM" ], "Target": [ @@ -3330,7 +3331,7 @@ "Comments": "testpmd not support socket-mem and file-prefix param in freebsd" } ], - "fdir_for_ipv6": [ + "fdir_for_ipv6_PF_vfio": [ { "OS": [ "freebsd" diff --git a/conf/test_case_supportlist.json b/conf/test_case_supportlist.json index 2fd6ae33..764aee86 100644 --- a/conf/test_case_supportlist.json +++ b/conf/test_case_supportlist.json @@ -846,14 +846,13 @@ "Comments": "the nic on the environment not support this case" } ], - "fdir_for_ipv4": [ + "fdir_for_ipv4_PF_vfio": [ { "OS": [ "ALL" ], "NIC": [ "IXGBE_10G-82599_SFP", - "IGC-I225_LM", "IXGBE_10G-X550EM_X_10G_T", "IXGBE_10G-X550T", "I40E_10G-SFP_XL710", @@ -893,7 +892,7 @@ "Comments": "the nic on the environment not support this case" } ], - "fdir_for_ipv6": [ + "fdir_for_ipv6_PF_vfio": [ { "OS": [ "ALL" From patchwork Fri Dec 9 07:08:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 120690 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 43E6FA0093; Fri, 9 Dec 2022 09:05:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FA2442D2F; Fri, 9 Dec 2022 09:05:04 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id E964242D27 for ; Fri, 9 Dec 2022 09:05:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670573102; x=1702109102; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=oPj4J4P3I2rrjTEZL7GMs71M/nw1Bc4MKv45ikYVlUA=; b=I7tiOultUi1sFaX8KbBTM63yURF7B4T4dK+rHMdyk8avDGlzwm/+7HhH 6mefU0cyC3krj3EyHoCBhMhIGpqv11SoltyAKq9mBojC4kP5GMj5v5jk2 rGdBMrzTqsMawBWMZLHW5tZjeaAICJSNum3GGuC+Nw3CGp0j062ASe5l+ Z4I8Q3Kqxsw4twxAyjoHKdHwacPPi+AU3x9vf3+iD/cj3CaiRIC3lCHJ9 fN3fmvnJPAuNHVFkDgbfCquOFU3+hA5BNQ3264gppfzBzGO3KpJONzlHA 7d0LnzTU1FqhGH2WqNJalLDoQVIe3btc2CeMTXuUfcX8clrml61BGylwo w==; X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="305051974" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="305051974" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:05:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="678074603" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="678074603" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:05:00 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V2 4/5] framework/test_case: add skip_unsupported_host_driver decorator Date: Fri, 9 Dec 2022 02:08:06 -0500 Message-Id: <20221209070807.1134-5-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209070807.1134-1-linglix.chen@intel.com> References: <20221209070807.1134-1-linglix.chen@intel.com> 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 decorator Signed-off-by: Lingli Chen --- V2: reformat framework/test_case.py framework/test_case.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/framework/test_case.py b/framework/test_case.py index 2831cb36..86f5bbbf 100644 --- a/framework/test_case.py +++ b/framework/test_case.py @@ -606,3 +606,25 @@ def check_supported_nic(nics): return wrapper return decorator + + +def skip_unsupported_host_driver(drivers): + """ + Skip case which are not supported by the host driver(vfio-pci/igb_uio etc.) + """ + if isinstance(drivers, str): + drivers = [drivers] + + def decorator(func): + @wraps(func) + def wrapper(*args, **kwargs): + test_case = args[0] + if test_case.drivername in drivers: + raise VerifySkip( + "{} do not support this case".format(test_case.drivername) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator From patchwork Fri Dec 9 07:08:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 120691 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 5D923A0093; Fri, 9 Dec 2022 09:05:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5956B42D0B; Fri, 9 Dec 2022 09:05:06 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id F37B740E0F for ; Fri, 9 Dec 2022 09:05:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670573104; x=1702109104; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=IPrOZOgY42ERkDwSjoYb4GalLMm+FKOS2YZF0UmmL9A=; b=WCiKrjYNWLm3omGhykyrL/KPLNaNE+5PgcaHNGLThI1q4CD6LIr9hejL eNSIc2zDzgNIGtP1/96rxV2SdwXxzCC5bYSJuY/p1MdvG9POk/EqNPtDl TFy8pwcEHbvhyFcsltucEkOlnmeiifs4awLPVCG6chOycYsPAHcTg3O/2 /4HMHRGuhIw/83ZfcjXEC/fzK9MV+hMK1QwiM32kRHlivfkop60YMrwkp UaocW7Vz3AA065Ns2OfyFQki5HllNvEDG+dy0evXSe97KbIVkMxkZ8C2k wirdZi5InHMKzeF3HanOAxnqlCFJKHxffu321l7GbD4ZKnCBSk+I93zU4 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="305051978" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="305051978" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:05:03 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10555"; a="678074623" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="678074623" Received: from unknown (HELO localhost.localdomain) ([10.239.252.99]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 00:05:01 -0800 From: Lingli Chen To: dts@dpdk.org Cc: zhiminx.huang@intel.com, Lingli Chen Subject: [dts][PATCH V2 5/5] tests/TestSuite_*: skip igb_uio cases Date: Fri, 9 Dec 2022 02:08:07 -0500 Message-Id: <20221209070807.1134-6-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209070807.1134-1-linglix.chen@intel.com> References: <20221209070807.1134-1-linglix.chen@intel.com> 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 7 suits (external_memory/ip_pipeline/qinq_filter/veb_switch/vf_interrupt_pmd/vf_macfilter/vf_packet_rxtx) skip igb_uio cases. Signed-off-by: Lingli Chen --- V2: reformat tests/TestSuite_vf_interrupt_pmd.py tests/TestSuite_external_memory.py | 4 +++- tests/TestSuite_ip_pipeline.py | 3 ++- tests/TestSuite_qinq_filter.py | 4 +++- tests/TestSuite_veb_switch.py | 3 ++- tests/TestSuite_vf_interrupt_pmd.py | 3 ++- tests/TestSuite_vf_macfilter.py | 4 +++- tests/TestSuite_vf_packet_rxtx.py | 4 +++- 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/TestSuite_external_memory.py b/tests/TestSuite_external_memory.py index 8163a7ec..c565eba8 100644 --- a/tests/TestSuite_external_memory.py +++ b/tests/TestSuite_external_memory.py @@ -12,7 +12,7 @@ import time import framework.utils as utils from framework.pmd_output import PmdOutput -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver class TestExternalMemory(TestCase): @@ -62,6 +62,7 @@ class TestExternalMemory(TestCase): self.dut.bind_interfaces_linux(driver="vfio-pci") + @skip_unsupported_host_driver(["vfio-pci"]) def test_IGB_UIO_xmem(self): """ Verifier IGB_UIO and anonymous memory allocation @@ -75,6 +76,7 @@ class TestExternalMemory(TestCase): ) self.verifier_result() + @skip_unsupported_host_driver(["vfio-pci"]) def test_IGB_UIO_xmemhuage(self): """ Verifier IGB_UIO and anonymous hugepage memory allocation diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline.py index 80a7dbc8..043516dd 100644 --- a/tests/TestSuite_ip_pipeline.py +++ b/tests/TestSuite_ip_pipeline.py @@ -13,7 +13,7 @@ from scapy.utils import hexstr, rdpcap, wrpcap from framework.exception import VerifyFailure from framework.packet import Packet -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver class TestIPPipeline(TestCase): @@ -605,6 +605,7 @@ class TestIPPipeline(TestCase): cmd = "^C" self.dut.send_expect(cmd, "# ", 20) + @skip_unsupported_host_driver(["vfio-pci"]) def test_pfdpdk_vf_l2fwd_pipeline(self): """ VF l2fwd pipeline, PF bound to DPDK driver diff --git a/tests/TestSuite_qinq_filter.py b/tests/TestSuite_qinq_filter.py index 6b5b756c..87653681 100644 --- a/tests/TestSuite_qinq_filter.py +++ b/tests/TestSuite_qinq_filter.py @@ -13,7 +13,7 @@ import time import framework.utils as utils from framework.pmd_output import PmdOutput -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver class TestQinqFilter(TestCase): @@ -208,6 +208,7 @@ class TestQinqFilter(TestCase): self.dut.send_expect("quit", "#") + @skip_unsupported_host_driver(["vfio-pci"]) def test_qinq_packet_filter_VF_queues(self): """ qinq filter packet received by assign VF queues @@ -303,6 +304,7 @@ class TestQinqFilter(TestCase): self.verify(not error_message, error_message) + @skip_unsupported_host_driver(["vfio-pci"]) def test_qinq_filter_with_diffierent_tpid(self): """ qinq filter packet with different tpid received by assign VF queues diff --git a/tests/TestSuite_veb_switch.py b/tests/TestSuite_veb_switch.py index 77ba9559..f391a0ee 100644 --- a/tests/TestSuite_veb_switch.py +++ b/tests/TestSuite_veb_switch.py @@ -17,7 +17,7 @@ from framework.packet import Packet from framework.pmd_output import PmdOutput from framework.project_dpdk import DPDKdut from framework.settings import HEADER_SIZE -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver from framework.utils import RED from framework.virt_dut import VirtDut @@ -384,6 +384,7 @@ class TestVEBSwitching(TestCase): "VF1 didn't receive packets from VF0, the vlan filter doen't work", ) + @skip_unsupported_host_driver(["vfio-pci"]) def test_VEB_switching_inter_vfs_and_pf(self): """ DPDK PF, then create 2VFs, PF in the host running dpdk testpmd, VFs diff --git a/tests/TestSuite_vf_interrupt_pmd.py b/tests/TestSuite_vf_interrupt_pmd.py index 5854cb0c..4fdff601 100644 --- a/tests/TestSuite_vf_interrupt_pmd.py +++ b/tests/TestSuite_vf_interrupt_pmd.py @@ -13,7 +13,7 @@ import time import framework.utils as utils from framework.packet import Packet -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver from framework.virt_common import VM @@ -288,6 +288,7 @@ class TestVfInterruptPmd(TestCase): "lcore %s not sleeps" % self.core_user, ) + @skip_unsupported_host_driver(["vfio-pci"]) def test_nic_interrupt_PF_igb_uio(self): """ Check Interrupt for PF with igb_uio driver diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py index dc4e1098..974d0e40 100644 --- a/tests/TestSuite_vf_macfilter.py +++ b/tests/TestSuite_vf_macfilter.py @@ -7,7 +7,7 @@ import time from framework.pmd_output import PmdOutput from framework.settings import DPDK_DCFMODE_SETTING, load_global_setting -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver from framework.virt_common import VM VM_CORES_MASK = "all" @@ -229,6 +229,7 @@ class TestVfMacFilter(TestCase): self.setup_2pf_2vf_1vm_env(False, driver="") self.send_packet_and_verify() + @skip_unsupported_host_driver(["vfio-pci"]) def test_dpdk_2pf_2vf_1vm_mac_add_filter(self): """ test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario. @@ -253,6 +254,7 @@ class TestVfMacFilter(TestCase): self.setup_2pf_2vf_1vm_env(False, driver="igb_uio") self.send_packet_and_verify() + @skip_unsupported_host_driver(["vfio-pci"]) def test_dpdk_2pf_2vf_1vm_iplink_macfilter(self): """ test case for dpdk pf and dpdk vf 2pf_2vf_1vm MAC filter scenario. diff --git a/tests/TestSuite_vf_packet_rxtx.py b/tests/TestSuite_vf_packet_rxtx.py index 5d57c462..0d52b6d3 100644 --- a/tests/TestSuite_vf_packet_rxtx.py +++ b/tests/TestSuite_vf_packet_rxtx.py @@ -7,7 +7,7 @@ import time from framework.packet import Packet from framework.pmd_output import PmdOutput -from framework.test_case import TestCase +from framework.test_case import TestCase, skip_unsupported_host_driver from framework.virt_common import VM VM_CORES_MASK = "all" @@ -164,6 +164,7 @@ class TestVfPacketRxtx(TestCase): self.packet_rx_tx(driver="") ######2. test case for dpdk pf and dpdk vf 2pf_2vf_1vm scenario packet rx tx. + @skip_unsupported_host_driver(["vfio-pci"]) def test_dpdk_2pf_2vf_1vm(self): self.packet_rx_tx(driver="igb_uio") @@ -266,6 +267,7 @@ class TestVfPacketRxtx(TestCase): self.setup_3vf_2vm_env(driver="") self.vf_reset() + @skip_unsupported_host_driver(["vfio-pci"]) def test_dpdk_pf_vf_reset(self): self.setup_3vf_2vm_env(driver="igb_uio") self.vf_reset()