From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A82BA09FF; Thu, 24 Dec 2020 09:19:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3838CA0A; Thu, 24 Dec 2020 09:19:00 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D1EE1CA00 for ; Thu, 24 Dec 2020 09:18:58 +0100 (CET) IronPort-SDR: Avbv+wERRmRsL2ebY7gLeikQWnBV1pQB/uiCYT/O1ior3CZNJGmcHPLk/mE55A7eLCh6BjiblC /sTy5ld1kVuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9844"; a="172613107" X-IronPort-AV: E=Sophos;i="5.78,444,1599548400"; d="scan'208";a="172613107" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Dec 2020 00:18:53 -0800 IronPort-SDR: dyez8fKg8J7XiHPdP7yW/qORBeeJheVmVcTFpiOcsu+KgyN7c4nCzcsEgUZ9E4T3SXraQ3TO50 YOoB3gguo+Mg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,444,1599548400"; d="scan'208";a="458348324" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga001.fm.intel.com with ESMTP; 24 Dec 2020 00:18:50 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 24 Dec 2020 00:18:50 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 24 Dec 2020 00:18:49 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 24 Dec 2020 00:18:49 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 24 Dec 2020 00:18:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aXHEUhswgiYEI+wFO8O4PtZsR5dqrzqeZlUEL8QKZ7GhGl9Sn0kxahtMMVF0Q86c00VFD2jgy60ICjNufnR5Txwlt1QV0PCcDs1skScLJ7A4so2WAtZUlDuJvQnDEycXL5wahTu6qvHvq4xwQpYMcyoyhMrz9Rw2TWCTVJum8b760xNhBLZOM1rt1CLMTM9vJJGQiYJaN8DVbjlxPwqk0s5xgrlmfGq+h2GLXA8KxZX2OOmrdrCRvEr5+Byg62oOYZ1VZ0fxYuLoaCmWoMTJNNq0ARYqmUA1AeXmPh1pzxAWbeD6a5vI+NsNk2fMA4HqDqWalbnXeUY8J7Hf8pOi3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nxhBzAtQXqyTtyw4tYkGeB3S11Bzb3fi0uldGdrK144=; b=e2R22rsOZt67CyRnm7PzQrKdPXgYSJVUBXLtmEAUNzNSndDjR2+1NtLZ+xwGSUI98JCOOv4OFfNdy/pwijOW2dSTuql1GyWozUhReEmsv+6o4S19AkfRBdlwS5GTvq0RurFXOZtsr7a0ajCqUsL1DhxYNEOa1BWQmycF+3bTZl+UrTuxV7YZarwsoDnQ+fnZogzciABDxVG6D4fESOfPQVnwGIr0/vqTdE5WaoBonFJMLpwDYlpHS597nEVMNUuoCaThIWQYT8VryNk9GqKzCUTAdGaXDHh3hWmLVOW7DqgnjjrkVZK9mGByiIJXTeDXPq/uNh4J7MD9VprkXAE5mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nxhBzAtQXqyTtyw4tYkGeB3S11Bzb3fi0uldGdrK144=; b=T5CzwqUIG1Nv8tqYpXMTyL72/LVx1mymKBGoEtCV5TPhWzDILNcJkCaNhLYxv9uKEFYXaSk/4wZ8i3jRi4RSPea9QZ1pdkER4Yg2IqRcmPJ8Gxkr1WqTyq03VX5sCJS5vh7Ndxrp9nkPdp9gZqk1G8RyWgya8/CBXe6vymrnDug= Received: from BL0PR11MB3364.namprd11.prod.outlook.com (2603:10b6:208:69::21) by BL0PR11MB2900.namprd11.prod.outlook.com (2603:10b6:208:31::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.25; Thu, 24 Dec 2020 08:18:45 +0000 Received: from BL0PR11MB3364.namprd11.prod.outlook.com ([fe80::b8cc:2b0f:dcd5:953]) by BL0PR11MB3364.namprd11.prod.outlook.com ([fe80::b8cc:2b0f:dcd5:953%3]) with mapi id 15.20.3676.034; Thu, 24 Dec 2020 08:18:45 +0000 From: "Lin, Xueqin" To: "Xu, HailinX" , "dts@dpdk.org" CC: "Xu, HailinX" Thread-Topic: [dts] [PATCH v2] tests:add large_vf. Thread-Index: AQHW1N5E6EEZemiPI0iN8DwqEm3boKoF8OvA Date: Thu, 24 Dec 2020 08:18:45 +0000 Message-ID: References: <1608254867-75290-1-git-send-email-hailinx.xu@intel.com> In-Reply-To: <1608254867-75290-1-git-send-email-hailinx.xu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1387ce27-e57c-4eda-d6a0-08d8a7e4885d x-ms-traffictypediagnostic: BL0PR11MB2900: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:24; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w9WTX1auLmqeXyefVwdNDR8lpGbIEOb7FywWXnTYGwoAHEE6gdSDpd5AQb+NQ5CPhTAV25c+CkRS21cdElQjUJcin2WFnotW31+g17FMQ0SEGPLK18wGxPINMxiF8S3xZVLNNoaEcjXuY3fQcl1Zr9/0AvWVf3jtZnCw47OBzG63fqjoM3gNhE4En7xfXAaq6Y33aRqekTT4XC0vKS+0lQQdBSe3AdH+DbGbMcHU0RVUEgZ+KbLLJutml6ZSGMKc8vuqZc9Vk8T+IsfqH4/Ks/QkLOIKwFHfOBgbp5VIB3A8VspqUmgmGudw4ykTAK5QQ0pnlp/PAM5aD/a28C2QOZ7gzX9yOYxxEXe1V2RcAtqfQI0IDtfpasWVYAW+Tw8/mou4Qc8Jwwc5a9dTYwHNMA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR11MB3364.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(478600001)(33656002)(76116006)(26005)(110136005)(71200400001)(30864003)(316002)(53546011)(8676002)(64756008)(7696005)(6506007)(86362001)(66476007)(66556008)(5660300002)(66446008)(186003)(66946007)(52536014)(4326008)(107886003)(8936002)(2906002)(83380400001)(9686003)(55016002)(559001)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?fRIwpuK8AE6esqlD9nrEtIEp7bbH5bQfw2pt0x2OBWaYsMVBDUtFqL5D25dM?= =?us-ascii?Q?lIy0Or5lzrNUQVqoOXP5t14+jR8oH3sMFrolLgN+43us4eHM8I1rKQ+ID/yH?= =?us-ascii?Q?c6Osqy1lrWX0uMv9rbs42wWlKYeIwuPN5NkbeS0Y//AH3i1PV2SFi5Ju56yp?= =?us-ascii?Q?jketOB3fZXD6iV6Q0YEYkhquxUlmHZWU0194Y7721lgVVRRXLIdzxtF9+Esw?= =?us-ascii?Q?rpBLEH2j+9DiXixZSeGsd/wvrBgXj3FxiRvBIokkrHHnWgE8JOJltjP3Qeg1?= =?us-ascii?Q?Ia8AXj07U0lESf53KwFXF7unaky/xH+Wcx8aohSnnQIjAX59I+8cfwv8RBWz?= =?us-ascii?Q?/t9bbPMuVhYRCK7laiZs3BjkFZ0ukjwaq+bZHd9IzMBIY2x5cbqssQsxuq8j?= =?us-ascii?Q?J+TgeBHi85KsgzRwC2Y0VI3DyKs9qaVjr3He2OxWlcm3SdbqhBvm+3ovDDIl?= =?us-ascii?Q?5kKXNCwqSNdFzCnI9ELDbH+P659C5Otals1n10ot32BnfTfTBtDgw7/wBHVf?= =?us-ascii?Q?jgNx+jPOWPH7e2h0sJV/Cj1kM23PHIwSJ/kdt8Iy5Ha+3iVvEPeJwGYqVMhK?= =?us-ascii?Q?kp9AL/2WYShhWWfCzkvLBuWqpWHzxEdnkYi4hqeVILwf4BfJ4gK9kI2PWO0F?= =?us-ascii?Q?/U2SHwD/iKbSYyOZP9dXyavu2LsbT9vbt2UqAYTumFD3TWBp0QhQh9397ZSH?= =?us-ascii?Q?a8cn+GGEdITy6eh+sZvTvZU15pV+4aaA68QWO9D/dmFb1o+zD/DqP47IgD05?= =?us-ascii?Q?URKk0SWzewvaXsOYaY/AskUDoz8T9abTQmJ4zwmlmXMDQiKcTwY2XEsvdZjG?= =?us-ascii?Q?z4W0a6ukj9wZ4+ICrvWyb4UTrjyOy9P16dkbaDGxU8XWfnkfpye8vXWQy/gN?= =?us-ascii?Q?kpLVjpwVSM8m4T8fncobCFIVQ3uPvAUUaGfg9h0HISas+nTjNJAU4bPcvjyt?= =?us-ascii?Q?W8MfmEJIozxXV0cE4qjOeqAMa7Ai1pfv4odsPLCBakQ=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR11MB3364.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1387ce27-e57c-4eda-d6a0-08d8a7e4885d X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2020 08:18:45.3739 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GD98keBCq+vi9uLmwCc+pcjY71GiATqhiLi90l0e0pT4fA/gkR4I1YvTW6Hm+/TnZSneVtLaCiRrtDBDZq+WGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB2900 X-OriginatorOrg: intel.com Subject: Re: [dts] [PATCH v2] tests:add large_vf. X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Acked-by: Xueqin Lin > -----Original Message----- > From: dts On Behalf Of Hailin Xu > Sent: Friday, December 18, 2020 9:28 AM > To: dts@dpdk.org > Cc: Xu, HailinX > Subject: [dts] [PATCH v2] tests:add large_vf. >=20 > add large_vf suite. >=20 > Signed-off-by: Hailin Xu > --- > tests/TestSuite_large_vf.py | 534 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 534 insertions(+) > create mode 100755 tests/TestSuite_large_vf.py >=20 > diff --git a/tests/TestSuite_large_vf.py b/tests/TestSuite_large_vf.py ne= w file > mode 100755 index 00000000..77c9fc62 > --- /dev/null > +++ b/tests/TestSuite_large_vf.py > @@ -0,0 +1,534 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2020 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without # > +modification, are permitted provided that the following conditions # > +are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS # > +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # > +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS > FOR # > +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > COPYRIGHT # > +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > INCIDENTAL, # > +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > # > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > USE, # > +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON > ANY # > +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # > +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE > USE # > +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + > +import re > +import time > + > +from packet import Packet > +from pmd_output import PmdOutput > +from test_case import TestCase > + > +from utils import GREEN, RED > + > +multi_fdir_queue_group =3D { > + "match": [ > + > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.21')= /UDP(sport > =3D22,dport=3D23)/Raw('x'*80)", > + > "Ether(dst=3D'00:11:22:33:44:55')/IPv6(src=3D'2001::2')/UDP(sport=3DRandS= hort())/('x > '*80)", > + "Ether(dst=3D'00:11:22:33:44:55')/IP()/TCP(sport=3D22, > dport=3DRandShort())/Raw('x'*80)", > + "Ether(dst=3D'00:11:22:33:44:55')/IPv6(dst=3D'2001::2')/TCP(dpor= t=3D23, > sport=3DRandShort())/Raw('x'*80)"], > + "mismatch": [ > + > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.22')= /UDP(sport > =3D22,dport=3D24)/Raw('x'*80)", > + > "Ether(dst=3D'00:11:22:33:44:55')/IPv6(src=3D'2001::3')/UDP(sport=3DRandS= hort())/('x > '*80)", > + "Ether(dst=3D'00:11:22:33:44:55')/IP()/TCP(sport=3D23, > dport=3DRandShort())/Raw('x'*80)", > + > +"Ether(dst=3D'00:11:22:33:44:55')/IPv6(dst=3D'2001::2')/TCP(dport=3D22, > +sport=3DRandShort())/Raw('x'*80)"] } > + > +check_multi_fdir_consistent_queue_group =3D { > + "match": [ > + {"matched_id": "0x1", "queue": (0, 63)}, > + {"matched_id": "0x2", "queue": (64, 127)}, > + {"matched_id": "0x3", "queue": (128, 191)}, > + {"matched_id": "0x4", "queue": (192, 255)}], > + "mismatch": {"queue": (0, 63)} > +} > + > +check_multi_fdir_inconsistent_queue_group =3D { > + "match": [ > + {"matched_id": "0x1", "queue": (5, 20)}, > + {"matched_id": "0x2", "queue": (80, 87)}, > + {"matched_id": "0x3", "queue": (150, 213)}, > + {"matched_id": "0x4", "queue": (252, 255)}], > + "mismatch": {"queue": (0, 63)} > +} > + > +multi_fdir_consistent_queue_group =3D { > + "name": "test_multi_fdir_consistent_queue_group", > + "param": "--txq=3D256 --rxq=3D256", > + "rule": [ > + "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.21 / = udp src is > 22 / end actions rss queues 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1= 8 19 > 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 4= 4 > 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 end / mark id 1 = / > end", > + "flow create 0 ingress pattern eth / ipv6 src is 2001::2 / udp /= end actions > rss queues 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84= 85 > 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 > 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 > 126 127 end / mark id 2 / end", > + "flow create 0 ingress pattern eth / ipv4 / tcp src is 22 / end = actions rss > queues 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 > 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 > 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 > 180 181 182 183 184 185 186 187 188 189 190 191 end / mark id 3 / end", > + "flow create 0 ingress pattern eth / ipv6 dst is 2001::2 / tcp d= st is 23 / > end actions rss queues 192 193 194 195 196 197 198 199 200 201 202 203 > 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 > 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 > 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 end / > mark id 4 / end"], > + "scapy_str": multi_fdir_queue_group, > + "check_param": check_multi_fdir_consistent_queue_group, > + "count": 1000 > +} > + > +multi_fdir_inconsistent_queue_group =3D { > + "name": "test_multi_fdir_inconsistent_queue_group", > + "param": "--txq=3D256 --rxq=3D256", > + "rule": [ > + "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.21 / = udp src is > 22 / end actions rss queues 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 en= d / > mark id 1 / end", > + "flow create 0 ingress pattern eth / ipv6 src is 2001::2 / udp /= end actions > rss queues 80 81 82 83 84 85 86 87 end / mark id 2 / end", > + "flow create 0 ingress pattern eth / ipv4 / tcp src is 22 / end = actions rss > queues 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 > 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 > 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 > 202 203 204 205 206 207 208 209 210 211 212 213 end / mark id 3 / end", > + "flow create 0 ingress pattern eth / ipv6 dst is 2001::2 / tcp d= st is 23 / > end actions rss queues 252 253 254 255 end / mark id 4 / end"], > + "scapy_str": multi_fdir_queue_group, > + "check_param": check_multi_fdir_inconsistent_queue_group, > + "count": 1000 > +} > + > +basic_rxtx =3D { > + "name": "test_basic_rxtx", > + "param": "--txq=3D256 --rxq=3D256", > + "scapy_str": > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.21')= /UDP(sport > =3D22,dport=3D23)/Raw('x'*80)", > + "check_param": [255, 63], > + "count": 1000 > +} > + > +different_queues_switch =3D { > + "name": "test_different_queues_switch", > + "q_num": [16, 256], > + "rule": [ > + "flow create 0 ingress pattern eth / ipv6 src is 2001::2 / udp /= end actions > rss queues 1 2 3 4 end / mark id 1 / end", > + "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.21 / = udp src is > 22 / end actions rss queues 8 9 10 11 12 13 14 15 end / mark id 2 / end"]= , > + "scapy_str": { > + "match": [ > + > "Ether(dst=3D'00:11:22:33:44:55')/IPv6(src=3D'2001::2')/UDP(sport=3DRandS= hort())/('x > '*80)", > + > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.21')= /UDP(sport > =3D22,dport=3D23)/Raw('x'*80)"], > + "mismatch": [ > + > "Ether(dst=3D'00:11:22:33:44:55')/IPv6(src=3D'2001::3')/UDP(sport=3DRandS= hort())/('x > '*80)", > + > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.22')= /UDP(sport > =3D22,dport=3D24)/Raw('x'*80)"] > + }, > + "check_param": { > + "match":[ > + {"matched_id": "0x1", "queue": (1, 4)}, > + {"matched_id": "0x2", "queue": (8, 15)}], > + "mismatch": {"queue": (0, 15)} > + }, > + "count": 1000 > +} > + > +pf_large_vf_fdir_coexist =3D { > + "name": "test_pf_large_vf_fdir_coexist", > + "param": [21, 63], > + "check_param": (54, 63), > + "count": 1 > +} > + > +exceed_256_queues =3D { > + "name": "test_exceed_256_queues", > + "param": ["--txq=3D512 --rxq=3D512", "--txq=3D256 --rxq=3D256"], > + "check_param": "Fail: input txq (512) can't be greater than max_tx_q= ueues > (256)" > +} > + > +more_than_3_vfs_256_queues =3D { > + "name": "test_more_than_3_vfs_256_queues", > + "param": "--txq=3D256 --rxq=3D256", > + "check_param": "Cause: Start ports failed" > +} > + > +max_vfs_256_queues_3 =3D [multi_fdir_consistent_queue_group, > multi_fdir_inconsistent_queue_group, > + basic_rxtx, different_queues_switch, pf_large_vf= _fdir_coexist, > exceed_256_queues, > + more_than_3_vfs_256_queues] > + > +multi_fdir_among =3D { > + "name": "test_multi_fdir_among", > + "rule": [ > + "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.21 / = udp src is > 22 / end actions rss queues 0 1 end / mark id 1 / end", > + "flow create 0 ingress pattern eth / ipv6 src is 2001::2 / udp /= end actions > rss queues 2 3 end / mark id 2 / end" > + ], > + "scapy_str": { > + "match": [ > + > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.21')= /UDP(sport > =3D22,dport=3D23)/Raw('x'*80)", > + > "Ether(dst=3D'00:11:22:33:44:55')/IPv6(src=3D'2001::2')/UDP(sport=3DRandS= hort())/('x > '*80)"], > + "mismatch": [ > + > "Ether(dst=3D'00:11:22:33:44:55')/IP(src=3DRandIP(),dst=3D'192.168.0.22')= /UDP(sport > =3D22,dport=3D24)/Raw('x'*80)", > + > "Ether(dst=3D'00:11:22:33:44:55')/IPv6(src=3D'2001::3')/UDP(sport=3DRandS= hort())/('x > '*80)"] > + }, > + "check_param": { > + "match": [ > + {"matched_id": "0x1", "queue": (0, 1)}, > + {"matched_id": "0x2", "queue": (2, 3)}], > + "mismatch": {"queue": (0, 3)} > + }, > + "count": 1000 > +} > + > +more_than_4_queues_128_vfs =3D { > + "name": "test_more_than_4_queues_128_vfs", > + "param": ["--txq=3D8 --rxq=3D8", "--txq=3D4 --rxq=3D4"], > + "check_param": "configure queues failed" > +} > + > +more_than_128_vfs_4_queues =3D { > + "name": "test_more_than_128_vfs_4_queues", > + "vf_num": [128, 129], > + "check_param": "-bash: echo: write error: Numerical result out of ra= nge" > +} > + > +max_vfs_4_queues_128 =3D [multi_fdir_among, more_than_4_queues_128_vfs, > +more_than_128_vfs_4_queues] > + > + > +class TestLargeVf(TestCase): > + def set_up_all(self): > + """ > + Run at the start of each test suite. > + """ > + # Based on h/w type, choose how many ports to use > + self.dut_ports =3D self.dut.get_ports(self.nic) > + self.verify(self.nic in ["columbiaville_25g", "columbiaville_100= g"], "%s nic > not support large vf" % self.nic) > + self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for = testing") > + self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > + self.vf_mac =3D "00:11:22:33:44:55" > + self.tester_port0 =3D self.tester.get_local_port(self.dut_ports[= 0]) > + self.tester_iface0 =3D self.tester.get_interface(self.tester_por= t0) > + self.used_dut_port =3D self.dut_ports[0] > + self.pf0_intf =3D self.dut.ports_info[self.dut_ports[0]]['intf'] > + self.pf0_pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'] > + self.pf0_mac =3D self.dut.get_mac_address(0) > + > + self.vf_flag =3D False > + # set vf driver > + self.vf_driver =3D 'vfio-pci' > + self.dut.send_expect('modprobe vfio-pci', '#') > + > + self.pkt =3D Packet() > + self.pmd_output =3D PmdOutput(self.dut) > + > + def set_up(self): > + """ > + Run before each test case. > + """ > + pass > + > + def create_iavf(self, vf_numbers): > + # Generate 3 VFs on each PF and set mac address for VF0 > + self.dut.bind_interfaces_linux('ice') > + self.dut.generate_sriov_vfs_by_port(self.used_dut_port, vf_numbe= rs) > + self.sriov_vfs_port =3D self.dut.ports_info[self.used_dut_port][= 'vfs_port'] > + self.vf_flag =3D True > + > + try: > + for port in self.sriov_vfs_port: > + port.bind_driver(self.drivername) > + self.vf0_prop =3D {'opt_host': self.sriov_vfs_port[0].pci} > + self.dut.send_expect("ifconfig %s up" % self.pf0_intf, "# ") > + self.dut.send_expect("ip link set %s vf 0 mac %s" % (self.pf= 0_intf, > self.vf_mac), "# ") > + except Exception as e: > + self.destroy_iavf() > + raise Exception(e) > + > + def destroy_iavf(self): > + if self.vf_flag is True: > + self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) > + self.vf_flag =3D False > + > + def launch_testpmd(self, param, total=3DFalse): > + if total: > + param =3D param + " --total-num-mbufs=3D500000" > + self.pmd_output.start_testpmd("all", param=3Dparam, > + > + ports=3D[self.sriov_vfs_port[0].pci], socket=3Dself.ports_socket) > + > + def config_testpmd(self): > + self.pmd_output.execute_cmd("set verbose 1") > + self.pmd_output.execute_cmd("start") > + > + def send_packets(self, packets, count): > + self.pkt.update_pkt(packets) > + self.pkt.send_pkt(crb=3Dself.tester, tx_port=3Dself.tester_iface= 0, > + count=3Dcount) > + > + def send_pkts_getouput(self, pkts, count): > + self.send_packets(pkts, count) > + time.sleep(1) > + out_info =3D self.dut.get_session_output(timeout=3D1) > + out_pkt =3D self.pmd_output.execute_cmd("stop") > + time.sleep(1) > + out =3D out_info + out_pkt > + self.pmd_output.execute_cmd("start") > + self.pmd_output.execute_cmd("clear port stats all") > + return out > + > + def rte_flow_process(self, vectors): > + test_results =3D {} > + for tv in vectors: > + try: > + subcase_name =3D tv['name'] > + self.logger.info("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dsu= bcase %s=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" % > subcase_name) > + if subcase_name =3D=3D "test_basic_rxtx": > + self.pmd_output.execute_cmd("flow flush 0") > + self.check_txonly_pkts() > + self.pmd_output.execute_cmd("set fwd rxonly") > + out =3D self.send_pkts_getouput(tv["scapy_str"], tv[= "count"]) > + self.check_iavf_fdir_value(out, tv["check_param"][1]= , tv["count"]) > + elif subcase_name =3D=3D "test_different_queues_switch": > + for i in range(2): > + # set rxq txq of 16 > + self.check_rxqtxq_number(tv["q_num"][0]) > + self.create_fdir_rule(tv["rule"]) > + self.check_match_mismatch_pkts(tv) > + # set rxq txq of 16 > + self.check_rxqtxq_number(tv["q_num"][1]) > + self.create_fdir_rule(vectors[0]["rule"]) > + self.check_match_mismatch_pkts(vectors[0]) > + elif subcase_name =3D=3D "test_pf_large_vf_fdir_coexist"= : > + pmdout =3D PmdOutput(self.dut, self.session_list[0]) > + self.create_pf_rule(pmdout, self.pf0_intf, tv["param= "][0], > tv["param"][1]) > + self.send_pkts_pf_check(pmdout, self.pf0_intf, self.= pf0_mac, > tv["param"][0], tv["check_param"], tv["count"]) > + self.create_fdir_rule(vectors[0]["rule"]) > + self.check_match_mismatch_pkts(vectors[0]) > + self.destroy_pf_rule(pmdout, self.pf0_intf) > + elif subcase_name =3D=3D "test_exceed_256_queues": > + self.pmd_output.execute_cmd("quit", "#") > + eal_param =3D "-w {} --file-prefix=3Dport0vf0 -- -i > ".format(self.sriov_vfs_port[0].pci) > + cmd =3D "x86_64-native-linuxapp-gcc/app/dpdk-testpmd= -l 1,2,3,4 - > n 4 " + eal_param + tv["param"][0] > + out =3D self.pmd_output.execute_cmd(cmd, "# ") > + self.verify(tv["check_param"] in out, "fail: testpmd= start > successfully") > + self.pmd_output.execute_cmd("quit", "#") > + self.launch_testpmd(tv["param"][1]) > + self.check_rxqtxq_number(512, tv["check_param"]) > + elif subcase_name =3D=3D "test_more_than_3_vfs_256_queue= s": > + self.pmd_output.execute_cmd("quit", "#") > + self.destroy_iavf() > + self.create_iavf(4) > + # start 4 testpmd uss 256 queues > + for i in range(4): > + if i < 3: > + eal_param =3D "-w {} --file-prefix=3Dport0vf= {} -- -i > ".format(self.sriov_vfs_port[i].pci, i) > + cmd =3D "x86_64-native-linuxapp-gcc/app/dpdk= -testpmd -l > 1,2,3,4 -n 4 " + eal_param + tv["param"] > + self.session_list[i].send_expect(cmd, "testp= md> ") > + else: > + # start fourth testpmd failed > + eal_param =3D "-w {} --file-prefix=3Dport0vf= 3 -- -i > ".format(self.sriov_vfs_port[3].pci) > + cmd =3D "x86_64-native-linuxapp-gcc/app/dpdk= -testpmd -l > 1,2,3,4 -n 4 " + eal_param + tv[ > + "param"] > + out =3D self.dut.send_command(cmd) > + self.verify(tv["check_param"] in out, "fail:= testpmd start > successfully") > + # quit all testpmd > + self.session_list[0].send_expect("quit", "# = ") > + self.session_list[1].send_expect("quit", "# = ") > + self.session_list[2].send_expect("quit", "# = ") > + # case 2: 128_vfs_4_queues > + elif subcase_name =3D=3D "test_multi_fdir_among": > + self.create_fdir_rule(tv["rule"]) > + self.check_match_mismatch_pkts(tv) > + elif subcase_name =3D=3D "test_more_than_128_vfs_4_queue= s": > + self.pmd_output.execute_cmd("quit", "#") > + out =3D self.dut.send_expect("echo {} > > /sys/bus/pci/devices/{}/sriov_numvfs".format( > + tv["vf_num"][0], self.pf0_pci), "# ") > + self.verify(tv["check_param"] not in out, "fail: cre= ate vfs > successfully") > + out =3D self.dut.send_expect("echo {} > > /sys/bus/pci/devices/{}/sriov_numvfs".format( > + tv["vf_num"][1], self.pf0_pci), "# ") > + self.verify(tv["check_param"] in out, "fail: create = vfs successfully") > + elif subcase_name =3D=3D "test_more_than_4_queues_128_vf= s": > + self.pmd_output.execute_cmd("quit", "# ") > + out =3D self.pmd_output.start_testpmd("all", param= =3Dtv["param"][0], > + ports=3D[self.sriov_vfs_port[0].pc= i], > socket=3Dself.ports_socket) > + self.verify(tv["check_param"] in out, "fail: testpmd= start > successfully") > + self.pmd_output.execute_cmd("quit", "#") > + self.launch_testpmd(tv["param"][1]) > + self.check_rxqtxq_number(8, tv["check_param"]) > + else: > + self.create_fdir_rule(tv["rule"]) > + self.check_match_mismatch_pkts(tv) > + test_results[tv["name"]] =3D True > + print((GREEN("=3D=3D=3D=3Dcase passed: %s=3D=3D=3D=3D" %= tv["name"]))) > + except Exception as e: > + print((RED(e))) > + test_results[tv["name"]] =3D False > + print((GREEN("=3D=3D=3D=3Dcase failed: %s=3D=3D=3D=3D" %= tv["name"]))) > + continue > + failed_cases =3D [] > + for k, v in list(test_results.items()): > + if not v: > + failed_cases.append(k) > + self.verify(all(test_results.values()), "{} > + failed.".format(failed_cases)) > + > + def create_fdir_rule(self, rule): > + p =3D re.compile(r"Flow rule #(\d+) created") > + rule_list =3D [] > + self.pmd_output.execute_cmd("flow flush 0") > + if isinstance(rule, list): > + for i in rule: > + out =3D self.pmd_output.execute_cmd(i) > + m =3D p.search(out) > + if m: > + rule_list.append(m.group(1)) > + else: > + rule_list.append(False) > + elif isinstance(rule, str): > + out =3D self.pmd_output.execute_cmd(rule) > + m =3D p.search(out) > + if m: > + rule_list.append(m.group(1)) > + else: > + rule_list.append(False) > + else: > + raise Exception("unsupported rule type, only accept list or = str") > + self.verify(all(rule_list), "some rules create failed, result > + %s" % rule_list) > + > + def create_pf_rule(self,pmdout, pf_intf, ip, action): > + # count: create rules number > + queue_list =3D [] > + self.validation_pf_rule(pmdout, pf_intf) > + for x in range(10): > + queue_list.append(action) > + cmd =3D "ethtool -N {} flow-type udp4 dst-ip 192.168.0.{} sr= c-port 22 > action {}".format(pf_intf, ip, action) > + pmdout.execute_cmd(cmd, "#") > + ip +=3D 1 > + action -=3D 1 > + self.validation_pf_rule(pmdout, pf_intf, 10) > + > + def validation_pf_rule(self, pmdout, pf_intf, count=3D0): > + rule_str =3D "Total (\d+) rules" > + out =3D pmdout.execute_cmd("ethtool -n %s" % pf_intf, "#") > + rule_num =3D re.search(rule_str, out).group(1) > + self.verify(int(rule_num) =3D=3D count, "Incorrect number of PF > + rules") > + > + def send_pkts_pf_check(self, pmdout, pf_intf ,pf_mac, ip, > check_param ,count): > + for x in range(10): > + packet =3D > "Ether(dst=3D'{}')/IP(src=3DRandIP(),dst=3D'192.168.0.{}')/UDP(sport=3D22= ,dport=3D23)/Ra > w('x'*80)".format(pf_mac, ip) > + self.send_packets(packet, 1) > + ip +=3D 1 > + out =3D pmdout.execute_cmd("ethtool -S %s" % pf_intf, "# ") > + for queue in range(check_param[0], check_param[1]+1): > + packet_str =3D "rx_queue_%d_packets: (\d+)" % queue > + packet =3D re.search(packet_str, out).group(1) > + self.verify(int(packet) =3D=3D count, "fail: queues %d recei= ved > + packets not matched" % queue) > + > + def destroy_pf_rule(self, pmdout, pf_intf): > + rule_str =3D "Filter:.*?(\d+)" > + out =3D pmdout.execute_cmd("ethtool -n %s" % pf_intf, "#") > + rule_list =3D re.findall(rule_str, out) > + for rule in rule_list: > + cmd =3D "ethtool -N {} delete {}".format(pf_intf, rule) > + pmdout.execute_cmd(cmd, "#") > + self.validation_pf_rule(pmdout, pf_intf) > + > + def check_iavf_fdir_value(self, out, check_paeam, count, stats=3DFal= se): > + """ > + check match ID and rx/tx queue, pkts count > + """ > + matched_str =3D "matched ID=3D(0x\d+)" > + queue_str =3D "RX Port=3D.*?Queue=3D.*?(\d+)" > + pkts_str =3D "Forward statistics for port.*?\n.*?RX-packets:\s(\= d+)" > + match_list =3D re.findall(matched_str, out) > + if stats: > + self.verify(len(match_list) =3D=3D 0, "fail: received packet= s have fdir ID") > + queue_list =3D re.findall(queue_str, out) > + pkts_num =3D re.search(pkts_str, out).group(1) > + # check pkts numbers > + self.verify(int(pkts_num) =3D=3D count, "fail: received packets = not matched") > + if isinstance(check_paeam, dict): > + # check matched > + if not stats: > + matched_id =3D check_paeam["matched_id"] > + self.verify(matched_id in match_list, "fail: matched id = mismatch") > + matched_count =3D match_list.count(matched_id) > + self.verify(len(match_list) =3D=3D count =3D=3D matched_= count, > + "fail: received packets by matched ID %s not= matched" % > check_paeam["matched_id"]) > + # check queue id > + queue_id =3D check_paeam["queue"] > + self.verify(len(queue_list) =3D=3D queue_id[1] - queue_id[0]= + 1, "fail: > received packets queues number not matched") > + for q_id in range(queue_id[0], queue_id[1] + 1): > + self.verify(str(q_id) in queue_list, "fail: queue id not= matched") > + else: > + self.verify(check_paeam+1 =3D=3D len(queue_list), > + "fail: received packets queues number not matche= d") > + for q_id in range(check_paeam+1): > + self.verify(str(q_id) in queue_list, "fail: queue id > + not matched") > + > + def check_match_mismatch_pkts(self, param): > + match_pkt =3D param["scapy_str"].get("match") > + mismatch_pkt =3D param["scapy_str"].get("mismatch") > + check_match_param =3D param["check_param"].get("match") > + check_mismatch_param =3D param["check_param"].get("mismatch") > + for pkt in match_pkt: > + out =3D self.send_pkts_getouput(pkt, param["count"]) > + param_index =3D match_pkt.index(pkt) > + self.check_iavf_fdir_value(out, check_match_param[param_inde= x], > param["count"]) > + for pkt in mismatch_pkt: > + out =3D self.send_pkts_getouput(pkt, param["count"]) > + self.check_iavf_fdir_value(out, check_mismatch_param, > + param["count"], stats=3DTrue) > + > + def check_txonly_pkts(self, q_num=3D256): > + queue_str =3D "RX Port=3D.*?Queue=3D.*?(\d+)" > + self.pmd_output.execute_cmd("stop") > + self.pmd_output.execute_cmd("set fwd txonly") > + self.pmd_output.execute_cmd("start") > + time.sleep(5) > + out =3D self.pmd_output.execute_cmd("stop") > + queue_list =3D re.findall(queue_str, out) > + self.verify(len(queue_list) =3D=3D q_num, "fail: have queue not = forwarded > packet") > + self.pmd_output.execute_cmd("set fwd rxonly") > + self.pmd_output.execute_cmd("start") > + self.pmd_output.execute_cmd("clear port stats all") > + > + def check_rxqtxq_number(self, rxtx_num, check_param=3DNone): > + self.pmd_output.execute_cmd("stop") > + self.pmd_output.execute_cmd("port stop all") > + self.pmd_output.execute_cmd("port config all rxq %s" % rxtx_num) > + if rxtx_num > 8: > + out =3D self.pmd_output.execute_cmd("port config all txq %s"= % > rxtx_num) > + else: > + out =3D self.pmd_output.execute_cmd("port start all") > + if check_param: > + self.verify(check_param in out, "fail: config port txq succe= ssfully") > + else: > + self.pmd_output.execute_cmd("port start all") > + self.pmd_output.execute_cmd("start") > + rxq_str =3D "Current number of RX queues: (\d+)" > + txq_str =3D "Current number of TX queues: (\d+)" > + out =3D self.pmd_output.execute_cmd("show port info all") > + rxq_num =3D re.search(rxq_str, out).group(1) > + txq_num =3D re.search(txq_str, out).group(1) > + self.verify(int(rxq_num) =3D=3D int(txq_num) =3D=3D rxtx_num= , "current number > of TX/RX queues not match") > + self.check_txonly_pkts(rxtx_num) > + > + def test_3_vfs_256_queues(self): > + self.session_list =3D [] > + for i in range(3): > + name =3D self.dut.new_session() > + self.session_list.append(name) > + self.create_iavf(3) > + self.launch_testpmd("--rxq=3D256 --txq=3D256", total=3DTrue) > + self.config_testpmd() > + self.rte_flow_process(max_vfs_256_queues_3) > + self.dut.close_session(self.session_list) > + > + def test_128_vfs_4_queues(self): > + self.create_iavf(128) > + self.launch_testpmd("--rxq=3D4 --txq=3D4") > + self.config_testpmd() > + self.rte_flow_process(max_vfs_4_queues_128) > + > + def tear_down(self): > + """ > + Run after each test case. > + """ > + self.pmd_output.execute_cmd("quit", "#") > + self.destroy_iavf() > + > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + self.dut.kill_all() > \ No newline at end of file > -- > 2.17.1