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 88B83A00E6 for ; Tue, 9 Jul 2019 07:21:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB6C01B958; Tue, 9 Jul 2019 07:21:43 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140049.outbound.protection.outlook.com [40.107.14.49]) by dpdk.org (Postfix) with ESMTP id 148844C8D for ; Tue, 9 Jul 2019 07:21:43 +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=blULhmaFemGvpDe/EWREqDNb1Gyj0MHuOnpjZz71pxA=; b=dUik8ptwvBQ6pcEzUzew37nzHk17vo7zDCw1+T4omlm+bwPxWPuECianX2HB36VjHvHEy+yvI6+D6THzI34yfa7Su78eZTfEBCpLWF2izA1Bd1da4bZX6+sSGZhpeGFFfQgux2Fo+NS+LHem12oow4OVIlW3Gr8eVOc1xJBWEmA= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3235.eurprd05.prod.outlook.com (10.171.188.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.19; Tue, 9 Jul 2019 05:21:41 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::1442:fc4d:41ad:29d2]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::1442:fc4d:41ad:29d2%5]) with mapi id 15.20.2052.019; Tue, 9 Jul 2019 05:21:41 +0000 From: Slava Ovsiienko To: Jack Min , Adrien Mazarguil , Ori Kam , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic CC: "dev@dpdk.org" Thread-Topic: [Suspected-Phishing][PATCH v7 4/4] app/testpmd: match GRE's key and present bits Thread-Index: AQHVMxeusdeEiUPPEEaR5X1HXEF0LabBxihg Date: Tue, 9 Jul 2019 05:21:41 +0000 Message-ID: References: <20190624154018.128379-1-jackmin@mellanox.com> <5a22990442050f737d1de7f44279a0dc12ba7db3.1562320050.git.jackmin@mellanox.com> In-Reply-To: <5a22990442050f737d1de7f44279a0dc12ba7db3.1562320050.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=viacheslavo@mellanox.com; x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 701a4ac5-b336-443b-0067-08d7042d539f 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:AM4PR05MB3235; x-ms-traffictypediagnostic: AM4PR05MB3235: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:469; x-forefront-prvs: 0093C80C01 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(376002)(346002)(39860400002)(366004)(189003)(199004)(13464003)(256004)(7696005)(6246003)(476003)(99286004)(486006)(33656002)(14444005)(102836004)(55016002)(110136005)(76176011)(11346002)(446003)(9686003)(26005)(186003)(6436002)(14454004)(66946007)(73956011)(2906002)(66476007)(66446008)(64756008)(66556008)(8936002)(52536014)(4326008)(229853002)(74316002)(7736002)(86362001)(25786009)(81166006)(81156014)(8676002)(5660300002)(478600001)(305945005)(3846002)(71200400001)(6116002)(71190400001)(53936002)(316002)(6506007)(53546011)(68736007)(76116006)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3235; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: SGoe/UgZrcxSkq1g2DlpD5gPMxNWHY9qZeMrIVjWJabIHoibLqmadL5JiGAIiaWQESys4veV3rL6zsHAbTi095hM37iCyGAxcGrLIbGF0DBswRViM8yw02wacRqHHM3FN8VwRhc2UTraByB1skZ7yJGSG4SHMhiFFhxZjcsMV54yNK9JJMofr3NK7NzZ/4GnA5xkeFRgtZQDv6d+SX34DCIZTImjXa8WBAgEqim/DoLb1JDtYzuItnIYd9KjGm0Cl3gBzjCVXa2JhiYE9deDF/jeX9X3RSIQr9AGzreTQVRjMOZhEyrVmOYsKbVykF5iwtAcLPVs7Vu1deQE4ua/Q7zw6Pr6cpDXd4oSGws/Lp4rc5UQb1gkM1MTDfSEAPLP9Ly0ampAidv10TQ5px4t2s5pTr19LgKwVTee9I8TIY4= 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: 701a4ac5-b336-443b-0067-08d7042d539f X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2019 05:21:41.7444 (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: viacheslavo@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3235 Subject: Re: [dpdk-dev] [Suspected-Phishing][PATCH v7 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: Friday, July 5, 2019 12:54 > To: Adrien Mazarguil ; Ori Kam > ; Slava Ovsiienko ; > Wenzhuo Lu ; Jingjing Wu > ; Bernard Iremonger > ; John McNamara > ; Marko Kovacevic > > Cc: dev@dpdk.org > Subject: [Suspected-Phishing][PATCH v7 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 / gre_key value 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 > Acked-by: Ori Kam > Acked-by: Adrien Mazarguil > Signed-off-by: Xiaoyu Min Acked-by: Viacheslav Ovsiienko > --- > app/test-pmd/cmdline_flow.c | 64 +++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++ > 2 files changed, 68 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 201bd9de56..949a38a0e7 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -148,6 +148,10 @@ enum index { > ITEM_MPLS_LABEL, > ITEM_GRE, > ITEM_GRE_PROTO, > + ITEM_GRE_C_RSVD0_VER, > + ITEM_GRE_C_BIT, > + ITEM_GRE_K_BIT, > + ITEM_GRE_S_BIT, > ITEM_FUZZY, > ITEM_FUZZY_THRESH, > ITEM_GTP, > @@ -181,6 +185,8 @@ enum index { > ITEM_ICMP6_ND_OPT_TLA_ETH_TLA, > ITEM_META, > ITEM_META_DATA, > + ITEM_GRE_KEY, > + ITEM_GRE_KEY_VALUE, >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -610,6 +616,7 @@ static const enum index next_item[] =3D { > ITEM_ICMP6_ND_OPT_SLA_ETH, > ITEM_ICMP6_ND_OPT_TLA_ETH, > ITEM_META, > + ITEM_GRE_KEY, > ZERO, > }; >=20 > @@ -755,6 +762,16 @@ static const enum index item_mpls[] =3D { >=20 > static const enum index item_gre[] =3D { > ITEM_GRE_PROTO, > + ITEM_GRE_C_RSVD0_VER, > + ITEM_GRE_C_BIT, > + ITEM_GRE_K_BIT, > + ITEM_GRE_S_BIT, > + ITEM_NEXT, > + ZERO, > +}; > + > +static const enum index item_gre_key[] =3D { > + ITEM_GRE_KEY_VALUE, > ITEM_NEXT, > ZERO, > }; > @@ -1898,6 +1915,40 @@ static const struct token token_list[] =3D { > .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gre, > protocol)), > }, > + [ITEM_GRE_C_RSVD0_VER] =3D { > + .name =3D "c_rsvd0_ver", > + .help =3D > + "checksum (1b), undefined (1b), key bit (1b)," > + " sequence number (1b), reserved 0 (9b)," > + " version (3b)", > + .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_C_BIT] =3D { > + .name =3D "c_bit", > + .help =3D "checksum bit (C)", > + .next =3D NEXT(item_gre, NEXT_ENTRY(BOOLEAN), > item_param), > + .args =3D ARGS(ARGS_ENTRY_MASK_HTON(struct > rte_flow_item_gre, > + c_rsvd0_ver, > + "\x80\x00\x00\x00")), > + }, > + [ITEM_GRE_S_BIT] =3D { > + .name =3D "s_bit", > + .help =3D "sequence number bit (S)", > + .next =3D NEXT(item_gre, NEXT_ENTRY(BOOLEAN), > item_param), > + .args =3D ARGS(ARGS_ENTRY_MASK_HTON(struct > rte_flow_item_gre, > + c_rsvd0_ver, > + "\x10\x00\x00\x00")), > + }, > + [ITEM_GRE_K_BIT] =3D { > + .name =3D "k_bit", > + .help =3D "key bit (K)", > + .next =3D NEXT(item_gre, NEXT_ENTRY(BOOLEAN), > item_param), > + .args =3D ARGS(ARGS_ENTRY_MASK_HTON(struct > rte_flow_item_gre, > + c_rsvd0_ver, > + "\x20\x00\x00\x00")), > + }, > [ITEM_FUZZY] =3D { > .name =3D "fuzzy", > .help =3D "fuzzy pattern match, expect faster than default", > @@ -2150,6 +2201,19 @@ static const struct token token_list[] =3D { > .args =3D ARGS(ARGS_ENTRY_MASK_HTON(struct > rte_flow_item_meta, > data, "\xff\xff\xff\xff")), > }, > + [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_VALUE] =3D { > + .name =3D "value", > + .help =3D "key value", > + .next =3D NEXT(item_gre_key, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARG_ENTRY_HTON(rte_be32_t)), > + }, >=20 > /* Validate/create actions. */ > [ACTIONS] =3D { > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index cb83a3ce8a..9ef1796ee1 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 > their attributes, if any. >=20 > - ``protocol {unsigned}``: protocol type. >=20 > +- ``gre_key``: match GRE optional key field. > + > + - ``value {unsigned}``: key value. > + > - ``fuzzy``: fuzzy pattern match, expect faster than default. >=20 > - ``thresh {unsigned}``: accuracy threshold. > -- > 2.21.0