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 5E569A0C43; Mon, 18 Oct 2021 13:03:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB2D240141; Mon, 18 Oct 2021 13:03:24 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2054.outbound.protection.outlook.com [40.107.237.54]) by mails.dpdk.org (Postfix) with ESMTP id 7AEA84003C for ; Mon, 18 Oct 2021 13:03:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZMcvjvoW0Vl3WAsvrtifRnOpmlju3lMH663/NsSbF/LUo3NStBMldisd3BGQeQR6V+0zHWkdnnaCIeyMyW1WTa8002PhXQMupVmXGNzammyY55PDoLA7vgjtXiCczvWZ4MKMFCNUgXqidmDvFYDHgoYazW/KYxwXbgFnUFzXGMi/WVXvFM4otZYb6D/X1zwmH/MrQjedvoNM2Dw9wce3LVRxGnZJZOMIvNC1/BShboo1jpNaN6AwjvcEjuyXW3SgzE9SYRNJfDRctPzl5Shb6Au8R+rFR6RzyhnDyr8Lutw1vKNwQ+QTU2zmKa3S2zpKhN5E0sj/sJgJwcbvkmeNzg== 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=+cfNvgZG7r0tFk+HpqFzoP6Rge0W414LdNghiBZOmUs=; b=Hgv1aYjy4TBw74ryOPy93kMwmPXZwN81l1wNxy7tEBKGeQQGRCtAEALRdqrWj7W+s3j6UkoVNTEPedYHC7S6pwdzc/j76A9EgjpJ/m/X45Lh0d4DPcWA9LznF7oUH19g66uHiB6hmPQSBjohb/9Ce1/FOfnrZkGOjFt+No/WLlvU7atkUlhwAlTNcHRvTBgXbeFpaBlVTfBgYBeYtOldaYuCDbWT/cYAKNhEgifqdbaPz/ADo2wluKZhY9zyfhMo8yOTHLCrj2oeaRWHTFbj4xLdn11KCOCEw24SjGii5/s/GhUEXT27UQdyuLmVn5kyJBUX5SoKoqegb7YEq+J7Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+cfNvgZG7r0tFk+HpqFzoP6Rge0W414LdNghiBZOmUs=; b=kUlrPugSUQOeFoBZgwg79hvFPlr9gpnWHBBUH5rwNh6oUcGuv311iKHSsS+KnpkMFLLeNIU/y2iWAf9UBTYU2K1i98cHOCH32nVCpcDhyb2R5hm4/vx0WWuaAByD1aCHSSwrXeqxUA2j1NJtSMobIeEh6tr4zvuhbA39yIDs+gXRX644gcaT17zv+hq7/HjAtTt41zJgMxLCAFyGMZRWFp/KHbw1Gd/WAqxku1wwNc53CZoGpzMGWCGk6X9Mh09XW8Z0h4YsUxcWT0wBGs7ZmCbT1yEcrk9/osHkmL3tyXniWekSz0LRTxAJ8bSopRqZWKCl7plliqP1xa2ldoQXuA== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Mon, 18 Oct 2021 11:03:22 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%7]) with mapi id 15.20.4608.018; Mon, 18 Oct 2021 11:03:22 +0000 From: Ori Kam To: Jie Wang , "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , NBU-Contact-Thomas Monjalon , "andrew.rybchenko@oktetlabs.ru" , "xiaoyun.li@intel.com" , "stevex.yang@intel.com" , "jingjing.wu@intel.com" , "beilei.xing@intel.com" , "wenjun1.wu@intel.com" , "qi.z.zhang@intel.com" Thread-Topic: [PATCH v4 3/3] app/testpmd: support L2TPV2 and PPP protocol pattern Thread-Index: AQHXxANdxgsM6N9RWke9iXRDFJ/twavYlh3w Date: Mon, 18 Oct 2021 11:03:21 +0000 Message-ID: References: <20211015095823.701188-1-jie1x.wang@intel.com> <20211018093352.892788-1-jie1x.wang@intel.com> <20211018093352.892788-4-jie1x.wang@intel.com> In-Reply-To: <20211018093352.892788-4-jie1x.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ee5341fb-6b02-420b-cf98-08d99226e65f x-ms-traffictypediagnostic: DM8PR12MB5400: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2Ygu//rK/aXpHQ7Euupz45epkcgS1TaRnRBJrGJmfyKrZvWqTsxMXaS7+W2EtHt41S+5dYN0O0eanP0wUm+AUZ7Aa/YEBlvXrSNHb5ktc0DMkwct0wZLhZDllJeu4E5B9+TRM5+2pqVX7dddAU16pOP7s5foltOLMF+GEYn2+iBMkqMU/4iyET9iAKFE+Ajwdl2MCcb5wPibLpirSsTfLJHcb9q6Hjc1j++3qUDj3XZ4qfjh2GUQCVhXOSAsKb5eifBIAensr7qO1IXg+SH697azhhFOtPacy62FBVzjdEXZu3mhkF0y+k2U6j/pnC2pXHPnU7X7Vz4hJGSqiHEP2tCY1M/xnm8HPjnf1Kl2JVBeEKpwqDuzSGwDXDvxMExkiF62ZD5hRWKzE6S/nnnt8wx0QBetvlwvpbMvstjCEppIINgDcnjbMemvPbqZtvOmBwJH0FxWAU3C0NcvzbaSesRHrTKG4fYqlVAkbREk0PtuD8Jx4iS9SX1BVXWPd07Zq2wKS8lCHTKPHVuI1SwRylrRjDqLEylaKioIjuuuHYIQ17VfMLh6UsJN2sB7VG4cfL9tAbdwEEV8006lgM3S97IW8YIvtRCV/EO3s3vG5gDZPkp2dEh4D/F7/F72Czui0YZET95ByF3edCxcQrAdyEgq4kN21A/nbGk3T3Ec2M3E5F+iAI78rzKyOnhNpiVr6sZlp28ZSlhVuF18ZHKKPw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR12MB5400.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(186003)(76116006)(66446008)(9686003)(66556008)(8936002)(7416002)(64756008)(66946007)(83380400001)(66476007)(33656002)(5660300002)(8676002)(2906002)(38070700005)(53546011)(6506007)(7696005)(71200400001)(26005)(52536014)(122000001)(110136005)(86362001)(54906003)(38100700002)(4326008)(508600001)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ryWFSXLWvRegTD9n7yxOsNo2xFQHwIkb/hKaqVBfv2YytZklmmsejon5gf3C?= =?us-ascii?Q?2/EiGMY4l5z1ZpUwV6YwablLoBaXqqy/JZYsoKtLkpEUGOKd37FTOe2wK3kU?= =?us-ascii?Q?pyM6RvaPsRaGNryEawFVkTsJeglhExM6bIh0xDBwzjhMF1lccSsbAyBBYTs0?= =?us-ascii?Q?rm0rF7jss2Vq25kjKKOiqhlCTyk1ntvHFMddqbxXf6OBGp8K6mRMq3J+EHlK?= =?us-ascii?Q?7WmBfg/fwvOJFhz81e6PXP5yeJZ58z1SBNPTUdvteMmoU6h8+ARZZ7sPfoDi?= =?us-ascii?Q?gdRGTswv5m1RBrb8qjNCFQZ2hlk8k93NLeEQxVYOQxsRdmhVQ+R1QXQC8t5l?= =?us-ascii?Q?i7cMzkOZJYVXOYRqsh/iwZqgIW4jAy0fDxjNJ1qUsw2DVBDSSvNgNXAB/5lA?= =?us-ascii?Q?buejGFj2zHM9+8N8hl+wdKKlqb4p+uIB3HD9Et/U9n/J8t+kczUhXt911Ex+?= =?us-ascii?Q?M1x39DUjiFhiY/fOHwigV6oa14PTtGxY7Xia6J7BAeVfKpKlEEJ75ddSi1nG?= =?us-ascii?Q?ta7ex+ZX3OcWkK4vFSkIWpBmw8aIwqE8cTMLu3qZ31PBRcdN30ON8xmKh1Wg?= =?us-ascii?Q?71cBTIdDnwv//UghmtZ0whbxokCSOVpRJ6wKJhqgt+at76pbuCw6W6iKne5F?= =?us-ascii?Q?rVtbiQ0MDAFkNaQtG5NFV5ao8kJa2tw7qYmwe6uEu9z6jRG+XH55REujXRtg?= =?us-ascii?Q?xE9CYlhq62mAJ6Z7YReMPnrP92zIsiZfGDVfzbteCcfRVaMHWr9wXzPk1rfJ?= =?us-ascii?Q?OivNXXyk9Yz3Pfe1yvg3TXqlr83UgqWI409szE5MFrhSfxzc6tZTlcslg1XQ?= =?us-ascii?Q?Xi08oVTHA3bzUDCOmAAL52Sjy7PQKuQpYp0hwl3M3nnJ7cvs2LGYA+3xJYhF?= =?us-ascii?Q?6PoDRPMh93JmGRw15vYEgB+hruyfzS/T+Z3FgfCxGjzwZC6Pwx+Qt9lkdNwb?= =?us-ascii?Q?ALO0te3ksLx4frHRr1a/46tUtrhIN9Mp9c3MV7R9r6+KVNONbEfJEqvH85l1?= =?us-ascii?Q?HUX2qGvQ+Bv0/1n90OZod3F2xhTCxWIkdiIBTYjxTIjloRp6cYt3vKCGKPPc?= =?us-ascii?Q?fhHzh+1xV3QpXSSJI+oZvvLnu2+28NrJ7Q/X8JWtaRxGvjrTqaKrd9OrBnBK?= =?us-ascii?Q?yBOOfALr/y4vwtqQMfIA8Y8ts4Eat0aV+/liWqGGBu4FJs99Y+4IlI479UX7?= =?us-ascii?Q?s+HufRh3GSdcKIjvGTvz6PNpcDj5E0zyNA9knHej2Q35IB3oDdGnHWmVAYcm?= =?us-ascii?Q?QYoBE6+NNYq9knxIz9TVZs44E1BG3GQjMpJREBRjJkm2jeIH73hmnjEWrE02?= =?us-ascii?Q?QIcOn0IIoORpr4ur6Pt1pDX9?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5400.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee5341fb-6b02-420b-cf98-08d99226e65f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 11:03:21.9743 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /tqU68ZcCq4KmhulOm189SsRvQnzZWLFvr9esD5AZEZfYNFbh42g4aJ213uoAu2K38jjIbAm5eETuND0tx7xIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5400 Subject: Re: [dpdk-dev] [PATCH v4 3/3] app/testpmd: support L2TPV2 and PPP protocol pattern 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" Hi Jie, > -----Original Message----- > From: Jie Wang > Sent: Monday, October 18, 2021 12:34 PM > To: dev@dpdk.org > Subject: [PATCH v4 3/3] app/testpmd: support L2TPV2 and PPP protocol patt= ern >=20 > Add support for test-pmd to parse protocol pattern L2TPv2 and PPP. >=20 > Signed-off-by: Wenjun Wu > Signed-off-by: Jie Wang > --- > app/test-pmd/cmdline_flow.c | 251 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 251 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c in= dex > a90822b660..c1046e3e28 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -310,6 +310,23 @@ enum index { > ITEM_PORT_REPRESENTOR_PORT_ID, > ITEM_REPRESENTED_PORT, > ITEM_REPRESENTED_PORT_ETHDEV_PORT_ID, > + ITEM_L2TPV2, > + ITEM_L2TPV2_COMMON, > + ITEM_L2TPV2_COMMON_TYPE, > + ITEM_L2TPV2_COMMON_TYPE_DATA_L, > + ITEM_L2TPV2_COMMON_TYPE_CTRL, > + ITEM_L2TPV2_MSG_DATA_L_LENGTH, > + ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, > + ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, > + ITEM_L2TPV2_MSG_CTRL_LENGTH, > + ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, > + ITEM_L2TPV2_MSG_CTRL_SESSION_ID, > + ITEM_L2TPV2_MSG_CTRL_NS, > + ITEM_L2TPV2_MSG_CTRL_NR, > + ITEM_PPP, > + ITEM_PPP_ADDR, > + ITEM_PPP_CTRL, > + ITEM_PPP_PROTO_ID, >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -1018,6 +1035,8 @@ static const enum index next_item[] =3D { > ITEM_CONNTRACK, > ITEM_PORT_REPRESENTOR, > ITEM_REPRESENTED_PORT, > + ITEM_L2TPV2, > + ITEM_PPP, > END_SET, > ZERO, > }; > @@ -1398,6 +1417,31 @@ static const enum index item_represented_port[] = =3D { > ZERO, > }; >=20 > +static const enum index item_l2tpv2[] =3D { > + ITEM_L2TPV2_COMMON, > + ITEM_NEXT, > + ZERO, > +}; > + > +static const enum index item_l2tpv2_common[] =3D { > + ITEM_L2TPV2_COMMON_TYPE, > + ZERO, > +}; > + > +static const enum index item_l2tpv2_common_type[] =3D { > + ITEM_L2TPV2_COMMON_TYPE_DATA_L, > + ITEM_L2TPV2_COMMON_TYPE_CTRL, > + ZERO, > +}; > + > +static const enum index item_ppp[] =3D { > + ITEM_PPP_ADDR, > + ITEM_PPP_CTRL, > + ITEM_PPP_PROTO_ID, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -1781,6 +1825,9 @@ static int parse_vc_conf(struct context *, const st= ruct token *, static int > parse_vc_item_ecpri_type(struct context *, const struct token *, > const char *, unsigned int, > void *, unsigned int); > +static int parse_vc_item_l2tpv2_type(struct context *, const struct toke= n *, > + const char *, unsigned int, > + void *, unsigned int); > static int parse_vc_action_meter_color_type(struct context *, > const struct token *, > const char *, unsigned int, void *, @@ -3682,6 +3729,153 @@ > static const struct token token_list[] =3D { > item_param), > .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, port_id)), > }, > + [ITEM_L2TPV2] =3D { > + .name =3D "l2tpv2", > + .help =3D "match l2tpv2 header", > + .priv =3D PRIV_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)), > + .next =3D NEXT(item_l2tpv2), > + .call =3D parse_vc, > + }, > + [ITEM_L2TPV2_COMMON] =3D { > + .name =3D "common", > + .help =3D "l2tpv2 common header", > + .next =3D NEXT(item_l2tpv2_common), > + }, > + [ITEM_L2TPV2_COMMON_TYPE] =3D { > + .name =3D "type", > + .help =3D "type of common header", > + .next =3D NEXT(item_l2tpv2_common_type), > + .args =3D ARGS(ARG_ENTRY_HTON(struct rte_flow_item_l2tpv2)), > + }, > + [ITEM_L2TPV2_COMMON_TYPE_DATA_L] =3D { > + .name =3D "data_l", > + .help =3D "Type #6: data message with length option", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH, > + ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, > + ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, > + ITEM_NEXT)), > + .call =3D parse_vc_item_l2tpv2_type, > + }, > + [ITEM_L2TPV2_MSG_DATA_L_LENGTH] =3D { > + .name =3D "length", > + .help =3D "message length", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_LENGTH, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type6.length)), > + }, > + [ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID] =3D { > + .name =3D "tunnel_id", > + .help =3D "tunnel identifier", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_TUNNEL_ID, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type6.tunnel_id)), > + }, > + [ITEM_L2TPV2_MSG_DATA_L_SESSION_ID] =3D { > + .name =3D "session_id", > + .help =3D "session identifier", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_DATA_L_SESSION_ID, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type6.session_id)), > + }, > + [ITEM_L2TPV2_COMMON_TYPE_CTRL] =3D { > + .name =3D "control", > + .help =3D "Type #3: conrtol message contains length, ns, nr options", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH, > + ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, > + ITEM_L2TPV2_MSG_CTRL_SESSION_ID, > + ITEM_L2TPV2_MSG_CTRL_NS, > + ITEM_L2TPV2_MSG_CTRL_NR, > + ITEM_NEXT)), > + .call =3D parse_vc_item_l2tpv2_type, > + }, > + [ITEM_L2TPV2_MSG_CTRL_LENGTH] =3D { > + .name =3D "length", > + .help =3D "message length", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_LENGTH, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type3.length)), > + }, > + [ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID] =3D { > + .name =3D "tunnel_id", > + .help =3D "tunnel identifier", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_TUNNEL_ID, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type3.tunnel_id)), > + }, > + [ITEM_L2TPV2_MSG_CTRL_SESSION_ID] =3D { > + .name =3D "session_id", > + .help =3D "session identifier", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_SESSION_ID, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type3.session_id)), > + }, > + [ITEM_L2TPV2_MSG_CTRL_NS] =3D { > + .name =3D "ns", > + .help =3D "sequence number for message", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type3.ns)), > + }, > + [ITEM_L2TPV2_MSG_CTRL_NR] =3D { > + .name =3D "nr", > + .help =3D "sequence number for next receive message", > + .next =3D NEXT(NEXT_ENTRY(ITEM_L2TPV2_MSG_CTRL_NS, > + ITEM_L2TPV2_COMMON, ITEM_NEXT), > + NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv2, > + hdr.type3.nr)), > + }, > + [ITEM_PPP] =3D { > + .name =3D "ppp", > + .help =3D "match ppp header", > + .priv =3D PRIV_ITEM(PPP, sizeof(struct rte_flow_item_ppp)), > + .next =3D NEXT(item_ppp), > + .call =3D parse_vc, > + }, > + [ITEM_PPP_ADDR] =3D { > + .name =3D "addr", > + .help =3D "ppp address", > + .next =3D NEXT(item_ppp, NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ppp, hdr.addr)), > + }, > + [ITEM_PPP_CTRL] =3D { > + .name =3D "ctrl", > + .help =3D "ppp control", > + .next =3D NEXT(item_ppp, NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ppp, hdr.ctrl)), > + }, > + [ITEM_PPP_PROTO_ID] =3D { > + .name =3D "proto_id", > + .help =3D "ppp protocol id", > + .next =3D NEXT(item_ppp, NEXT_ENTRY(COMMON_UNSIGNED), > + item_param), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_ppp, > + hdr.proto_id)), > + }, > /* Validate/create actions. */ > [ACTIONS] =3D { > .name =3D "actions", > @@ -5569,6 +5763,57 @@ parse_vc_item_ecpri_type(struct context *ctx, cons= t struct token *token, > return len; > } >=20 > +/** Parse L2TPV2 common header type field. */ static int > +parse_vc_item_l2tpv2_type(struct context *ctx, const struct token *token= , > + const char *str, unsigned int len, > + void *buf, unsigned int size) > +{ > + struct rte_flow_item_l2tpv2 *l2tpv2; > + struct rte_flow_item_l2tpv2 *l2tpv2_mask; > + struct rte_flow_item *item; > + uint32_t data_size; > + uint8_t msg_type =3D 0; > + struct buffer *out =3D buf; > + const struct arg *arg; > + > + (void)size; > + /* Token name must match. */ > + if (parse_default(ctx, token, str, len, NULL, 0) < 0) > + return -1; > + switch (ctx->curr) { > + case ITEM_L2TPV2_COMMON_TYPE_DATA_L: > + msg_type |=3D 0x4000; > + break; > + case ITEM_L2TPV2_COMMON_TYPE_CTRL: > + msg_type |=3D 0xC800; > + break; > + default: > + return -1; > + } > + if (!ctx->object) > + return len; > + arg =3D pop_args(ctx); > + if (!arg) > + return -1; > + l2tpv2 =3D (struct rte_flow_item_l2tpv2 *)out->args.vc.data; > + l2tpv2->hdr.common.flags_version |=3D msg_type; > + data_size =3D ctx->objdata / 3; /* spec, last, mask */ > + l2tpv2_mask =3D (struct rte_flow_item_l2tpv2 *)(out->args.vc.data + > + (data_size * 2)); > + l2tpv2_mask->hdr.common.flags_version =3D 0xFFFF; > + if (arg->hton) { > + l2tpv2->hdr.common.flags_version =3D > + rte_cpu_to_be_16(l2tpv2->hdr.common.flags_version); > + l2tpv2_mask->hdr.common.flags_version =3D > + rte_cpu_to_be_16(l2tpv2_mask->hdr.common.flags_version); > + } > + item =3D &out->args.vc.pattern[out->args.vc.pattern_n - 1]; > + item->spec =3D l2tpv2; > + item->mask =3D l2tpv2_mask; > + return len; > +} > + > /** Parse meter color action type. */ > static int > parse_vc_action_meter_color_type(struct context *ctx, const struct token= *token, @@ -8461,6 > +8706,12 @@ flow_item_default_mask(const struct rte_flow_item *item) > case RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT: > mask =3D &rte_flow_item_ethdev_mask; > break; > + case RTE_FLOW_ITEM_TYPE_L2TPV2: > + mask =3D &rte_flow_item_l2tpv2_mask; > + break; > + case RTE_FLOW_ITEM_TYPE_PPP: > + mask =3D &rte_flow_item_ppp_mask; > + break; > default: > break; > } > -- > 2.25.1 I see that you are missing updating the cmd_set_raw_parsed function, withou= t it raw encap/decap will not work for your new tunnel header. Best, Ori