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 2F8F2A0547; Thu, 21 Oct 2021 10:41:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3E95411B1; Thu, 21 Oct 2021 10:41:25 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 2F97E40142 for ; Thu, 21 Oct 2021 10:41:23 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10143"; a="226438417" X-IronPort-AV: E=Sophos;i="5.87,169,1631602800"; d="scan'208";a="226438417" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 01:41:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,169,1631602800"; d="scan'208";a="527396731" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga001.jf.intel.com with ESMTP; 21 Oct 2021 01:41:21 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 21 Oct 2021 01:41:21 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 21 Oct 2021 01:41:20 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 21 Oct 2021 01:41:20 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 21 Oct 2021 01:41:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYwvayMiLrys9fRJFZPSJ24V7AjtMwPOmsep5TLVDJpYMFrTPD+0UBL87ATAMunIqh7pKIMrPfgiEZ1bw23whcKPPANvA+UQSTTxsJfYOIRU5BDh+wHlCiTZFZgtWGGi+xmekBiHdpmizCtOFOcIwtcqADO89RR5kA3n2/sAeguDtOpToP4xAsHBTfSyzwGMAoma4g9fmg6nJr+aHZz3V9eJpvjumg8737GdP7Q2Ode1KjK+oYYX9zJrCRRxjma8sFNrh6va2CFtw8rcc/mv69Bjj0mtB+vO6seIi8D+SggLrsilGuqUYNnl4qcVtL+VmEUAKichphuhQIxcH1i8zQ== 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=m7bO9DheHB8WLtzwDBRLmhJxehpOgz2G85Snk2m2qN4=; b=ccZtiKyaGcbhlhyZ8nash+3s9m+5HWR+PADFsxYxk3eNCQXnnJkbx4SUsNabmrwgnKWqH4r1ziOgq6AITotPxA4JdKnf+fubh903FWl0Q/yWjb/Dtwm4HljbI21VXOP/7IYzhOJhvvWyS3gOnr7m3MC8XnvK2FnoZ7q4SKA2tsTIkVrOqRmUwm5BDTOpziHS0d0j6ErC65J6eUsuuF1F8nnBqtzdWTQbH4ri6cYVi7lu+twE5AhicL1DK/0Co1vl1Yw4G8oHG4Z6QwZsEO/C9mule3wJ0w3sN8LwH6OqeYzZGCavuGBNsjP6X/F6VPETP+NPtB8/o3oi5EUJa6LSDQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m7bO9DheHB8WLtzwDBRLmhJxehpOgz2G85Snk2m2qN4=; b=JT5qd08xWBhpuVYBTN76MkDmfkvbvHxYfRZKfudZk39d7psJmOy1WziNgsOlPUsby/Jco0GSjT8+CenLm3xM4CE/GIKqYfkE8KAOdmrq2DVwOi7FBkNDFGVSPPvn2IppCNxSX2U9rMpygnv3yGD1S+/aprbWqNXFL2KRGqBgKH0= Received: from DM8PR11MB5639.namprd11.prod.outlook.com (2603:10b6:8:24::15) by DM8PR11MB5608.namprd11.prod.outlook.com (2603:10b6:8:35::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Thu, 21 Oct 2021 08:41:18 +0000 Received: from DM8PR11MB5639.namprd11.prod.outlook.com ([fe80::102c:6b2f:161b:479e]) by DM8PR11MB5639.namprd11.prod.outlook.com ([fe80::102c:6b2f:161b:479e%3]) with mapi id 15.20.4628.016; Thu, 21 Oct 2021 08:41:18 +0000 From: "Wang, Jie1X" To: Ori Kam , "dev@dpdk.org" CC: "Yigit, Ferruh" , NBU-Contact-Thomas Monjalon , "andrew.rybchenko@oktetlabs.ru" , "Li, Xiaoyun" , "Yang, SteveX" , "Wu, Jingjing" , "Xing, Beilei" , "Wu, Wenjun1" , "Zhang, Qi Z" Thread-Topic: [PATCH v7 1/3] ethdev: support L2TPv2 and PPP procotol Thread-Index: AQHXxkSjGFSSAsZp80i4CI2YU/CWP6vdFAsAgAAMdzA= Date: Thu, 21 Oct 2021 08:41:18 +0000 Message-ID: References: <20211020093224.1410449-1-jie1x.wang@intel.com> <20211021062603.1549268-1-jie1x.wang@intel.com> <20211021062603.1549268-2-jie1x.wang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: df63961c-27f6-4e44-7b2b-08d9946e8d22 x-ms-traffictypediagnostic: DM8PR11MB5608: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:222; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w9360I4nsRwBnqvot33XA4Ygzzmq3798UuHVa6vJ9gsSJFIbdAMJqLWgWXbDHMo2SLjSlQrqtfJL1acPorMRZsiTX2FPerX5AtIQjMH1m80QpROFmwdCm+AnCLjnG++Uiopc8QaIi7Txs4+4xwdB7fbC+h5CwxaWbpZAEILBzXxIkQj/sxlpqDe0AR6nD1kkEao+j3lVdlxXjCKsQhzVA3BReM8AYlzKBRSuAVWUd3d28aD+204XR9IGsq1Ehk9JCBMvfQ8stnehNVA6Rmtj0rZsUI0MAWgn7ILoeLytBByno5niieopzq2880gIwb2tPcUBB81ne/YFgBbxfmtSrYESUHrglAsHxss/T/kUlMBlDHgutLbfiwb8XPP8QtM7zvk/xM7mWHpJa1iIChik5WOkBENhQcf1YrE+OIsph0KBiDVN2p05/dnxpdpJcbbZoZM7TtL1pAxGARAiG6lcaJE+5I1nOWyzjLpefFz99AhJye76JWYpPrPg9MY3cniybQUlDoZHRnjqGUiXPgg+bDJxPeiEd9eFHrXJPgeP1HNLbWlV3bIgJol4hOfLNUybQfaLp/rhhqDA+Qbhbh2OfV6CUh4LIuzTw7TSPY1lwM7g5i4wpBNlZVS0zfuBRk9DOLTzuUd+GqcogXzgHVEihB7vbbveYw2iYWwQdmFZIyw2nQuLCgS9w90HaeNPyeZnyK6GpzyXJ+l9vBZbIgL4ug== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5639.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66946007)(64756008)(508600001)(66476007)(66556008)(66446008)(76116006)(55016002)(9686003)(4326008)(38100700002)(33656002)(122000001)(8936002)(86362001)(8676002)(52536014)(5660300002)(71200400001)(107886003)(83380400001)(82960400001)(6506007)(186003)(7696005)(2906002)(110136005)(54906003)(30864003)(316002)(38070700005)(26005)(53546011)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gbDvia8q2i7IWUULk0dXOH4OVs4jX3b1wu8K3u79UvJBfgVbSvhHdLsfKc6w?= =?us-ascii?Q?Ec5X4IZDhv9xFpyrns210haoC8hOXBzoEpB0R5i44scAPNPNOgR5+NV+GMwK?= =?us-ascii?Q?ysjiSQvM3XWsvDbVLzAsuj170V940gWqjdOnuowlCwF/lMFWVeyYUoDVi80d?= =?us-ascii?Q?axghzL4CoImvBGIMmZJ6rw7JRrBf7BhREc81ia/6DiqnVWtGt8ZhA5uQPFkm?= =?us-ascii?Q?0vVrXtRYYhJ7zCC9k57nHcvYIe0QTguGQRaHGAeTjBx5t2C3VTOyU26RDa1+?= =?us-ascii?Q?/nPKg9P8p0oUZuM0qKXQbFJuwrbCEMn3Jc/zkrGCx+m41Jvz6CcigFxk13Zx?= =?us-ascii?Q?YKclEKML+MravZFGPtmwhZ4BTSYtS4s1J3plvlVo1qMd8w3Q1SkWYhBwgeeC?= =?us-ascii?Q?mxsRQMr2H5qDFmzzsbUf3RO7brv5qzlMgpMdvLDh4Jum/ewb+pvfI+ALHHiD?= =?us-ascii?Q?R0ucdqyGmf19Ne8BXGbUhSdL81xIukrWXt4kZmijPu1UZ9t/BhV2bntq32E6?= =?us-ascii?Q?HZORnYGdxfh/bkJramUit6+qQCrlFmsYNVyA538GLDTEULrGvrlTF9fnvzjU?= =?us-ascii?Q?w6tNxPsyi6IcVAC6KFQyQLa2bVAol8yL0uzqMQ2waxYhu0ux226ABdmQZ+ID?= =?us-ascii?Q?I4Bgp2/guQsiHYHG0+X6uzHTUevldv3MNr0Ar3d4hZSigWvXT/Mq7xSTZPGt?= =?us-ascii?Q?A1PB3uiQniam8Yk7xo8gYgH7SCYryLkjayO9Y0l7kHnyvLGwdPutsmmTXTWM?= =?us-ascii?Q?tkN0wQF3hT2rDWPNG5A0vNrcOp4FCwEFFagBBiDbQRDpUbPZEgGVSn461hI4?= =?us-ascii?Q?RJKdGKCc9SaOTLnKw+J7b5si2L/Seykgo3yEBg70BAML8ISi1/GTfJIqVV6W?= =?us-ascii?Q?9af4bVAM4AJ0IHh/0YvjDR7Ok+rsf4h6Hb6xJH/r+btXcrqV8LLSY2gDQKzH?= =?us-ascii?Q?uTPGXUW4B3XF4prpqUlT9hNt3GEGTY8lQ0rgC0lQu1B44g+KFCZIHG5wFQXO?= =?us-ascii?Q?+y70C3qydOzwLwBdTtbZvzafRGsdNIwpFPM/SeVwRmeP+AFxXjw9ZppC6EJI?= =?us-ascii?Q?QbgXR1JT6FyOd2zOfCNEcMkdj0+NXUxinoTR7Glw1Ze16uGnnfj1L421OKNz?= =?us-ascii?Q?OfIcvrEKvpqMUPvA3zgAxdKBjQbIGtu/QhoAc9ZwB4C0zrsKalv6K7vFhuZR?= =?us-ascii?Q?xQD/eM7L3DlFatepooj4w7ay8cBDAx92i7ogUQ2rA6IeE04cjvghQMIIar4d?= =?us-ascii?Q?7QeHNuHebsuiim8k4eW9ZIhrtnFTbVzfJvxIhxkujr3HIVpfwXDZ+K5KxZiO?= =?us-ascii?Q?X+JQZT9DaXPTYO0UILEHXTlte4bKnuZCR/TQ84JExSioQyMbpm5XNhVEsPus?= =?us-ascii?Q?mOwMkq2fyFOQd1DGv5b2H2UPC39GN7takTDfSrD7/mXPBQ5dawm7Pz9Q1tdf?= =?us-ascii?Q?LyXlEEjjinU=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5639.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df63961c-27f6-4e44-7b2b-08d9946e8d22 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2021 08:41:18.2845 (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: jie1x.wang@intel.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5608 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 1/3] ethdev: support L2TPv2 and PPP procotol 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" > -----Original Message----- > From: Ori Kam > Sent: Thursday, October 21, 2021 3:50 PM > To: Wang, Jie1X ; dev@dpdk.org > Cc: Yigit, Ferruh ; NBU-Contact-Thomas Monjalon > ; andrew.rybchenko@oktetlabs.ru; Li, Xiaoyun > ; Yang, SteveX ; Wu, Jingjin= g > ; Xing, Beilei ; Wu, Wenjun= 1 > ; Zhang, Qi Z > Subject: RE: [PATCH v7 1/3] ethdev: support L2TPv2 and PPP procotol >=20 > Hi Jie, >=20 > > -----Original Message----- > > From: Jie Wang > > Sent: Thursday, October 21, 2021 9:26 AM > > Subject: [PATCH v7 1/3] ethdev: support L2TPv2 and PPP procotol > > > > Added flow pattern items and header formats of L2TPv2 and PPP. > > > > Signed-off-by: Wenjun Wu > > Signed-off-by: Jie Wang > > --- > > doc/api/doxy-api-index.md | 2 + > > doc/guides/nics/features/default.ini | 2 + > > doc/guides/nics/features/iavf.ini | 2 + > > doc/guides/prog_guide/rte_flow.rst | 25 +++ > > doc/guides/rel_notes/release_21_11.rst | 4 + > > lib/ethdev/rte_flow.c | 2 + > > lib/ethdev/rte_flow.h | 65 +++++++ > > lib/net/meson.build | 2 + > > lib/net/rte_l2tpv2.h | 234 +++++++++++++++++++++++++ > > lib/net/rte_ppp.h | 34 ++++ > > 10 files changed, 372 insertions(+) > > create mode 100644 lib/net/rte_l2tpv2.h create mode 100644 > > lib/net/rte_ppp.h > > > > diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md > > index 1992107a03..42db196afe 100644 > > --- a/doc/api/doxy-api-index.md > > +++ b/doc/api/doxy-api-index.md > > @@ -121,6 +121,8 @@ The public API headers are grouped by topics: > > [VXLAN] (@ref rte_vxlan.h), > > [Geneve] (@ref rte_geneve.h), > > [eCPRI] (@ref rte_ecpri.h) > > + [L2TPv2] (@ref rte_l2tpv2.h) > > + [PPP] (@ref rte_ppp.h) > > > > - **QoS**: > > [metering] (@ref rte_meter.h), > > diff --git a/doc/guides/nics/features/default.ini > > b/doc/guides/nics/features/default.ini > > index 09914b1ad3..8e6a28c419 100644 > > --- a/doc/guides/nics/features/default.ini > > +++ b/doc/guides/nics/features/default.ini > > @@ -110,6 +110,7 @@ ipv4 =3D > > ipv6 =3D > > ipv6_ext =3D > > ipv6_frag_ext =3D > > +l2tpv2 =3D > > l2tpv3oip =3D > > mark =3D > > meta =3D > > @@ -121,6 +122,7 @@ pfcp =3D > > phy_port =3D > > port_id =3D > > port_representor =3D > > +ppp =3D > > pppoed =3D > > pppoes =3D > > pppoe_proto_id =3D > > diff --git a/doc/guides/nics/features/iavf.ini > > b/doc/guides/nics/features/iavf.ini > > index d00ca934c3..a916275b88 100644 > > --- a/doc/guides/nics/features/iavf.ini > > +++ b/doc/guides/nics/features/iavf.ini > > @@ -50,8 +50,10 @@ icmp6 =3D Y > > ipv4 =3D Y > > ipv6 =3D Y > > ipv6_frag_ext =3D Y > > +l2tpv2 =3D Y > > l2tpv3oip =3D Y > > pfcp =3D Y > > +ppp =3D Y > > sctp =3D Y > > tcp =3D Y > > udp =3D Y > > diff --git a/doc/guides/prog_guide/rte_flow.rst > > b/doc/guides/prog_guide/rte_flow.rst > > index aeba374182..a2169517c3 100644 > > --- a/doc/guides/prog_guide/rte_flow.rst > > +++ b/doc/guides/prog_guide/rte_flow.rst > > @@ -1573,6 +1573,31 @@ rte_flow_flex_item_create() routine. > > as padded with trailing zeroes up to full configured length, both fo= r > > value and mask. > > > > +Item: ``L2TPV2`` > > +^^^^^^^^^^^^^^^^^^^ > > + > > +Matches a L2TPv2 header. > > + > > +- ``flags_version``: flags(12b), version(4b). > > +- ``length``: total length of the message. > > +- ``tunnel_id``: identifier for the control connection. > > +- ``session_id``: identifier for a session within a tunnel. > > +- ``ns``: sequence number for this date or control message. > > +- ``nr``: sequence number expected in the next control message to be > received. > > +- ``offset_size``: offset of payload data. > > +- ``offset_padding``: offset padding, variable length. > > +- Default ``mask`` matches flags_version only. > > + > > +Item: ``PPP`` > > +^^^^^^^^^^^^^^^^^^^ > > + > > +Matches a PPP header. > > + > > +- ``addr``: PPP address. > > +- ``ctrl``: PPP control. > > +- ``proto_id``: PPP protocol identifier. > > +- Default ``mask`` matches addr, ctrl, proto_id. > > + > > Actions > > ~~~~~~~ > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > b/doc/guides/rel_notes/release_21_11.rst > > index 041383ee2a..283770131c 100644 > > --- a/doc/guides/rel_notes/release_21_11.rst > > +++ b/doc/guides/rel_notes/release_21_11.rst > > @@ -105,6 +105,10 @@ New Features > > > > Added an ethdev API which can help users get device configuration. > > > > +* **Added L2TPv2 and PPP protocol support in rte_flow.** > > + > > + Added flow pattern items and header formats of L2TPv2 and PPP protoc= ol. > > + > > * **Updated AF_XDP PMD.** > > > > * Disabled secondary process support. > > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index > > bcf0513b3c..d268784532 100644 > > --- a/lib/ethdev/rte_flow.c > > +++ b/lib/ethdev/rte_flow.c > > @@ -156,6 +156,8 @@ static const struct rte_flow_desc_data > rte_flow_desc_item[] =3D { > > MK_FLOW_ITEM(REPRESENTED_PORT, sizeof(struct > rte_flow_item_ethdev)), > > MK_FLOW_ITEM_FN(FLEX, sizeof(struct rte_flow_item_flex), > > rte_flow_item_flex_conv), > > + MK_FLOW_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)), > > + MK_FLOW_ITEM(PPP, sizeof(struct rte_flow_item_ppp)), > > }; > > > > /** Generate flow_action[] entry. */ > > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index > > 64ed7f2618..300e99e16b 100644 > > --- a/lib/ethdev/rte_flow.h > > +++ b/lib/ethdev/rte_flow.h > > @@ -35,6 +35,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > > > #ifdef __cplusplus > > extern "C" { > > @@ -644,6 +646,20 @@ enum rte_flow_item_type { > > * @see struct rte_flow_item_flex. > > */ > > RTE_FLOW_ITEM_TYPE_FLEX, > > + > > + /** > > + * Matches L2TPv2 Header. > > + * > > + * See struct rte_flow_item_l2tpv2. > > + */ > > + RTE_FLOW_ITEM_TYPE_L2TPV2, > > + > > + /** > > + * Matches PPP Header. > > + * > > + * See struct rte_flow_item_ppp. > > + */ > > + RTE_FLOW_ITEM_TYPE_PPP, > > }; > > > > /** > > @@ -1900,6 +1916,55 @@ static const struct rte_flow_item_ethdev > > rte_flow_item_ethdev_mask =3D { }; #endif > > > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this structure may change without prior notice > > + * RTE_FLOW_ITEM_TYPE_L2TPV2 > > + * > > + * Matches L2TPv2 Header > > + */ > > +struct rte_flow_item_l2tpv2 { > > + struct rte_l2tpv2_combined_msg_hdr hdr; }; > > + > > +/** Default mask for RTE_FLOW_ITEM_TYPE_L2TPV2. */ #ifndef > > +__cplusplus static const struct rte_flow_item_l2tpv2 > > +rte_flow_item_l2tpv2_mask =3D { > > + /* > > + * flags and version bit mask > > + * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 > > + * T L x x S x O P x x x x V V V V > > + */ > > + .hdr =3D { > > + .common =3D { > > + .flags_version =3D RTE_BE16(0xcb0f), > > + }, > > + }, > > +}; > > +#endif > > + > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this structure may change without prior notice > > + * RTE_FLOW_ITEM_TYPE_PPP > > + * > > + * Matches PPP Header > > + */ > > +struct rte_flow_item_ppp { > > + struct rte_ppp_hdr hdr; > > +}; > > + > > +/** Default mask for RTE_FLOW_ITEM_TYPE_PPP. */ #ifndef __cplusplus > > +static const struct rte_flow_item_ppp rte_flow_item_ppp_mask =3D { > > + .hdr =3D { > > + .addr =3D 0xff, > > + .ctrl =3D 0xff, > > + .proto_id =3D RTE_BE16(0xffff), > > + } > > +}; > > +#endif > > + > > /** > > * Matching pattern item definition. > > * > > diff --git a/lib/net/meson.build b/lib/net/meson.build index > > a4e395e9c5..e899846578 100644 > > --- a/lib/net/meson.build > > +++ b/lib/net/meson.build > > @@ -19,6 +19,8 @@ headers =3D files( > > 'rte_higig.h', > > 'rte_ecpri.h', > > 'rte_geneve.h', > > + 'rte_l2tpv2.h', > > + 'rte_ppp.h', > > ) > > > > sources =3D files( > > diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h new file mode > > 100644 index 0000000000..18ea759ff4 > > --- /dev/null > > +++ b/lib/net/rte_l2tpv2.h > > @@ -0,0 +1,234 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright 2021 Mellanox Technologies, Ltd */ > > + > > +#ifndef _RTE_L2TPV2_H_ > > +#define _RTE_L2TPV2_H_ > > + > > +/** > > + * @file > > + * > > + * L2TP header: > > + * > > + * `-0--------------------1----------------2-------------------3` > > + * > > + * `-0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1` > > + * > > + * > > +`+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+` > > + * > > + * `|T|L|x|x|S|x|O|P|x|x|x|x|--Ver--|-----------Length > > +(opt)--------|` > > + * > > + * > > +`+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+` > > + * > > + * `|-----------Tunnel ID-----------|-----------Session > > +ID----------|` > > + * > > + * > > +`+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+` > > + * > > + * `|-----------Ns (opt)------------|-----------Nr > > +(opt)------------|` > > + * > > + * > > +`+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+` > > + * > > + * `|---------Offset Size (opt)-----|---------Offset pad... (opt)` > > + * > > + * > > +`+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+` > > + * > > + * The Type (T) bit indicates the type of message. It is set to 0 for > > +a data > > + * message and 1 for a control message. > > + * > > + * If the Length (L) bit is 1, the Length field is present. This bit > > +MUST be > > + * set to 1 for control messages. > > + * > > + * The x bits are reserved for future extensions. All reserved bits > > +MUST > > + * be set to 0 on outgoing messages and ignored on incoming messages. > > + * > > + * If the Sequence (S) bit is set to 1 the Ns and Nr fields are presen= t. > > + * The S bit MUST be set to 1 for control messages. > > + * > > + * If the Offset (O) bit is 1, the Offset Size field is present. The > > +O > > + * bit MUST be set to 0 for control messages. > > + * > > + * If the Priority (P) bit is 1, this data message should receive > > + * preferential treatment in its local queuing and transmission. > > + * The P bit MUST be set to 0 for control messages. > > + * > > + * Ver MUST be 2, indicating the version of the L2TP data message head= er. > > + * > > + * The Length field indicates the total length of the message in octet= s. > > + * > > + * Tunnel ID indicates the identifier for the control connection. > > + * > > + * Session ID indicates the identifier for a session within a tunnel. > > + * > > + * Ns indicates the sequence number for this data or control message. > > + * > > + * Nr indicates the sequence number expected in the next control > > +message > > + * to be received. > > + * > > + * The Offset Size field, if present, specifies the number of octets > > + * past the L2TP header at which the payload data is expected to start= . > > + * Actual data within the offset padding is undefined. If the offset > > + * field is present, the L2TP header ends after the last octet of the > > + * offset padding. > > + */ > > + > > +#include > > +#include > > + > > +#ifdef __cplusplus > > +extern "C" { > > +#endif > > + > > +/** > > + * L2TPv2 Common Header > > + */ > > +RTE_STD_C11 > > +struct rte_l2tpv2_common_hdr { > > + union { > > + /** header flags and protocol version */ > > + rte_be16_t flags_version; > > + struct { > > +#if RTE_BYTE_ORDER =3D=3D RTE_LITTLE_ENDIAN > > + rte_be16_t t:1; /**< message Type */ > > + rte_be16_t l:1; /**< length option bit */ > > + rte_be16_t res1:2; /**< reserved */ > > + rte_be16_t s:1; /**< ns/nr option bit */ > > + rte_be16_t res2:1; /**< reserved */ > > + rte_be16_t o:1; /**< offset option bit */ > > + rte_be16_t p:1; /**< priority option bit */ > > + rte_be16_t res3:4; /**< reserved */ > > + rte_be16_t ver:4; /**< protocol version */ > > +#elif RTE_BYTE_ORDER =3D=3D RTE_BIG_ENDIAN > > + rte_be16_t ver:4; /**< protocol version */ > > + rte_be16_t res3:4; /**< reserved */ > > + rte_be16_t p:1; /**< priority option bit */ > > + rte_be16_t o:1; /**< offset option bit */ > > + rte_be16_t res2:1; /**< reserved */ > > + rte_be16_t s:1; /**< ns/nr option bit */ > > + rte_be16_t res1:2; /**< reserved */ > > + rte_be16_t l:1; /**< length option bit */ > > + rte_be16_t t:1; /**< message Type */ > > +#endif > > + }; > > + }; > > +}; > > + > > +/** > > + * L2TPv2 message Header contains all options(length, ns, nr, > > + * offset size, offset padding). > > + */ > > +struct rte_l2tpv2_msg_with_all_options { > > + rte_be16_t length; /**< length(16) */ > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > + rte_be16_t ns; /**< Ns(16) */ > > + rte_be16_t nr; /**< Nr(16) */ > > + rte_be16_t offset_size; /**< offset size(16) */ > > + uint8_t *offset_padding; /**< offset padding(variable length) */ > > +}; > > + > > +/** > > + * L2TPv2 message Header contains all options except length(ns, nr, > > + * offset size, offset padding). > > + */ > > +struct rte_l2tpv2_msg_without_length { > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > + rte_be16_t ns; /**< Ns(16) */ > > + rte_be16_t nr; /**< Nr(16) */ > > + rte_be16_t offset_size; /**< offset size(16) */ > > + uint8_t *offset_padding; /**< offset padding(variable length) */ > > +}; > > + > > +/** > > + * L2TPv2 message Header contains all options except ns_nr(length, > > + * offset size, offset padding). > > + * Ns and Nr MUST be toghter. > > + */ > > +struct rte_l2tpv2_msg_without_ns_nr { > > + rte_be16_t length; /**< length(16) */ > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > + rte_be16_t offset_size; /**< offset size(16) */ > > + uint8_t *offset_padding; /**< offset padding(variable length) */ > > +}; > > + > > +/** > > + * L2TPv2 message Header contains all options except ns_nr(length, ns,= nr). > > + * offset size and offset padding MUST be toghter. > > + */ > > +struct rte_l2tpv2_msg_without_offset { > > + rte_be16_t length; /**< length(16) */ > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > + rte_be16_t ns; /**< Ns(16) */ > > + rte_be16_t nr; /**< Nr(16) */ > > +}; >=20 > Why not packed? >=20 > > + > > +/** > > + * L2TPv2 message Header contains options offset size and offset paddi= ng. > > + */ > > +struct rte_l2tpv2_msg_with_offset { > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > + rte_be16_t offset_size; /**< offset size(16) */ > > + uint8_t *offset_padding; /**< offset padding(variable length) */ > > +}; > > + > > +/** > > + * L2TPv2 message Header contains options ns and nr. > > + */ > > +struct rte_l2tpv2_msg_with_ns_nr { > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > + rte_be16_t ns; /**< Ns(16) */ > > + rte_be16_t nr; /**< Nr(16) */ > > +}; >=20 > Why not packed? Same for all structs. >=20 >=20 Hi Ori, Do you mean I should pack Ns/Nr into a structure as a field? And pack offse= t size/offset padding into another structure? > > + > > +/** > > + * L2TPv2 message Header contains option length. > > + */ > > +struct rte_l2tpv2_msg_with_length { > > + rte_be16_t length; /**< length(16) */ > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > +}; > > + > > +/** > > + * L2TPv2 message Header without all options. > > + */ > > +struct rte_l2tpv2_msg_without_all_options { > > + rte_be16_t tunnel_id; /**< tunnel ID(16) */ > > + rte_be16_t session_id; /**< session ID(16) */ > > +}; > > + > > +/** > > + * L2TPv2 Combined Message Header Format: Common Header + Options */ > > +RTE_STD_C11 > > +struct rte_l2tpv2_combined_msg_hdr { > > + struct rte_l2tpv2_common_hdr common; /**< common header */ > > + union { > > + /** header with all options */ > > + struct rte_l2tpv2_msg_with_all_options type0; > > + /** header with all options except length */ > > + struct rte_l2tpv2_msg_without_length type1; > > + /** header with all options except ns/nr */ > > + struct rte_l2tpv2_msg_without_ns_nr type2; > > + /** header with all options except offset */ > > + struct rte_l2tpv2_msg_without_offset type3; > > + /** header with offset options */ > > + struct rte_l2tpv2_msg_with_offset type4; > > + /** header with ns/nr options */ > > + struct rte_l2tpv2_msg_with_ns_nr type5; > > + /** header with length option */ > > + struct rte_l2tpv2_msg_with_length type6; > > + /** header without all options */ > > + struct rte_l2tpv2_msg_without_all_options type7; > > + }; > > +}; > > + > > +#ifdef __cplusplus > > +} > > +#endif > > + > > +#endif /* _RTE_L2TPV2_H_ */ > > diff --git a/lib/net/rte_ppp.h b/lib/net/rte_ppp.h new file mode > > 100644 index 0000000000..2a53cd969f > > --- /dev/null > > +++ b/lib/net/rte_ppp.h > > @@ -0,0 +1,34 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright 2021 Mellanox Technologies, Ltd */ > > + > > +#ifndef _RTE_PPP_H_ > > +#define _RTE_PPP_H_ > > + > > +/** > > + * @file > > + * > > + * PPP headers definition. > > + */ > > + > > +#include > > +#include > > + > > +#ifdef __cplusplus > > +extern "C" { > > +#endif > > + > > +/** > > + * PPP Header > > + */ > > +struct rte_ppp_hdr { > > + uint8_t addr; /**< PPP address(8) */ > > + uint8_t ctrl; /**< PPP control(8) */ > > + rte_be16_t proto_id; /**< PPP protocol identifier(16) */ } > > +__rte_packed; > > + > > +#ifdef __cplusplus > > +} > > +#endif > > + > > +#endif /* _RTE_PPP_H_ */ > > -- > > 2.25.1 >=20 > Best, > Ori