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 C3752A04AA; Fri, 7 Aug 2020 05:02:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 82ADC2B87; Fri, 7 Aug 2020 05:02:22 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C43C229D6 for ; Fri, 7 Aug 2020 05:02:19 +0200 (CEST) IronPort-SDR: Qua4mzLw7vrQoqhvZCxMW3LotOlWxDBsFFCzkLUE0GrByqaXiBiLYalXreNXNAFKjg6TL545ga Or1Tx7LhFFsg== X-IronPort-AV: E=McAfee;i="6000,8403,9705"; a="150438152" X-IronPort-AV: E=Sophos;i="5.75,443,1589266800"; d="scan'208";a="150438152" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 20:02:18 -0700 IronPort-SDR: t6WAjx8CEle34oPSX7F/EwUWN81eqH7anqFDr8UBoFM7dEpCaWOSF1tAzcApqyUM1lggomhOzf SN5iBBY3lmKA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,443,1589266800"; d="scan'208";a="275261917" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga007.fm.intel.com with ESMTP; 06 Aug 2020 20:02:18 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 6 Aug 2020 20:02:17 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 6 Aug 2020 20:02:17 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 6 Aug 2020 20:02:17 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 6 Aug 2020 20:02:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5a3o/C6NqC/2f5URnb3PXXKUJ2y6HDVobhBrkparbnKVCekadZQr5GBcDMm5/goW/MqLjAnr2mFUCsTYrKx8fVoHsPRkOOVylzk5R2t/S9ZswKuFbI1NzvUKLGv9qlpqQLuNt8T9TfjRfg12sCz6NazV9fLGLz1ufV6o0L/Bcct8iAsTtBodK1Nq+CxpN3nTODLk2RKNw/DEPa9MATJpKNa06aZpAifWQP8hu+TwxgAP0YW2KFhPSVAXrN8s9+JSdTUDFXtZMUYRmZSZmvgz3QY8VPko1NbVEnq2Bbcy02dEpnjNkad19XKAMGMzUkcISOTUCITqU1O3vpYnCwg/Q== 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=Q34SyoAmVLowiKrjTuptSGUSUQg0ji4aD4wKC8/9C9k=; b=eaVlLK3aEZWyOTALK1vNnh+qyrqFffc3y3R20nsNXgHOwOelpkEX0K/udoGR60eQ0mvy3PhnJiwhhE20YNDCYELHMRXnLFJEhRwLq/naqqI/i4YL1X2aiMCd04qpxfsjY4fxhu4E8ItX5CeIVQQ/l7ncOR736a+9Z+j4pNpsfzoS3B22eRZl8/GObq+vjUIFG30V1goYlqG7VVIgqv2/RfbKqXG0Xn57xmqgCi2OT/KXzHeK6D5+tOFs2V5VaSbwVCmpyPaHrgQ064qgxHKd8LefHMHp5br7hW/52X3K9SmTobF4a/1xKwrZE5gtKvVXpwLsujNmHf+6c4gf7Hvh3Q== 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=Q34SyoAmVLowiKrjTuptSGUSUQg0ji4aD4wKC8/9C9k=; b=d+z8DnOonBocv1rMDkMjzCXMKp/pkp6d25darctcjfF36u3hztrA5jvIQ7EKIheazqYVWoqNHWPeZfUMbyUINuv8j9BUkuWZO+/Z1mESBsZLERaOJv8iagtreOQXlVUF6JN5g+L8Fh2C0mz/2fI/ti+TVGaJRArdiIQAoRwLpK4= Received: from BY5PR11MB3893.namprd11.prod.outlook.com (2603:10b6:a03:183::26) by BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19; Fri, 7 Aug 2020 03:02:15 +0000 Received: from BY5PR11MB3893.namprd11.prod.outlook.com ([fe80::c85c:ec78:c650:6ac9]) by BY5PR11MB3893.namprd11.prod.outlook.com ([fe80::c85c:ec78:c650:6ac9%3]) with mapi id 15.20.3239.023; Fri, 7 Aug 2020 03:02:15 +0000 From: "Peng, Yuan" To: "Chen, BoX C" , "dts@dpdk.org" CC: "Chen, BoX C" , "Peng, Yuan" Thread-Topic: [dts] [PATCH V1 2/2] tests/cvl_fdir: add-new-case-for-test-l2-ethertype Thread-Index: AQHWaiCWuy+vHOOJ4ku5f7CJVhZ8h6kr+e/A Date: Fri, 7 Aug 2020 03:02:15 +0000 Message-ID: References: <20200804052442.4375-1-box.c.chen@intel.com> In-Reply-To: <20200804052442.4375-1-box.c.chen@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action 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.198.147.202] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1d4dbb93-5cef-4eda-756f-08d83a7e4a07 x-ms-traffictypediagnostic: BYAPR11MB3301: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:69; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dN++QoZGJablGpSrdCSSv4aO7WK2SnpD3SiO3fTv8/eLd1+YGEh134JnFJTlYZoPsFtXec7Vj6zpbdctwwOWTAWxy//apauDAHvCk4QIzGfwBbqi5ZwltvGO6Ld6XhGDQCegg2+G5jH7PoKgJ3pAXRGff84YXawCItf1Ilr3CmZ42kKIzKDx4DnX7wUnEzU77VpOtu+zp6+q1SoqhfmqQ8652s6JchbTDcm+qZ2RwAasWKkgW+JADMIfflKNejwq/LqOOZpOYh9IYt+utIiHoKj43SjxvHMp5UO1JxIcyuO2x07jSk+DP4/jNknOtxEY x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB3893.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(396003)(346002)(366004)(136003)(376002)(86362001)(76116006)(66556008)(66446008)(66476007)(64756008)(66946007)(30864003)(54906003)(8936002)(110136005)(478600001)(316002)(83380400001)(71200400001)(2906002)(55016002)(26005)(186003)(4326008)(5660300002)(107886003)(33656002)(9686003)(52536014)(7696005)(53546011)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: V8f4jB+bKyNEJeADtxm/2LYoPEM0yz4VZqFP58de/eOQv3CInQ1fD7XOv8E+hRvJxhLt0aKAn0AhseWfbd1jhQLTlXlw6MDRl+YHy1LomxyTAE6k7VVt4Kjmx89+KcBSuEQA4a+2jvX2wjmfltjAskKxjeyoqfGXkQIIAP1BlldYUY6j8JrvU1FbOjnBo+MRrLCSPqJDiS9iZPf8mNnMA7ahXXDXU3RtF8ZM70Wumg0ONwAk5/tfM8P0VT58Z2LNTI/ljgZ5f18qnYwXuXM3CDd+/RgVkjF3rj1LWQQkzKKr6t3BQNI8kNxLDpVjVdFBw7grusAexGpgn8GG+m7BU3kI4QMiTdu8cg4rC/q8WoiyjYhoIuMGwwlWrfuKoen3NAYxQG7mr9NVj29ncZdq1xTzsPQymO69Eg2cypV3xPtClVTeA7yZ9h79YkZQkgz+Y44m5/DQ/TqYviieaXhKCwOkVhDPWjVBLv8RurKhYOqY3I87hQisEo6TOmwEvgUmp1oybz/QVqmRy2YmOlNbSXcmE3uMmdRrz8S9SYA2AZ4lEnwYEEXCbzT/ka/Rvc9HQ1ydbJvd5dxJXKQLOsyG/5iCrMIOZatBuGjJGGJm76gNjxIyrugr/SKTHpmsgg8hSfatKrzlq7C+MI3HygrBGA== 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: BY5PR11MB3893.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d4dbb93-5cef-4eda-756f-08d83a7e4a07 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2020 03:02:15.3709 (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: jZcCODHDjDt1g5LG7NuKxFPnfbz+QGhQ0TcdhSIPxmYFMKdmukwpgnHSInkXudfTdW9X1wFbb+rXrhpODfgXvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3301 X-OriginatorOrg: intel.com Subject: Re: [dts] [PATCH V1 2/2] tests/cvl_fdir: add-new-case-for-test-l2-ethertype 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 Peng, Yuan -----Original Message----- From: dts On Behalf Of ChenBo Sent: Tuesday, August 4, 2020 1:25 PM To: dts@dpdk.org Cc: Chen, BoX C Subject: [dts] [PATCH V1 2/2] tests/cvl_fdir: add-new-case-for-test-l2-ethe= rtype add test case L2 Ethertype. Signed-off-by: ChenBo --- tests/TestSuite_cvl_fdir.py | 208 ++++++++++++++++++++++++++++++++++-- 1 file changed, 202 insertions(+), 6 deletions(-) diff --git a/tests/TestSuite_cvl_fdir.py b/tests/TestSuite_cvl_fdir.py inde= x b821961..c50799b 100644 --- a/tests/TestSuite_cvl_fdir.py +++ b/tests/TestSuite_cvl_fdir.py @@ -284,6 +284,18 @@ MAC_IPV4_GTPU =3D { 'Ether(src=3D"a4:bf:01:51:27:ca", dst=3D"00:11:22:33:44:55")/IP(sr= c=3D"192.168.0.20", dst=3D"192.168.0.21")/UDP(dport=3D2152)/GTP_U_Header(gt= p_type=3D255, teid=3D0x1234567)/IP()/Raw("x"*20)'] } =20 +L2_Ethertype =3D [ + 'Ether(dst=3D"00:11:22:33:44:55")/PPPoED()/PPP()/IP()/Raw("x" *80)', + 'Ether(dst=3D"00:11:22:33:44:55", type=3D0x8863)/IP()/Raw("x" * 80)', + 'Ether(dst=3D"00:11:22:33:44:55")/PPPoE(sessionid=3D3)/Raw("x" * 80)', + 'Ether(dst=3D"00:11:22:33:44:55", type=3D0x8864)/IP()/Raw("x" * 80)', + 'Ether(dst=3D"00:11:22:33:44:55")/ARP(pdst=3D"192.168.1.1")', + 'Ether(dst=3D"00:11:22:33:44:55", type=3D0x0806)/Raw("x" *80)', + 'Ether(dst=3D"00:11:22:33:44:55",type=3D0x8100)', + 'Ether(dst=3D"00:11:22:33:44:55")/Dot1Q(vlan=3D1)', + 'Ether(dst=3D"00:11:22:33:44:55",type=3D0x88f7)/"\\x00\\x02"', + 'Ether(dst=3D"00:11:22:33:44:55",type=3D0x8847)'] + tv_mac_ipv4_pay_queue_index =3D { "name": "test_mac_ipv4_pay_queue_index", "rule": "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.20 dst is 192.168.0.21 proto is 255 ttl is 2 tos is 4= / end actions queue index 1 / end", @@ -1241,6 +1253,144 @@ vectors_mac_ip= v4_gtpu =3D [tv_mac_ipv4_gtpu_queue_index, tv_mac_ipv4_gtpu_queue_gr tv_mac_ipv4_gtpu_passthru, tv_mac_ipv4_gtpu_drop, tv_mac_ipv4_gtpu_mark_rss, tv_mac_ipv4_gtpu_mark] =20 +tv_l2_ethertype_queue_index =3D { + "name": "test_l2_ethertype_queue_index", + "rule": [ + "flow create 0 ingress pattern eth type is 0x8863 / end actions qu= eue index 1 / mark id 1 / end", + "flow create 0 ingress pattern eth type is 0x8864 / end actions qu= eue index 2 / mark id 2 / end", + "flow create 0 ingress pattern eth type is 0x0806 / end actions qu= eue index 3 / mark id 3 / end", + "flow create 0 ingress pattern eth type is 0x8100 / end actions qu= eue index 4 / mark id 4 / end", + "flow create 0 ingress pattern eth type is 0x88f7 / end actions qu= eue index 5 / mark id 5 / end"], + "scapy_str": L2_Ethertype, + "check_param": [ + {"port_id": 0, "queue": 1, "mark_id": 1}, + {"port_id": 0, "queue": 1, "mark_id": 1}, + {"port_id": 0, "queue": 2, "mark_id": 2}, + {"port_id": 0, "queue": 2, "mark_id": 2}, + {"port_id": 0, "queue": 3, "mark_id": 3}, + {"port_id": 0, "queue": 3, "mark_id": 3}, + {"port_id": 0, "queue": 4, "mark_id": 4}, + {"port_id": 0, "queue": 4, "mark_id": 4}, + {"port_id": 0, "queue": 5, "mark_id": 5}, + {"port_id": 0, "queue": 0}] +} + +tv_l2_ethertype_queue_group =3D { + "name": "test_l2_ethertype_queue_group", + "rule": [ + "flow create 0 ingress pattern eth type is 0x8863 / end actions rs= s queues 0 1 end / mark id 0 / end", + "flow create 0 ingress pattern eth type is 0x8864 / end actions rs= s queues 2 3 end / mark id 1 / end", + "flow create 0 ingress pattern eth type is 0x0806 / end actions rs= s queues 4 5 end / mark id 2 / end", + "flow create 0 ingress pattern eth type is 0x8100 / end actions rs= s queues 6 7 end / mark id 2 / end", + "flow create 0 ingress pattern eth type is 0x88f7 / end actions rs= s queues 9 10 end / mark id 3 / end"], + "scapy_str": L2_Ethertype, + "check_param": [ + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 3}, + {"port_id": 0, "queue": 0}] +} + +tv_l2_ethertype_passthru =3D { + "name": "test_l2_ethertype_passthru", + "rule": [ + "flow create 0 ingress pattern eth type is 0x8863 / end actions pa= ssthru / mark / end", + "flow create 0 ingress pattern eth type is 0x8864 / end actions pa= ssthru / mark id 1 / end", + "flow create 0 ingress pattern eth type is 0x0806 / end actions pa= ssthru / mark id 2 / end", + "flow create 0 ingress pattern eth type is 0x8100 / end actions pa= ssthru / mark id 3 / end", + "flow create 0 ingress pattern eth type is 0x88f7 / end actions pa= ssthru / mark id 4 / end"], + "scapy_str": L2_Ethertype, + "check_param": [ + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 3}, + {"port_id": 0, "queue": 0, "mark_id": 3}, + {"port_id": 0, "queue": 0, "mark_id": 4}, + {"port_id": 0, "queue": 0}] +} + +tv_l2_ethertype_mark_rss =3D { + "name": "test_l2_ethertype_mark_rss", + "rule": [ + "flow create 0 ingress pattern eth type is 0x8863 / end actions rs= s / mark id 0 / end", + "flow create 0 ingress pattern eth type is 0x8864 / end actions ma= rk id 1 / rss / end", + "flow create 0 ingress pattern eth type is 0x0806 / end actions ma= rk / rss / end", + "flow create 0 ingress pattern eth type is 0x8100 / end actions rs= s / mark / end", + "flow create 0 ingress pattern eth type is 0x88f7 / end actions ma= rk id 3 / rss / end"], + "scapy_str": L2_Ethertype, + "check_param": [ + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 3}, + {"port_id": 0, "queue": 0}] +} + +tv_l2_ethertype_mark =3D { + "name": "test_l2_ethertype_mark", + "rule": [ + "flow create 0 ingress pattern eth type is 0x8863 / end actions ma= rk id 0 / end", + "flow create 0 ingress pattern eth type is 0x8864 / end actions ma= rk id 1 / end", + "flow create 0 ingress pattern eth type is 0x0806 / end actions ma= rk id 2 / end", + "flow create 0 ingress pattern eth type is 0x8100 / end actions ma= rk id 2 / end", + "flow create 0 ingress pattern eth type is 0x88f7 / end actions ma= rk / end"], + "scapy_str": L2_Ethertype, + "check_param": [ + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 1}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 2}, + {"port_id": 0, "queue": 0, "mark_id": 0}, + {"port_id": 0, "queue": 0}] +} + +tv_l2_ethertype_drop =3D { + "name": "test_l2_ethertype_drop", + "rule": [ + "flow create 0 ingress pattern eth type is 0x8863 / end actions dr= op / end", + "flow create 0 ingress pattern eth type is 0x8864 / end actions dr= op / end", + "flow create 0 ingress pattern eth type is 0x0806 / end actions dr= op / end", + "flow create 0 ingress pattern eth type is 0x8100 / end actions dr= op / end", + "flow create 0 ingress pattern eth type is 0x88f7 / end actions dr= op / end"], + "scapy_str": L2_Ethertype, + "check_param": [ + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "drop": 1}, + {"port_id": 0, "queue": 0}] +} + +vectors_l2_ethertype =3D [tv_l2_ethertype_queue_index, + tv_l2_ethertype_queue_group, + tv_l2_ethertype_passthru, + tv_l2_ethertype_drop, + tv_l2_ethertype_mark_rss, + tv_l2_ethertype_mark] =20 class TestCVLFdir(TestCase): =20 @@ -1306,6 +1456,36 @@ class TestCVLFdir(TestCase): failed_cases.append(k) self.verify(all(test_results.values()), "{} failed.".format(failed= _cases)) =20 + def _multirules_process(self, vectors, port_id=3D0): + # create rules on only one port + test_results =3D {} + rule_li =3D [] + for tv in vectors: + try: + port_id =3D port_id + pkts=3Dtv["scapy_str"] + check_param=3Dtv["check_param"] + self.destroy_fdir_rule(rule_id=3Drule_li,=20 + port_id=3Dport_id) + + # validate rules and create rules + rule_li =3D self.create_fdir_rule(tv["rule"],=20 + check_stats=3DTrue) + + for i in range(len(pkts)): + port_id =3D check_param[i]["port_id"] + out =3D self.send_pkts_getouput(pkts=3Dpkts[i], drop= =3Dcheck_param[i].get("drop")) + rfc.check_mark(out, pkt_num=3D1, check_param=3Dcheck_p= aram[i]) + test_results[tv["name"]] =3D True + print((GREEN("case passed: %s" % tv["name"]))) + except Exception as e: + print((RED(e))) + test_results[tv["name"]] =3D False + 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()), "{}=20 + failed.".format(failed_cases)) + def set_up_all(self): """ Run at the start of each test suite. @@ -1705,15 +1885,22 @@ class TestCVLFdir(TestCase): self.check_fdir_rule(stats=3DTrue, rule_list=3Drule_li) =20 def test_conflicted_rules(self): - rule1 =3D "flow create 0 ingress pattern eth dst is 00:11:22:33:44= :55 / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end = actions queue index 1 / end" + rule1 =3D [ + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end action= s queue index 1 / end', + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55=20 + / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 src is 2001::2 /=20 + end actions queue index 1 / mark / end'] rule_li =3D self.create_fdir_rule(rule1, check_stats=3DTrue) rule2 =3D [ "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end action= s queue index 2 / end", "flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end action= s drop / end", + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 src is 2001::2 / end ac= tions queue index 2 / mark / end', + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55=20 + / ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 src is 2001::2 /=20 + end actions rss queues 2 3 end / mark / end', 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.21 ttl is 2 tos is 4 / end actions queue index 3 / ma= rk / end', - 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / udp src is= 22 dst is 23 / end actions queue index 3 / mark / end'] - self.create_fdir_rule(rule2[0:2], check_stats=3DFalse, msg=3D"Rule= already exists!: File exists", validate=3DFalse) - self.create_fdir_rule(rule2[2:], check_stats=3DFalse, msg=3D"Inval= id input action number: Invalid argument", validate=3DFalse) + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / udp src is= 22 dst is 23 / end actions queue index 3 / mark / end', + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2021 / end actions mark / en= d', + 'flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / = ipv6 dst is CDCD:910A:2222:5498:8475:1111:3900:2020 src is 2001::2 / udp sr= c is 22 dst is 23 / end actions queue index 1 / mark / end'] + self.create_fdir_rule(rule2[0:4], check_stats=3DFalse, msg=3D"Rule= already exists!: File exists", validate=3DFalse) + self.create_fdir_rule(rule2[4:7], check_stats=3DFalse, msg=3D"Inva= lid input action number: Invalid argument", validate=3DFalse) + self.create_fdir_rule(rule2[7:], check_stats=3DFalse,=20 + msg=3D"Invalid input set: Invalid argument", validate=3DFalse) self.check_fdir_rule(stats=3DTrue, rule_list=3Drule_li) =20 def test_conflicted_actions(self): @@ -2091,7 +2278,7 @@ class TestCVLFdir(TestCase): eal_param =3D self.dut.create_eal_parameters(cores=3D"1S/4C/1T= ", ports=3D[self.pci0 + ",flow-mark-support=3D1", = self.pci1 + ",flow-mark-support=3D1"], socket=3Dself.ports= _socket) - param =3D " -- -i --portmask=3D%s --rxq=3D%d --txq=3D%d --port= -topology=3Dloop --cmdline-file=3D%s" % ( + param =3D " --log-level=3D'ice,7' -- -i --portmask=3D%s --rxq= =3D%d=20 + --txq=3D%d --port-topology=3Dloop --cmdline-file=3D%s" % ( self.portMask, 64, 64, cmd_path) command_line =3D self.dut.target + "/app/testpmd " + eal_param= + param out =3D self.dut.send_expect(command_line, 'testpmd>', timeout= =3D600) @@ -2197,7 +2384,7 @@ class TestCVLFdir(TestCase): out =3D self.pmd_output.start_testpmd(cores=3D"1S/4C/1T", param=3D"--portmask=3D%s -= -rxq=3D%d --txq=3D%d --port-topology=3Dloop --cmdline-file=3D%s" % ( self.portMask, 64, 64,= cmd_path), - eal_param=3D"-w %s,flow-ma= rk-support=3D1 -w %s,flow-mark-support=3D1" % ( + eal_param=3D"-w=20 + %s,flow-mark-support=3D1 -w %s,flow-mark-support=3D1 --log-level=3D'ice,7= '"=20 + % ( self.pci0, self.pci1),= socket=3Dself.ports_socket) self.verify('Failed to create flow' not in out, "create some r= ule failed") self.config_testpmd() @@ -2271,6 +2458,15 @@ class TestCVLFdir(TestCase): def test_mac_ipv4_gtpu(self): self._rte_flow_validate(vectors_mac_ipv4_gtpu) =20 + def test_l2_ethertype(self): + self._multirules_process(vectors_l2_ethertype) + + def test_unsupported_ethertype(self): + rule =3D ['flow create 0 ingress pattern eth type is 0x0800 / end = actions queue index 1 / end', + 'flow create 0 ingress pattern eth type is 0x86dd / end ac= tions queue index 1 / end'] + self.create_fdir_rule(rule, check_stats=3DTrue, msg=3D"Succeeded t= o create (2) flow") + self.check_fdir_rule(stats=3DTrue) + def tear_down(self): # destroy all flow rule on port 0 self.dut.send_command("flow flush 0", timeout=3D1) -- 2.17.1