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 1F0E7A0032; Tue, 28 Sep 2021 13:51:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A1EF410D7; Tue, 28 Sep 2021 13:51:23 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20058.outbound.protection.outlook.com [40.107.2.58]) by mails.dpdk.org (Postfix) with ESMTP id E4E2540DF6 for ; Tue, 28 Sep 2021 13:51:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZwIQw86wo8SnnseTvw5ClxZgtMzQQ9pwz+sg/2ZQ3CsyeKO5BMhJ5Mk+uB3l+PjIC1mCjvlbHIcmgLITR3vQ8hblZ3NwvUt/awTyYiXY4i+nqX243OHuIuPjxBiqNaZpQCefj2qg1De3Nmi4TYreiJn2mjNxzbZ08Pa0dN6yecucruCXPwicxnA5JV2+Ekb3tQIG+1he26+q/OSaCooBKigwA4PN6HWfKEuDDxO2snqAmRPW7L66bf/jRNqsbVSuIbMShjvM18egyuPJFqepqwWhVDCiGK1oCsimdAaThR8ILjrqt2lhSArIHpgnQ62ewzG/cnwGVQP1E08/frcnXg== 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; bh=UW1252wpGvppIb5JBLHTCDd3EUrCUpsPwa7KD0uGz0k=; b=NOMKGCHARUsoWixnknu4wC2DAeF3olTFuoieVK1+Xr0uuc6YvaUtuuWDBzAFqNeW5xJOhf8cs5wI/M5Jf0BvsEQRDdZMsx38sAR/EV/na/Il5XpLqPhiKzMOF/6Bdr/05c6m1TtGlX7XxM+523RROihaRnNeYmRR8kj8j9fR8PY8cBu7qj9weNvesMVbWKePYDETC5sAVYf2wlV195G2hyXIg0/1IWJ+Wyu0hkiP9G05985Z6AUf0/idOM1/7bP0j90opLJr6M+2px2y+Te8XzXo65fscTBh+gzdaqZK8XWSSMrZqUdzknATcZqd7lBmWZ832Hp5A0NG0KPEOWFxbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UW1252wpGvppIb5JBLHTCDd3EUrCUpsPwa7KD0uGz0k=; b=lxM5Sy7fqEWAtyV89tHsd1GOv/Kj5pSWL8ethgadrAtrovMEp8Mj851DZak9Tmz2R6A665ITTfznxjKbFjA/5P89ke2xLcpnxCyGrT24OSILaSPFCUFatnOYYojlxHXArEiNMQalB0amXIZ23HcbSseTJRK3aR8BX6X9/OFtf0o= Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DB6PR0402MB2727.eurprd04.prod.outlook.com (2603:10a6:4:98::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Tue, 28 Sep 2021 11:51:19 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::dcda:93c2:47e7:19b4%9]) with mapi id 15.20.4566.014; Tue, 28 Sep 2021 11:51:19 +0000 From: Nipun Gupta To: Nipun Gupta , "dev@dpdk.org" CC: "xiaoyun.li@intel.com" , "orika@nvidia.com" , "thomas@monjalon.net" , "ferruh.yigit@intel.com" , Hemant Agrawal Thread-Topic: [PATCH] app/testpmd: update raw flow to take hex input Thread-Index: AQHXtFk6xersvlkkck6Cz3RBpk/WZ6u5VYLA Date: Tue, 28 Sep 2021 11:51:19 +0000 Message-ID: References: <20210928110850.21184-1-nipun.gupta@nxp.com> <20210928110850.21184-2-nipun.gupta@nxp.com> In-Reply-To: <20210928110850.21184-2-nipun.gupta@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0d3286de-5ac1-44a1-d6f2-08d982764965 x-ms-traffictypediagnostic: DB6PR0402MB2727: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h4hGizzBc92Z8caMDZiIphWRahFhAwwzhiUF1/wpA8PgyOMCg4jGzV9UveADLF5vBsP7YlfRzQRfYP3O6aPYOdkj2fHV23Et/xFxvtYt8n7dGo5n1A/xd5YfeNNRm6blFHTu7ZUbefh4zKhVNbzndpXRtFQvDOPDGg/aSNHiQ2aFA3P6ieQuxvX0AMxc/OE8P1U4HNtiXNn3KPYNzHYpo1GMsJBq/sorjX7wT7iZ0xFbB5G+cbjlDyfLQIEZsifXaZi72Le0wGFvkylQecrxGq2pFnYbGchvrag/MyZ2/F/7jykuzfxZINitgKtnq1CF2AhvTuiUtM/N8+F9mIlt5gpMPx08hkSQlckPHwMaxWiYjcPmpbkObJKY6GL6RLdSNuZiXBZO1KGvSuHmil9rwdtO+sybDdzCGD+e/IzmLoivnvr/6OY9w2iHGRoXNAKhLOHpxnqa6NXUqVI0gOkN3xCfol/8zTB45JrlJqnhXAKGLFiwdgaQc3le15vjT7OMkgNsUKQrIoIAcZ34qkhWLxn7MbK901+9n/8ftfylSA4bRXhuunYICcwPx0GyKvc5uy5pS7O5Qcdp2SMPNUkIEyBzXdAVHsu5viqs9PIZeCQ9c/0DCPYId92Ix9th0J3vYp7wSAVxhoJDTsomlxDDbnRp00dTPs5VtzOeRKwf1byUKfI0gVBhcJFyzlMfl0XDwFbv8DDBcLJwLfZci7FEWg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(52536014)(122000001)(38100700002)(66446008)(4326008)(66946007)(8936002)(71200400001)(9686003)(26005)(7696005)(55016002)(53546011)(15650500001)(186003)(5660300002)(76116006)(44832011)(33656002)(64756008)(66476007)(66556008)(54906003)(110136005)(38070700005)(83380400001)(498600001)(8676002)(86362001)(6506007)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wcTNGdos66xM19NDX533bVNfMD6gOuc24AZRYc96ARb9yasP5cu2zdtmL/os?= =?us-ascii?Q?DKpFNoFttY9FTSTygU+q+zmIyXNp/wxs5l8h0S2RhDnZaavMcw/jYLKk0e4c?= =?us-ascii?Q?KVk7vO+YR53xLBF5x0LrWoJwW/uQS9z6Dj1777mqlMnpmTFRGT4C27rH13X4?= =?us-ascii?Q?8BMh+BjWAzROwILGExYd6dA216mUl4wwqQbDjNq9xaKqPJLNACMgtHcNvNTT?= =?us-ascii?Q?8dTC9UOy3Z33Su41/cb+pU3Mn5MO1kjc3G38Q8DQNkj/XoUcPnOFNEOHZiAX?= =?us-ascii?Q?VT5rqdu7yHz0EthuGPbi94WJIg9q7uFGMJTcheEnfzA+lfh7+HJJ4SH6bA/+?= =?us-ascii?Q?HPt2OEEM2VRzJXQiZCEYQ9aVuc/UnTm8Ln1mN7diSLEXyEQkQFrUBGIP4y45?= =?us-ascii?Q?/g5Z4FPuVM21vTjTkgTNkTsLxdnSisW5xSwUtm0XddhoNCWnDSS4Dk7FdPT9?= =?us-ascii?Q?rzIZh8FIowvsuPWzaQQkLoZV2ahVRBoxJCYIugedLErEIH+0Zt7951k4+Jpi?= =?us-ascii?Q?wh1Cr3jAZLRrG/JTOBQi05W5dF2/bRbmmZusASq/j9SawJt134UfFBw/Rgk/?= =?us-ascii?Q?4vpcTn8SVGaqpgEkPAo1HVXgC9xHGQ1d+b0yjjKE9bgPHaMDMLOeEaHZNkEw?= =?us-ascii?Q?beZCKjGlTEiwwW2UXBD+5euGqHL/pVbCMi8FPeDV8wwzFWZr/JEhl/CO5UVU?= =?us-ascii?Q?WRMf6MPiV0MradlZQJZXImmH4hFLA0MIET0gWsfdTVokkSyOAE+mNXS8VwMg?= =?us-ascii?Q?a7eZt/uuI68niNcn66p3Nij7jrLKEV0x1HGAxVk1/9S5o0igB12EAkUNqaE8?= =?us-ascii?Q?nj6noBmOjv8Ddzg2LmPyDH1MXbKNKsBiP0cx2YpFT4c1cb4+I+Vo7dE6Y++Z?= =?us-ascii?Q?5BUUz394MqGncqY2we7s3a4OUX6fk0TQ1mlx4VdABipoH6H/RnG361pGufls?= =?us-ascii?Q?XRKQMo7UvCaap3Oqu6wfhG7EsajxiZSQmgoHCYoggh7cIsMZ2LCP/VpwuDIf?= =?us-ascii?Q?mwaDvAm018Ledji8OULDxx2BxCn67RJ3y7dVFVJGgVz4ulmSN0cXdszVaIym?= =?us-ascii?Q?Kl7BH0KHraUaQN8ceiVPKTxMLN/gnvA/BkC18T1wDUISqfC+8fxO8tzfRZ+c?= =?us-ascii?Q?5Vp+P4rKfQ/wvCilJNW+vA6JN3NmXedPU2GKB8DtyVehrfIPOd1Phq/ml8ZO?= =?us-ascii?Q?nmuT4+/WL5j3UYSTufogKjGHchbNoJtzO/IKhVoWOWsNLcskSgfmSH5s3Yf9?= =?us-ascii?Q?I0xsysz3EQf8k9a5GBzmcpJdeKo4xul1x//4zk66jkX+84HOSN5AhCnr8Cej?= =?us-ascii?Q?AMtrXL8z2LGhtJwGL8Qpq1Hf?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d3286de-5ac1-44a1-d6f2-08d982764965 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2021 11:51:19.7982 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: a7Rv5VEMB5slaD1r07UdhOwPcgogA10zhsYsq6qF40oCCfLRyefqpFNdlWogGH/f+d3F/2pzE46JX1cbioJxQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2727 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: update raw flow to take hex input X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Please ignore this patch for now. Regards, Nipun > -----Original Message----- > From: nipun.gupta@nxp.com > Sent: Tuesday, September 28, 2021 4:39 PM > To: dev@dpdk.org > Cc: xiaoyun.li@intel.com; orika@nvidia.com; thomas@monjalon.net; > ferruh.yigit@intel.com; Hemant Agrawal ; Nipun > Gupta > Subject: [PATCH] app/testpmd: update raw flow to take hex input >=20 > From: Nipun Gupta >=20 > This patch enables method to provide key and mask for raw rules > to be provided as hexadecimal values. There is new parameter > pattern_mask added to support this. >=20 > Signed-off-by: Nipun Gupta > --- > app/test-pmd/cmdline_flow.c | 15 +++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 +++++++++++++ > 2 files changed, 28 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 6cd99bf37f..a95b147d92 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -158,6 +158,7 @@ enum index { > ITEM_RAW_OFFSET, > ITEM_RAW_LIMIT, > ITEM_RAW_PATTERN, > + ITEM_RAW_PATTERN_HEX, > ITEM_ETH, > ITEM_ETH_DST, > ITEM_ETH_SRC, > @@ -1046,6 +1047,7 @@ static const enum index item_raw[] =3D { > ITEM_RAW_OFFSET, > ITEM_RAW_LIMIT, > ITEM_RAW_PATTERN, > + ITEM_RAW_PATTERN_HEX, > ITEM_NEXT, > ZERO, > }; > @@ -2487,6 +2489,19 @@ static const struct token token_list[] =3D { > ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), > ITEM_RAW_PATTERN_SIZE)), > }, > + [ITEM_RAW_PATTERN_HEX] =3D { > + .name =3D "pattern_hex", > + .help =3D "hex string to look for", > + .next =3D NEXT(item_raw, > + NEXT_ENTRY(HEX), > + NEXT_ENTRY(ITEM_PARAM_IS, > + ITEM_PARAM_SPEC, > + ITEM_PARAM_MASK)), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern), > + ARGS_ENTRY(struct rte_flow_item_raw, length), > + ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw), > + ITEM_RAW_PATTERN_SIZE)), > + }, > [ITEM_ETH] =3D { > .name =3D "eth", > .help =3D "match Ethernet header", > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 4f8751be1c..3a69d37037 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3637,6 +3637,7 @@ This section lists supported pattern items and thei= r > attributes, if any. > - ``offset {integer}``: absolute or relative offset for pattern. > - ``limit {unsigned}``: search area limit for start of pattern. > - ``pattern {string}``: byte string to look for. > + - ``pattern_hex {string}``: byte string (provided in hexadecimal) to l= ook for. >=20 > - ``eth``: match Ethernet header. >=20 > @@ -5036,6 +5037,18 @@ The meter policy action list: ``green -> green, ye= llow > -> yellow, red -> red``. > testpmd> create port meter 0 1 13 1 yes 0xffff 0 0 > testpmd> flow create 0 priority 0 ingress group 1 pattern eth / end a= ctions > meter mtr_id 1 / end >=20 > +Sample RAW rule > +~~~~~~~~~~~~~~~ > + > +A RAW rule can be creted as following using ``pattern_hex`` key and mask= . > + > +:: > + > + testpmd> flow create 0 group 0 priority 1 ingress pattern raw relati= ve is 0 > search is 0 offset > + is 0 limit is 0 pattern_hex spec > 00000000000000000000000000000000000000000000000000000a0a0a0a > + pattern_hex mask > 0000000000000000000000000000000000000000000000000000ffffffff / end > actions > + queue index 4 / end > + > BPF Functions > -------------- >=20 > -- > 2.17.1