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 6DD0DA0487 for ; Tue, 2 Jul 2019 11:53:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 481731B96E; Tue, 2 Jul 2019 11:53:18 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40082.outbound.protection.outlook.com [40.107.4.82]) by dpdk.org (Postfix) with ESMTP id 1FA20325F for ; Tue, 2 Jul 2019 11:53:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BLeh5sWG/MuhOy1SZaPYzcRrS1ivf3xhgbJkgm4Ad/g=; b=qBt0of8ww26F1AjwBNSUuN8Z87IP3Xbl7Cxyfb5E2OHuaXcDeioz59Sf3Uf6z7p/FWmEC5cHeh/21zwFtCJxh8tpslVbVjOliVJi4jp0+2EUUvH2WRS+KfdSCgHmYVvxTYlCcHOT3gp2x7Pe75/7nrDZqle+YqKhdtx88GQHz40= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by AM4SPR01MB267.eurprd05.prod.outlook.com (10.171.191.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Tue, 2 Jul 2019 09:53:15 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::d12a:4df1:37d7:cc06]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::d12a:4df1:37d7:cc06%7]) with mapi id 15.20.2032.019; Tue, 2 Jul 2019 09:53:15 +0000 From: Ori Kam To: Jack Min , Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic CC: "dev@dpdk.org" Thread-Topic: [Suspected-Phishing][PATCH v4 4/4] app/testpmd: match GRE's key and present bits Thread-Index: AQHVMLsQqzECJfhZ70CjPJCxl/NXVKa3FlWg Date: Tue, 2 Jul 2019 09:53:15 +0000 Message-ID: References: <20190624154018.128379-1-jackmin@mellanox.com> <5d9e2fcd3a1bf439b0cff354ca5b5bf1f43e090d.1562058723.git.jackmin@mellanox.com> In-Reply-To: <5d9e2fcd3a1bf439b0cff354ca5b5bf1f43e090d.1562058723.git.jackmin@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3554b046-1bfd-47b3-d744-08d6fed31aa9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM4SPR01MB267; x-ms-traffictypediagnostic: AM4SPR01MB267: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:758; x-forefront-prvs: 008663486A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(366004)(346002)(39860400002)(396003)(13464003)(199004)(189003)(7736002)(316002)(14454004)(966005)(110136005)(68736007)(45080400002)(74316002)(2906002)(305945005)(229853002)(64756008)(66446008)(66476007)(81166006)(66556008)(71200400001)(71190400001)(76116006)(8936002)(73956011)(81156014)(52536014)(33656002)(3846002)(66946007)(6116002)(6246003)(86362001)(66066001)(11346002)(53546011)(99286004)(25786009)(102836004)(4326008)(5660300002)(7696005)(6506007)(6306002)(76176011)(256004)(6436002)(9686003)(186003)(486006)(476003)(53936002)(26005)(446003)(478600001)(8676002)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4SPR01MB267; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: OimlGzdgkvogiQVXR1uSQEVxRS1zh+8/N835+RMbapzoziGLHQfyRtxCvrUEuql3P+xlpRSTGMKzfMMyEA6TxSk93m1fluauIn8JTRwgFmkMFkQvEFQFUVJnz1B7n0uRezwQAM34gq49Bw0Z1V51c6pdN3xNqc39uVKsqOxPYhUX327J5aucnxTdHmBrlQqeRh2NWQFRnIINUstXpRv31YrTT9AjViYgvLCl4ByBE7ujrU+YFt4tcqMAqpadbuSjK6SvqD/S4eyenAArG87SAD2qZ/6YCX9T7wPun3XFUJtKB8GOmFtEKho/5lAsGMHRwKWwdlIJbSTiTh8XlGbm+4VfTADqik9AxPS2JwVQxfnX2qq6/vKnJTCyKmZ8bIjxKVJvcFGHYf0B4PPw/IloeWdsAnyXkaCF3wdfYh534Ow= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3554b046-1bfd-47b3-d744-08d6fed31aa9 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2019 09:53:15.6657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: orika@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4SPR01MB267 Subject: Re: [dpdk-dev] [Suspected-Phishing][PATCH v4 4/4] app/testpmd: match GRE's key and present bits X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" > -----Original Message----- > From: Xiaoyu Min > Sent: Tuesday, July 2, 2019 12:46 PM > To: Ori Kam ; Adrien Mazarguil > ; Wenzhuo Lu ; > Jingjing Wu ; Bernard Iremonger > ; John McNamara > ; Marko Kovacevic > Cc: dev@dpdk.org > Subject: [Suspected-Phishing][PATCH v4 4/4] app/testpmd: match GRE's key = and > present bits >=20 > support matching on GRE key and present bits (C,K,S) >=20 > example testpmd command could be: > testpmd>flow create 0 ingress group 1 pattern eth / ipv4 / > gre crksv is 0x2000 crksv mask 0xb000 / > gre_key key is 0x12345678 / end > actions rss queues 1 0 end / mark id 196 / end >=20 > Which will match GRE packet with k present bit set and key value is > 0x12345678. >=20 > Signed-off-by: Xiaoyu Min > --- Acked-by: Ori Kam Thanks, Ori Kam > ** This patch is based on patch [1] >=20 > [1] > https://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpatch= es.d > pdk.org%2Fpatch%2F55773%2F&data=3D02%7C01%7Corika%40mellanox.co > m%7C1d141143694542013e2a08d6fed23185%7Ca652971c7d2e4d9ba6a4d149 > 256f461b%7C0%7C0%7C636976576061576503&sdata=3Dd3lj4YEdQn96zqvb > U5VDWvIu40IUFSNAaug51eOSHns%3D&reserved=3D0 > --- > app/test-pmd/cmdline_flow.c | 32 +++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++ > 2 files changed, 36 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 201bd9de56..8504cc8bc1 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -148,6 +148,9 @@ enum index { > ITEM_MPLS_LABEL, > ITEM_GRE, > ITEM_GRE_PROTO, > + ITEM_GRE_CRKSV, > + ITEM_GRE_KEY, > + ITEM_GRE_KEY_KEY, > ITEM_FUZZY, > ITEM_FUZZY_THRESH, > ITEM_GTP, > @@ -595,6 +598,7 @@ static const enum index next_item[] =3D { > ITEM_NVGRE, > ITEM_MPLS, > ITEM_GRE, > + ITEM_GRE_KEY, > ITEM_FUZZY, > ITEM_GTP, > ITEM_GTPC, > @@ -755,6 +759,13 @@ static const enum index item_mpls[] =3D { >=20 > static const enum index item_gre[] =3D { > ITEM_GRE_PROTO, > + ITEM_GRE_CRKSV, > + ITEM_NEXT, > + ZERO, > +}; > + > +static const enum index item_gre_key[] =3D { > + ITEM_GRE_KEY_KEY, > ITEM_NEXT, > ZERO, > }; > @@ -1898,6 +1909,27 @@ static const struct token token_list[] =3D { > .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gre, > protocol)), > }, > + [ITEM_GRE_CRKSV] =3D { > + .name =3D "crksv", > + .help =3D "GRE's first word (bit0 - bit15)", > + .next =3D NEXT(item_gre, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gre, > + c_rsvd0_ver)), > + }, > + [ITEM_GRE_KEY] =3D { > + .name =3D "gre_key", > + .help =3D "match GRE Key", > + .priv =3D PRIV_ITEM(GRE_KEY, > + sizeof(rte_be32_t)), > + .next =3D NEXT(item_gre_key), > + .call =3D parse_vc, > + }, > + [ITEM_GRE_KEY_KEY] =3D { > + .name =3D "key", > + .help =3D "GRE key", > + .next =3D NEXT(item_gre_key, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARG_ENTRY_HTON(rte_be32_t)), > + }, > [ITEM_FUZZY] =3D { > .name =3D "fuzzy", > .help =3D "fuzzy pattern match, expect faster than default", > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index cb83a3ce8a..fc3ba8a009 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3804,6 +3804,10 @@ This section lists supported pattern items and the= ir > attributes, if any. >=20 > - ``protocol {unsigned}``: protocol type. >=20 > +- ``gre_key``: match GRE optional key field. > + > + - ``key {unsigned}``: key value. > + > - ``fuzzy``: fuzzy pattern match, expect faster than default. >=20 > - ``thresh {unsigned}``: accuracy threshold. > -- > 2.21.0