From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 631B2A0552; Tue, 6 Dec 2022 04:25:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E4D740156; Tue, 6 Dec 2022 04:25:02 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id C84DE40151 for ; Tue, 6 Dec 2022 04:24:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670297099; x=1701833099; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=SyvMb1ohEmvhoPW446jOT/vt9HXZYSplwjXrlr+Qx6M=; b=a1csl+R5XyUKorcbKvQpESalpuaXGfj9o752oi4ydvgg7exhUxAFP/K/ RAmHrS7667E4Wm4LkSrflLMzyX3II53mYWP4Meqx+TVa8YPz772WGhY7v H0QIDnK3RXOkGSM47sQk/N453gjcgLS3ny+CJvZACKh3XJd5hjATqdtDY DCKKy6sQlKk5ANmTvTC7k6Q/4vySIJ+dvDD6twHFEZ0VCcirYOII5/1ZZ J/S9imsK+bF99FbRLr2XigVaiWd/PcXCjJH23fSv7xqkyXWHCDEfSjaF4 LtH2ELyU5AZoekgA+Bn0/phKkLUMKX16boCPIv9ZgGFP82Xgzmt3yrCRw A==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="296215502" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="296215502" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2022 19:24:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="770579645" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="770579645" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 05 Dec 2022 19:24:58 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 5 Dec 2022 19:24:58 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 5 Dec 2022 19:24:57 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 5 Dec 2022 19:24:57 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.45) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 5 Dec 2022 19:24:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FOUyxP7tYB6vSlyZOu6Ld/N4xE9gvdvadxy5SDLC1gomQYoAgzYEPClts05gssevYmDmwmVPnBTX806PJpe4GcxBUvT5OCsNF3miMvBzHqU/WKduA4J2GoCSxiZ8RmHTSeqL2PH127rFjF+EhXOXl+DpZthU1RKcP9KQv0lvZurHQ31lH1gHLk4g0o0DORPVNk3FKH/VnG7zTtkaXsBlg/PB3u8uYZ/c4D5Lhk84ghdBRV5ayJSs5c/eP9HQqHd2ueYwjCUQQczc/GYL9S0/0PIcTlDFJgYV9fKTyE6mrPAuPTtzK6nlHoiY4qCAOlQEGhVkhRFPh3kRprbQneJ6sw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oGB3EJ2RqPfrOPJhCs/R6CzTGJ8HUY38X7JrJcXslrw=; b=VDTXYldDSozaTl572NojdvpqjanjguQoHu2bKay4H0wusZ3qElYlUnwmuvt4y4XTtFRvOm12yGtrUXsT67oM9lrDoYLy+xSkw7EQCFtia15q8umE3Kr+kFiMLj6w9nn2J3joLqioajHb8LeoxPL+IbR5UBZRV9AAx+A0zhlsKYii1MygpzBw9huF9ONzMPHZiaf8+y1N4MyYyZfjwvxnkaE7ZiR9OXTpCZvCsHnZoZLUGnqfFzs9yVSS7S13WP6ACexCM3Z51Pxv0EUBl3cpYWyvSrQXEJq1KNlSrFoypS5bIByqBdVlHKv3uFWM/gRGx2EIz9X1hVhe9uXd3rmjBA== 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 Received: from BN0PR11MB5712.namprd11.prod.outlook.com (2603:10b6:408:160::17) by DS0PR11MB7684.namprd11.prod.outlook.com (2603:10b6:8:dd::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 03:24:49 +0000 Received: from BN0PR11MB5712.namprd11.prod.outlook.com ([fe80::ce17:2cd5:4d06:bfe5]) by BN0PR11MB5712.namprd11.prod.outlook.com ([fe80::ce17:2cd5:4d06:bfe5%9]) with mapi id 15.20.5880.013; Tue, 6 Dec 2022 03:24:49 +0000 From: "Huang, ZhiminX" To: "Chen, LingliX" , "dts@dpdk.org" Subject: RE: [dts][PATCH V1 2/5] tests/generic_flow_api: add pf action subcase Thread-Topic: [dts][PATCH V1 2/5] tests/generic_flow_api: add pf action subcase Thread-Index: AQHZBJo6egSMrL0ngE2WP6NvIXXEN65gOqiw Date: Tue, 6 Dec 2022 03:24:49 +0000 Message-ID: References: <20221130080439.65529-1-linglix.chen@intel.com> <20221130080439.65529-3-linglix.chen@intel.com> In-Reply-To: <20221130080439.65529-3-linglix.chen@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN0PR11MB5712:EE_|DS0PR11MB7684:EE_ x-ms-office365-filtering-correlation-id: 706894ee-f023-4823-67b3-08dad7396e86 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gmafTRammA9qPYpdUZ5yILWXjwiYfSbjCD5C26AZ5EmOR63xF2aTT52dj974iraM8+hG6B+KZUNYCC2eokw0OZcQgapWtQ8NdqEWdMXDjzhTMnWFrmQ+n3SisYqyLMdtYLnyrX76BbMJ89lL1R6FNHyO3jHh81mtyY9sAHSsnfZotiQzMlP1Zyompm8Jqt++7kAisTwC3LOBshZ115sDj2Ahf86/oWX4o3g09u/WoU5c2A5antH3cLsGydRiEzeWApE45SZb51n3odM+Ld5D6kMoSU5vmJER73BSiV7mlwKpyxs7XOHmf00uoaHb2Zlq7Vi4HLvahDmcrLTyNccj9j1XAYGjMZ907v+/D9e5rrm/LyL83cd8Idig2n+ghi+iLq+D80Y/vatx4Hg5K+uKPRx3M755OtQzkC0GN5eOwtXv9xakodNuyJmyWK1hcfrWemfyWvomY9yE4Y8DznC9PJDc2Ejy8qolErMu8/tKC9ln2Llgco4Bomz1xYbW3LppHauPq9bxpySDTe3OO0V/x7pRTiIvfZYd7JXczEVVSvwQzIh+fN2RKh0caGUIrg+njued9ONr7R+cQLut927DOXcZFLeyDgtPsq7AdwR4PTcDq2cRh+KM/It/3oE40cXZ6vB+mS3z1mxxpSPG1p1n3DXjHcmh/RucA64rEg5O+iVPHwImgX+1WTpMJiJvfwG6GgUVNnmX5iA1G4cs55j6wXjOQDlTLw0Emopa6AaToMwPEjgCf075ZYVczx6oj7UO x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN0PR11MB5712.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(396003)(376002)(136003)(366004)(39860400002)(451199015)(83380400001)(122000001)(38100700002)(33656002)(86362001)(38070700005)(64756008)(30864003)(66476007)(2906002)(66946007)(76116006)(66446008)(8936002)(8676002)(66556008)(41300700001)(478600001)(52536014)(55016003)(5660300002)(9686003)(6506007)(53546011)(26005)(7696005)(71200400001)(186003)(316002)(110136005)(82960400001)(41533002)(21314003)(579004)(559001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?IAnRDl7y15KLccAMRwuCvm/eud0Rr9/wZiNQCudujvivDL2JdJkcRpwTvY?= =?iso-8859-1?Q?JzIJCwE3VFJ3GImqykdtiTriLxRwY0BfEP8hUZK7acT8g/6nZN48Lmahhj?= =?iso-8859-1?Q?1cT0iGXCUijf/CndGmWZ3YE70KOSGhMMkq7vIuoO9Pi5VrPmMfuNCN5PgT?= =?iso-8859-1?Q?Y6v+MXvjvf6ZWIwEm1kRxQTG3/Waqmv1PQ9Hw8Ajiol3ADPWzkECNQhn3v?= =?iso-8859-1?Q?7JnLN1Rm7oYmaV7intxR5c3ot6Xb6pbMJ8lu675cxScxryNqh3DV0J1BiX?= =?iso-8859-1?Q?6U3NXDvg5whKgr2q86SHEOEkRPdkoBoGlTb6yIHJzCL93URtO08h3lMjBM?= =?iso-8859-1?Q?nXP6484eUk0QbQi0PGYRXB0cF7aRhXZJvn3RbUCAvTxgU6X7GV+wZT5Jkj?= =?iso-8859-1?Q?ULymFQR63x5TVgz8Tto03Z3z0l+wSvwBkEXssSuD1h1jNptO+2Rt32TAce?= =?iso-8859-1?Q?lR6UOJMyCv1+eoLKTjhf3XqJ1R7IP2gQlyfnsjpy5znFtp4V2IKKDv6UAu?= =?iso-8859-1?Q?OB/U+v3zXt+e2QK4mzXPChapSOy4wuwTtRe9i3IijyBJWOVdPj3qj8//V2?= =?iso-8859-1?Q?RixR2WD97gAC0xwAKxEvx/CWg56Aa99wwUqklFnloa0ui6RaiqjfxfzHQD?= =?iso-8859-1?Q?UhxVZcfpNAci2T1sljedLmk45oQPceKPaULZ6i7U8zR88nw11kA2NDVORl?= =?iso-8859-1?Q?WVrRdoV8EUm+nQ1zgHX7YRkaeuGzlXIy3FqKozap7Uwrqx5zvwVvrr+Aac?= =?iso-8859-1?Q?Zw8QN6Mctr1aLWLxRhBpmS3iDbqYTxXE7teaxlBCqRuFPe400Ut9zEdmGU?= =?iso-8859-1?Q?buxAPSmRvdpOCLbGnQk8Orlqux11zbheeOhjgMEXGRziP56x5vw7U01bIT?= =?iso-8859-1?Q?t+jXxh8ewugQo4ueMRHS8+RPcqUniA1baP3/35GyN5FqC7GO+dhWJfSrx0?= =?iso-8859-1?Q?1bSgx3sdCGOJlVxhOH76AKXUQhpmJC4blFNDPPkofCAM7l64vfmcNIGto2?= =?iso-8859-1?Q?g5dc+rPreVFtBD4YWFIVRAQ5aMEl+Temu3+mnPhb2s0XCzvLZsT84VrglD?= =?iso-8859-1?Q?jdTwFdStug8UShMsf1usFX25N/giAcaAx4hKC0+DVY9U1iiXh0UFUmJ8f7?= =?iso-8859-1?Q?pZ+HVOhLvJ7EHMHhpi/j6zYicml5ltFYetBt4mJJpNaaBSU4OXv7WHf7dY?= =?iso-8859-1?Q?bL/vvQDvsM6vS63h78EktoolmozQONngrCi/ehuAolBC/GFhfqNsaGvvka?= =?iso-8859-1?Q?0xT1GeeGVQh7asqvVJP86/1zj77YaG4oRzZGU8sdbP9A8vZQWlt7igI7pz?= =?iso-8859-1?Q?pK3lAjDsyJ1zKA4fvjQdYma0kgJZF25mAl7nq0ZS2bn8S9h8gePL69fk/B?= =?iso-8859-1?Q?XWVoYcZXhMTqa/BZnTXdgDfEf33Gl9vosIFOjVNXe+wL9j1EMP7une7KG9?= =?iso-8859-1?Q?4ul/HIYvq8P01GXmR9QrZskIVJsyH2/38JpxUJH+Gby+3bHuxMPZUTaeqK?= =?iso-8859-1?Q?Hz9vEEX9tTPFxuKzpr1iJV8/+3GxLNU7cAinCmBFSj1xIXTQHysyVoam9l?= =?iso-8859-1?Q?RB28Tn+Yyc5O8HLkENcfne0mA3RpyXxlHsFbY+dtAhBZ1lqJz9TGnZYrjo?= =?iso-8859-1?Q?1jqnFMdMEIsNJHNqWjqiYwBpw4q1ogUmLG?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR11MB5712.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 706894ee-f023-4823-67b3-08dad7396e86 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2022 03:24:49.3131 (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: 8CXCs0pBrEe7ji+ktJmddTJCkMnvujPaVoUGdeB1Nnk0dDC+zJBtIr7rDo7/0eGyF+/nV8U/zkO5XTNHgm9fMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7684 X-OriginatorOrg: 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 > -----Original Message----- > From: Chen, LingliX > Sent: Wednesday, November 30, 2022 4:05 PM > To: dts@dpdk.org > Cc: Huang, ZhiminX ; Chen, LingliX > > Subject: [dts][PATCH V1 2/5] tests/generic_flow_api: add pf action subcas= e >=20 > 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. >=20 > Signed-off-by: Lingli Chen > --- > tests/TestSuite_generic_flow_api.py | 1157 ++++++++++++++++++++------- > 1 file changed, 878 insertions(+), 279 deletions(-) >=20 > diff --git a/tests/TestSuite_generic_flow_api.py > b/tests/TestSuite_generic_flow_api.py > index 417131f2..1201e467 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 >=20 > MAX_VLAN =3D 4095 > @@ -222,41 +226,6 @@ class TestGeneric_flow_api(TestCase): > self.session_third.send_expect("start", "testpmd> ") > return out_pf >=20 > - def launch_start_testpmd( > - self, > - queue=3D"", > - pkt_filter_mode=3D"", > - report_hash=3D"", > - disable_rss=3DFalse, > - fwd=3D"", > - verbose=3D"", > - ): > - """ > - Launch and start testpmd > - """ > - param =3D "" > - eal_param =3D "" > - if queue: > - param +=3D "--rxq=3D{} --txq=3D{} ".format(queue, queue) > - if pkt_filter_mode: > - param +=3D "--pkt-filter-mode=3D{} ".format(pkt_filter_mode) > - if disable_rss: > - param +=3D "--disable-rss " > - if report_hash: > - param +=3D "--pkt-filter-report-hash=3D{} ".format(report_ha= sh) > - self.pmdout.start_testpmd( > - "{}".format(self.cores), param=3Dparam, eal_param=3Deal_para= m > - ) > - 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,6 +2012,248 @@ class TestGeneric_flow_api(TestCase): > "Invalid", > ) >=20 > + support_nic =3D [ > + "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_subcase(self): Don't use 'subcase' as the case name, you can refer to xxx_PF_vfio/xxxx_PF_= igb_uio etc. > + """ > + only supported by i40e > + """ > + # start testpmd on pf > + self.pmdout.start_testpmd( > + "%s" % self.pf_cores, > + "--disable-rss --rxq=3D%d --txq=3D%d" % (MAX_QUEUE + 1, > MAX_QUEUE + 1), > + "-a %s --file-prefix=3Dpf --socket-mem 1024,1024 --legacy-me= m" % > 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, _, _ =3D self.pmdout.get_firmware_version( > + self.dut_ports[0] > + ).split() > + except ValueError: > + # nic IXGBE, IGC > + fwversion =3D > 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 filt= er > work normally. > + if self.kdriver =3D=3D "i40e" and fwversion >=3D "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 =3D [ > + {"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 =3D self.all_flows_process(basic_flow_actions) > + extra_packet =3D extrapkt_rulenum["extrapacket"] > + # send the packets with dst/src ip and dst/src port. > + self.sendpkt( > + pktstr=3D'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.1= 68.0.1", > dst=3D"192.168.0.2", proto=3D3)/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[0]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][0], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0.1", > dst=3D"192.168.0.2", tos=3D3)/UDP()/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[1]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][1], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0.1", > dst=3D"192.168.0.2", ttl=3D3)/TCP()/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[2]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][2], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0.1", > dst=3D"192.168.0.2", tos=3D3, ttl=3D3)/SCTP()/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[3]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][3], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0.1", > dst=3D"192.168.0.2", ttl=3D3)/TCP()/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[3]["vlan"]) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"1", expect_queue=3D"0", > verify_mac=3Dself.pf_mac > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP()/UDP()/Raw("x" * 20)= ' > + % (self.pf_mac, extra_packet[2]["vlan"]) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"1", expect_queue=3D"0", > verify_mac=3Dself.pf_mac > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"192.168.0.5", > dst=3D"192.168.0.6", tos=3D3, ttl=3D3)/SCTP(sport=3D44,dport=3D45,tag=3D1= )/Raw("x" * > 20)' > + % (self.pf_mac, extra_packet[4]["vlan"]) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"0", expect_queue=3D"NULL", > verify_mac=3Dself.pf_mac > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1", > dst=3D"2001::2", tc=3D1, nh=3D5, hlim=3D10)/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[5]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][5], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1", > dst=3D"2001::2", tc=3D2, hlim=3D20)/UDP(sport=3D22,dport=3D23)/Raw("x" * = 20)' > + % (self.pf_mac, extra_packet[6]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][6], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1", > dst=3D"2001::2", tc=3D2, hlim=3D20)/TCP(sport=3D32,dport=3D33)/Raw("x" * = 20)' > + % (self.pf_mac, extra_packet[7]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][7], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1", > dst=3D"2001::2", tc=3D4, nh=3D132, > hlim=3D40)/SCTP(sport=3D44,dport=3D45,tag=3D1)/SCTPChunkData(data=3D"X" *= 20)' > + % (self.pf_mac, extra_packet[8]["vlan"]) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][8], > + verify_mac=3Dself.pf_mac, > + ) > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1", > dst=3D"2001::2", tc=3D4, nh=3D132, > hlim=3D40)/SCTP(sport=3D44,dport=3D45,tag=3D1)/SCTPChunkData(data=3D"X" *= 20)' > + % (self.pf_mac, extra_packet[9]["vlan"]) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"0", expect_queue=3D"NULL", > verify_mac=3Dself.pf_mac > + ) > + > + rule_num =3D extrapkt_rulenum["rulenum"] > + self.verify_rulenum(rule_num) > + > + @skip_unsupported_host_driver(["vfio-pci"]) > def test_fdir_for_vlan(self): > """ > only supported by i40e > @@ -2373,9 +2584,10 @@ class TestGeneric_flow_api(TestCase): > rule_num =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num) >=20 > + @skip_unsupported_host_driver(["vfio-pci"]) > def test_fdir_for_ipv4(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 =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num) >=20 > - # ixgbe > - else: > - self.pmdout.start_testpmd( > - "%s" % self.cores, > - "--pkt-filter-mode=3Dperfect --disable-rss --rxq=3D%d --= txq=3D%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 =3D [ > - { > - "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_subcase(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=3D%d --txq=3D%d" % (MAX_QUEUE + 1, > MAX_QUEUE + 1), > + "-a %s --file-prefix=3Dpf --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 =3D [ > + { > + "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 =3D self.all_flows_process(basic_flow_actio= ns) > + extra_packet =3D extrapkt_rulenum["extrapacket"] > + self.sendpkt( > + 'Ether(dst=3D"%s")/IP(src=3D"192.168.0.3", > dst=3D"192.168.0.4", proto=3D%s)/Raw("x" * 20)' > + % (self.pf_mac, extra_packet[0]["proto"]) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"1", expect_queue=3D"0", > verify_mac=3Dself.pf_mac > + ) > + rule_num =3D extrapkt_rulenum["rulenum"] > + self.verify_rulenum(rule_num) > + # ixgbe > + else: > + self.pmdout.start_testpmd( > + "%s" % self.cores, > + "--disable-rss --rxq=3D%d --txq=3D%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 =3D [ > + { > + "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 =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num) >=20 > + @skip_unsupported_host_driver(["vfio-pci"]) > def test_fdir_for_ipv6(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 =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num) >=20 > + def test_fdir_for_ipv6_pf_subcase(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=3D%d --txq=3D%d" % (MAX_QUEUE + 1, > MAX_QUEUE + 1), > + "-a %s --file-prefix=3Dpf --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 =3D [ > + { > + "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 =3D self.all_flows_process(basic_flow_actio= ns) > + extra_packet =3D extrapkt_rulenum["extrapacket"] > + self.sendpkt( > + 'Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IPv6(src=3D"2001::1"= , > dst=3D"2001::2", tc=3D2, hlim=3D20)/UDP(sport=3D22,dport=3D23)/Raw("x" * = 20)' > + % (self.pf_mac, extra_packet[1]["vlan"]) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"1", expect_queue=3D"0", > verify_mac=3Dself.pf_mac > + ) > + rule_num =3D extrapkt_rulenum["rulenum"] > + self.verify_rulenum(rule_num) > + > # ixgbe signature > else: > self.pmdout.start_testpmd( > "%s" % self.cores, > - "--pkt-filter-mode=3Dsignature --disable-rss --rxq=3D%d > --txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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 =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num + 1) >=20 > - support_nic =3D [ > - "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=C2=AE Ethernet 700 Series fdir wrong parameters > """ > - > self.pmdout.start_testpmd( > "%s" % self.pf_cores, > - "--disable-rss --rxq=3D%d --txq=3D%d --pkt-filter-mode=3Dper= fect" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%d" % (MAX_QUEUE + 1, > MAX_QUEUE + 1), > "-a %s --socket-mem 1024,1024 --file-prefix=3Dpf " % 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) >=20 > - self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1, > self.kdriver) > - self.vf_port =3D self.dut.ports_info[self.dut_ports[0]]["vfs_por= t"][0] > - self.vf_port.bind_driver(driver=3D"vfio-pci") > - self.vf_port_pci =3D > self.dut.ports_info[self.dut_ports[0]]["sriov_vfs_pci"][0] > - # start testpmd on vf0 > - self.pmdout.start_testpmd( > - "default", > - "--rxq=3D4 --txq=3D4 --disable-rss --pkt-filter-mode=3Dperfe= ct", > - eal_param=3D"-a %s --socket-mem 1024,1024 --file-prefix=3Dvf= " > - % 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 queu= e 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 queu= e 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=3Dperfect --disable-rss --rxq=3D%d --= txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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=3Dperfect --disable-rss --rxq=3D%d --= txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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=3Dsignature --disable-rss --rxq=3D%d > --txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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): >=20 > self.pmdout.start_testpmd( > "%s" % self.cores, > - "--pkt-filter-mode=3Dsignature --disable-rss --rxq= =3D%d > --txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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): >=20 > self.pmdout.start_testpmd( > "%s" % self.cores, > - "--pkt-filter-mode=3Dperfect-mac-vlan --disable-rss --rxq=3D= %d > --txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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): >=20 > self.pmdout.start_testpmd( > "%s" % self.cores, > - "--pkt-filter-mode=3Dperfect-tunnel --disable-rss --rxq=3D%d > --txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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): >=20 > self.pmdout.start_testpmd( > "%s" % self.cores, > - "--pkt-filter-mode=3Dperfect-tunnel --disable-rss --rxq=3D%d > --txq=3D%d" > - % (MAX_QUEUE + 1, MAX_QUEUE + 1), > + "--disable-rss --rxq=3D%d --txq=3D%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,6 +4892,101 @@ class TestGeneric_flow_api(TestCase): > rule_num =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num) >=20 > + @check_supported_nic(support_nic) > + def test_tunnel_filter_vxlan_pf_subcase(self): > + """ > + only supported by i40e > + """ > + self.pmdout.start_testpmd( > + "%s" % self.pf_cores, > + "--disable-rss --rxq=3D%d --txq=3D%d" % (MAX_QUEUE + 1, > MAX_QUEUE + 1), > + "-a %s --file-prefix=3Dpf --socket-mem 1024,1024 --legacy-me= m" % > 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 =3D [ > + { > + "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", "invla= n"], > + "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", "invla= n"], > + "actions": ["pf", "queue"], > + }, > + { > + "create": "validate", > + "flows": ["dst_mac", "ipv4", "udp", "vxlan", "vni", > "ineth"], > + "actions": ["pf", "queue"], > + }, > + ] > + extrapkt_rulenum =3D self.all_flows_process(basic_flow_actions) > + extra_packet =3D extrapkt_rulenum["extrapacket"] > + > + self.sendpkt( > + > 'Ether(dst=3D"%s")/IP()/UDP()/VXLAN()/Ether(dst=3D"%s")/Dot1Q(vlan=3D11)/= IP()/TC > P()/Raw("x" * 20)' > + % (self.outer_mac, self.inner_mac) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][0], > + verify_mac=3Dself.outer_mac, > + ) > + > + self.sendpkt( > + > 'Ether(dst=3D"%s")/IP()/UDP()/VXLAN(vni=3D5)/Ether(dst=3D"%s")/IP()/TCP()= /Raw("x" > * 20)' > + % (self.outer_mac, self.wrong_mac) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"1", expect_queue=3D"0", > verify_mac=3Dself.outer_mac > + ) > + > + rule_num =3D extrapkt_rulenum["rulenum"] > + self.verify_rulenum(rule_num) > + > + @skip_unsupported_host_driver(["vfio-pci"]) > def test_tunnel_filter_vxlan(self): > """ > only supported by i40e > @@ -4491,6 +5159,100 @@ class TestGeneric_flow_api(TestCase): > rule_num =3D extrapkt_rulenum["rulenum"] > self.verify_rulenum(rule_num) >=20 > + @check_supported_nic(support_nic) > + def test_tunnel_filter_nvgre_pf_subcase(self): > + """ > + only supported by i40e > + """ > + self.pmdout.start_testpmd( > + "%s" % self.pf_cores, > + "--disable-rss --rxq=3D%d --txq=3D%d" % (MAX_QUEUE + 1, > MAX_QUEUE + 1), > + "-a %s --file-prefix=3Dpf --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 =3D [ > + { > + "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 =3D self.all_flows_process(basic_flow_actions) > + extra_packet =3D extrapkt_rulenum["extrapacket"] > + > + self.sendpkt( > + > 'Ether(dst=3D"%s")/IP()/NVGRE()/Ether(dst=3D"%s")/Dot1Q(vlan=3D1)/IP()/TC= P()/Raw > ("x" * 20)' > + % (self.outer_mac, self.inner_mac) > + ) > + self.verify_result( > + "pf", > + expect_rxpkts=3D"1", > + expect_queue=3Dextrapkt_rulenum["queue"][0], > + verify_mac=3Dself.outer_mac, > + ) > + > + self.sendpkt( > + > 'Ether(dst=3D"%s")/IP()/NVGRE(TNI=3D%s)/Ether(dst=3D"%s")/IP()/TCP()/Raw(= "x" * > 20)' > + % (self.outer_mac, extra_packet[4]["tni"], self.wrong_mac) > + ) > + self.verify_result( > + "pf", expect_rxpkts=3D"1", expect_queue=3D"0", > verify_mac=3Dself.outer_mac > + ) > + > + rule_num =3D extrapkt_rulenum["rulenum"] > + self.verify_rulenum(rule_num) > + > + @skip_unsupported_host_driver(["vfio-pci"]) > def test_tunnel_filter_nvgre(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) >=20 > - @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 =3D re.compile("FDIR matched hash=3D(0x\w+) > ID=3D(0x\w+)") > - pkt0 =3D 'Ether(dst=3D"{}")/IP(src=3D"192.168.0.1", > dst=3D"192.168.0.2")/Raw("x" * 20)'.format( > - self.pf_mac > - ) > - pkt1 =3D 'Ether(dst=3D"{}")/IP(src=3D"192.168.1.1", > dst=3D"192.168.1.2")/Raw("x" * 20)'.format( > - self.pf_mac > - ) > - rule0 =3D "flow create 0 ingress pattern eth / ipv4 src is 192.1= 68.0.1 > dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end" > - rule1 =3D "flow create 0 ingress pattern eth / ipv4 src is 192.1= 68.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=3Dnone``= mode") > - pkt_filter_report_hash =3D "none" > - self.launch_start_testpmd( > - queue=3DMAX_QUEUE + 1, > - pkt_filter_mode=3D"perfect", > - report_hash=3Dpkt_filter_report_hash, > - disable_rss=3DTrue, > - fwd=3D"rxonly", > - verbose=3D"1", > - ) > - > - # Send the matched packet with Scapy on the traffic generator an= d > check that no FDir information is printed > - self.sendpkt(pktstr=3Dpkt0) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"0", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"non-exist", > - ) > - > - # Add flow filter rule, and send the matched packet again. > - # No FDir information is printed, but it can be seen that the pa= cket > went to queue 1 > - self.pmdout.execute_cmd(rule0) > - self.sendpkt(pktstr=3Dpkt0) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"1", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"non-exist", > - ) > - self.pmdout.quit() > - > - self.logger.info("Sub-case2: ``--pkt-filter-report-hash=3Dmatch`= ` > mode") > - pkt_filter_report_hash =3D "match" > - self.launch_start_testpmd( > - queue=3DMAX_QUEUE + 1, > - pkt_filter_mode=3D"perfect", > - report_hash=3Dpkt_filter_report_hash, > - disable_rss=3DTrue, > - fwd=3D"rxonly", > - verbose=3D"1", > - ) > - > - # Send the matched packet with Scapy on the traffic generator an= d > check that no FDir information is printed > - self.sendpkt(pktstr=3Dpkt0) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"0", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"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=3Dpkt0) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"1", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"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=3Dpkt1) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"2", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"exist", > - ) > - > - # Remove rule1 and send the matched pkt0 packet again. Check tha= t > no FDir information is printed > - self.pmdout.execute_cmd("flow destroy 0 rule 0") > - self.sendpkt(pktstr=3Dpkt0) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"0", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"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=3Dpkt1) > - self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"0", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"non-exist", > - ) > - self.pmdout.quit() > - > - self.logger.info("Sub-case3: ``--pkt-filter-report-hash=3Dalways= `` > mode") > - pkt_filter_report_hash =3D "always" > - self.launch_start_testpmd( > - queue=3DMAX_QUEUE + 1, > - pkt_filter_mode=3D"perfect", > - report_hash=3Dpkt_filter_report_hash, > - disable_rss=3DTrue, > - fwd=3D"rxonly", > - verbose=3D"1", > - ) > - > - # Send matched pkt0 packet with Scapy on the traffic generator a= nd > check the output (FDIR id=3D0x0) > - self.sendpkt(pktstr=3Dpkt0) > - out1 =3D self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"0", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"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=3Dpkt0) > - out2 =3D self.verify_result( > - "pf", > - expect_rxpkts=3D"1", > - expect_queue=3D"1", > - verify_mac=3Dself.pf_mac, > - check_fdir=3D"exist", > - ) > - > - # check fdir id is different > - self.logger.info( > - "FDIR ID1=3D" > - + fdir_scanner.search(out1).group(0) > - + "; FDIR ID2=3D" > - + fdir_scanner.search(out2).group(0) > - ) > - self.verify( > - fdir_scanner.search(out1).group(0) !=3D > fdir_scanner.search(out2).group(0), > - "Sub-case3.3: FDIR ID should be different", > - ) > - > def tear_down(self): > """ > Run after each test case. > -- > 2.17.1