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 9C509A0C43; Mon, 18 Oct 2021 12:57:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DDB840141; Mon, 18 Oct 2021 12:57:03 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2048.outbound.protection.outlook.com [40.107.95.48]) by mails.dpdk.org (Postfix) with ESMTP id 127F14003C for ; Mon, 18 Oct 2021 12:57:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dzxa86CIoLSavsAQ9g0D29Sm3HBv02s+137Aoq4Ie1EsB38sPHRZB934/6pf409XH9WuImhhp8ypk8QPJJxjAdhSqU9ahM30NKYShxiF0iWnerAgTNiuPT9nSG47SN1vCQP//DzdUPfdWhu6/dM9BY1qDYlm6oHqg4GW9Zp5eLAXLlZ0ZKqJ2y17eQuSFIJIgRUWZJaiQsCVmCD8x7bs29P7SlyrmVgazL+Qxs2LZVUdRyYi1r9EcKUveDj/7itwJWmSAqcI5CHQQyr7khLY6Yb5s1GcT6rmBEyEy9SyFWT6y+1cYOUm1ujqIexA4N9qPYYEY1Gi1IBj7UpnbdEbkQ== 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=S2BoX+rh79W5gQVdgJvYA/QK/p/Pcg+1Aqu+SOZL6bI=; b=n7XWQ0iyEq1ey9xFUhKCHd+Z0QLJPtaxfh8yTvWKiD6gbKtraR/z5muY5sNbPX77lLlkByqpR7razrXj8OlyuUtQvJCyLKiKJ/iT/ilBkm4VO0bhLLVwd446sHATBwd4SI1dHG2U4aXWIkhKMv5d6R9UHDkzsqTBG0PZuQXHkHtxx+u9LoyQ3gR1+Cos6+GjvdgWI/7p4KrnH0Fys7B6x9AfyBIZFvbMwVi5bj5Dec84YSBuOff0eTiwn/feL2iXLEF8Vl6Er3X9Vu6PbaeY+cUv/1UPVuTz1/bxj5q0H/Xj0Ux9J7dYk4SgOJgmgMyK61doBsSAbXP2Qq9xbCSiLA== 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=S2BoX+rh79W5gQVdgJvYA/QK/p/Pcg+1Aqu+SOZL6bI=; b=jji8JDOQu5VSgidKUluxmRkBqXIvelMSdq3X6sb0QxTinoM2tg/Lhj3+00SIwjQILEadouhxF7WPKx7HlzEfnyivrb+SQuCfDc97h+fN1n4PvHv9BSWe2Q+vLOTf3WKry4PVi0QkkoH2zs6okd70CyS+7bzMsMikR+Tis5HAQoRamQl2oqhNwGponA/dtftnQTpwyrEw7nisq+3C+1lBmnRLLqh5cUxKjTNmuHd9B4zuJIF9gaUoFNIS5bO9/g/CjVJyTSkoJV6PgBc/+KKubCFAjCewPQqHerpJMd3pxgHv5L9NXkqH3dSN5+SIf0NFcuUI8dLbEkrVDO4zYxJBPQ== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5134.namprd12.prod.outlook.com (2603:10b6:5:391::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Mon, 18 Oct 2021 10:56:59 +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 10:56:59 +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 1/3] ethdev: support PPP and L2TPV2 procotol Thread-Index: AQHXxANZvKmIxSfs3U2If2tKYZydRavYlDUQ Date: Mon, 18 Oct 2021 10:56:59 +0000 Message-ID: References: <20211015095823.701188-1-jie1x.wang@intel.com> <20211018093352.892788-1-jie1x.wang@intel.com> <20211018093352.892788-2-jie1x.wang@intel.com> In-Reply-To: <20211018093352.892788-2-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: abf9130f-daa6-43c4-24f5-08d992260248 x-ms-traffictypediagnostic: DM4PR12MB5134: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:741; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ssPWd2ZLYRm0WqNaS/UuV3JusMNo5Vca6+mr1CdMTN3AxoJiaxZbcFRSHzeK/onvKcrHSgYACJriR7Vwa8fiHU9mezwHU/D7IenHacX72s3KHzCarIVsmg8Y2akK+KaOUrkswRoA29YEMSWRpnWmf4gxRDLKglC4tlRSqeXKGQ2sLS8AdUcXhhn34R7BfHET0cXDmxLEEqwUL9rEvrvlpZ1vMZNpB+2Ud8BHCunLvWmIioLtJdcQWpUAlFz/K6SqnVNJFU17ZkbfAKTMJ6Ravgx2wILxv31d4op8VGuU7ntlsqrCRXaFOb+gX8lXv4RzovpHiYPwxeNogOxjALezFqusK3YDI+0npyHAHZSEbCeomFDgDv+iOzyYousXURvcnIzSWBXiY0W/D2v9fRDWZ/mdA3A49DGH/fPqmz0bPCUKFWUj7hzqFPeY4LJi/SdQUr9zP76HIw4Vpj6dIp9S3JxOvNJervthXiCFbsCawtnPtyjmHx4BHRwmgp9sBEyg+tL8QWIpxr/sqJYbzbKeJrp7juU25IRtuZJxFXaPTdDtjrRRxJCysAjZJBOJ6sNX/Ed9nr/lwqFQZmPaNg03G4f2jnXOSYcikiang/F5K9pE7MpWj7lCC4qyiXIfcyGPudg5wR+zF/GpBgXOjnuS0b4jKR7rkqvjBd0v/gtHF2UTpn1fRhSHjD/ncBdleUBxCRkd/MTgKI6Rm/zynqxXdg== 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)(7696005)(4326008)(33656002)(83380400001)(122000001)(9686003)(508600001)(186003)(86362001)(30864003)(7416002)(66946007)(8936002)(2906002)(66476007)(38070700005)(76116006)(110136005)(66556008)(54906003)(8676002)(66446008)(64756008)(5660300002)(52536014)(316002)(55016002)(38100700002)(71200400001)(53546011)(6506007)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EXl7KYmv+/04gDiiNMlDiv5UcjoG6tfQonEwpYaVHJqK/81Lycy6iPvwTzQ9?= =?us-ascii?Q?qJQ82xmQ/30T0Yi0fBe2THgdAm3n0k6RYUyjQICc1dZjziAE/6hOT6l55A1q?= =?us-ascii?Q?QWfH7E07mUBCgOomyFyPsFhXmDJl3WvWCBPNsq/Nw69TnHwqm1H6k68In9+t?= =?us-ascii?Q?C7URAxiGnIoCq/MSMLuHu1X70fH1U6kpv/1DVGhtFpWlThZ8Co3ZuKydhp77?= =?us-ascii?Q?s1OlqIzGb4GlUxnn+XINzukLb/6ujRymucaVBbnZpwQkl3z7F7LbQolkwtN6?= =?us-ascii?Q?QcnAj5fpI3ymPOM2saE0Dcx0br/63+4M24gMKcr0CQB+d3e1zG6YJjFlV+uR?= =?us-ascii?Q?fN+XZ5jYH6+81d99KMpmSdc/5+Ws+HU+qpr/zaz2tcTEBL3u4mmuPHnhQubI?= =?us-ascii?Q?Pv6ARgfnb5Gn9OQFH41ztU2WiSoeDUqYCRTvfkBZuBmNUpVd5IqH7YQ55N1d?= =?us-ascii?Q?XKCbSxGUQgKMdNQaQ+Y9nKETKBB2u0Brthzh36+lqzlY+HLaWVFlfq28Pomd?= =?us-ascii?Q?VhUx0rZKxU0AVyr7ypt4JJrRLWMKvJztBF9Zf9jRxue438E0CaiJlnGIApWR?= =?us-ascii?Q?LcmbHnvnGE+G3T6wyHjPyw6jinmoEu5v45CtNFgeP1eoOSnoA2NqpYt/Ca6b?= =?us-ascii?Q?bGImZQk9CZEq+sWdRRZEGcXM50op01uVn4y1FU8cqFYGJxfaawsRngwF+2Bs?= =?us-ascii?Q?ogdeHeMEXddddhALAIG8o4N3VjIGpCPszfPuvDMhMmtmi2KhE1s56fmPEZ1P?= =?us-ascii?Q?JZY/MU4wf6MGr3WvNf0ZpdM3pS1Uksfs+50o78RTWUR0/kUHJKICOWDJ6Oau?= =?us-ascii?Q?ZmmpJLoPZQ137/Px9CO+XskCpb1nfh0bhiy7Cc2zLceUmPofPTwa4WOfSTqG?= =?us-ascii?Q?2j8UXJJTJ8sImdZLgo+cqrrIh21Kpic8+yo8WO9PfL0sQkvL21kiT2cFAa9/?= =?us-ascii?Q?axzfnkv8p5a5F9lCisGfeYVUAzlOnJP3ASgoFtGKinuMHVOMPXCb7BtAtHqe?= =?us-ascii?Q?D3YqGuVb+K7s8C6n86gm2ZbMBmu6XM6W04w85Z8e7zTQIh8d/cUXIg38ALYv?= =?us-ascii?Q?i18m9KEP8EsGpIwhGMNbO+lSnEgrfqNCo/c/CQnPeHDR6vZwTyqR9YIFEOix?= =?us-ascii?Q?rO6HUeV8y8RemCFccXH62gCvp5IMmRy/II1xAGwo6xuQ4AJ7cDwByiSXL/gn?= =?us-ascii?Q?3M7R4VQMdwmkG5d7dif4XMHd3uYiGO99sxAv08mtZOj4Hephi8dRpkUWA/lH?= =?us-ascii?Q?kM0dJt338Oj9KRe4Kyry74eK6pVWQo4gT+aP463r8CYFS2VoImtKb1aBgCwO?= =?us-ascii?Q?fOR849B/X73gVwVoCyfM3PIg?= 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: abf9130f-daa6-43c4-24f5-08d992260248 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 10:56:59.3683 (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: EZlDMv7CBASWAFc8TfadJXAW+YF9noDYJYcEUhxnIJd5Q/D/eacJ7sVkAbGVAPx/8ZYSFwf33lgpoHhngZuOYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5134 Subject: Re: [dpdk-dev] [PATCH v4 1/3] ethdev: support PPP and L2TPV2 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" Hi Jie, I realy don't know why you keep insisting about the RSS? you keep using it in the documentation, the reason I care is that you are not doing anything with RSS, and you can't have RSS on the PPP or L2TPV2 fields right? > -----Original Message----- > From: Jie Wang > Sent: Monday, October 18, 2021 12:34 PM > To: dev@dpdk.org > Subject: [PATCH v4 1/3] ethdev: support PPP and L2TPV2 procotol >=20 > Added flow pattern items and header formats of L2TPv2 and PPP. >=20 > Signed-off-by: Wenjun Wu > Signed-off-by: Jie Wang > --- > doc/guides/prog_guide/rte_flow.rst | 25 +++ > doc/guides/rel_notes/release_21_11.rst | 5 + > lib/ethdev/rte_flow.c | 2 + > lib/ethdev/rte_flow.h | 66 ++++++++ > lib/net/rte_l2tpv2.h | 214 +++++++++++++++++++++++++ > lib/net/rte_ppp.h | 35 ++++ > 6 files changed, 347 insertions(+) > create mode 100644 lib/net/rte_l2tpv2.h create mode 100644 lib/net/rte_= ppp.h >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_flow.rst > index fa05fe0845..6277c641ef 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -1548,6 +1548,31 @@ This item is meant to use the same structure as `I= tem: > PORT_REPRESENTOR`_. >=20 > See also `Action: REPRESENTED_PORT`_. >=20 > +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 rec= eived. > +- ``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 > ~~~~~~~ >=20 > diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_note= s/release_21_11.rst > index ec2a788789..e1b23ce0e9 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -98,6 +98,11 @@ New Features >=20 > Added an ethdev API which can help users get device configuration. >=20 > +* **Added L2TPV2 and PPP protocol support in rte_flow.** > + > + Added flow pattern items and header formats of L2TPv2 and PPP to > + support PPP over L2TPv2 over UDP protocol RSS Hash. Why RSS hash appears here? > + > * **Updated AF_XDP PMD.** >=20 > * Disabled secondary process support. > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 29f2b0e9= 54..0bfbeb73e8 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -102,6 +102,8 @@ static const struct rte_flow_desc_data rte_flow_desc_= item[] =3D { > MK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)), > MK_FLOW_ITEM(PORT_REPRESENTOR, sizeof(struct rte_flow_item_ethdev)), > MK_FLOW_ITEM(REPRESENTED_PORT, sizeof(struct rte_flow_item_ethdev)), > + MK_FLOW_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)), > + MK_FLOW_ITEM(PPP, sizeof(struct rte_flow_item_ppp)), > }; >=20 > /** Generate flow_action[] entry. */ > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index d5bfdaaa= f2..2bc825b567 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -35,6 +35,8 @@ > #include > #include > #include > +#include > +#include >=20 > #ifdef __cplusplus > extern "C" { > @@ -635,6 +637,21 @@ enum rte_flow_item_type { > * @see struct rte_flow_item_ethdev > */ > RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, > + > + /** > + * 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, > + > }; >=20 > /** > @@ -1891,6 +1908,55 @@ static const struct rte_flow_item_ethdev rte_flow_= item_ethdev_mask =3D { > }; #endif >=20 > +/** > + * @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 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 0xffff, > + } > +}; > +#endif > + > /** > * Matching pattern item definition. > * > diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h new file mode 10= 0644 index > 0000000000..aea3c689be > --- /dev/null > +++ b/lib/net/rte_l2tpv2.h > @@ -0,0 +1,214 @@ > +/* 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 present. > + * 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 header= . > + * > + * The Length field indicates the total length of the message in octets. > + * > + * 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 { > + 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, n= r). > + * 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) */ > +}; > + > +/* > + * L2TPv2 message Header contains options offset size and offset padding= . > + */ > +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) */ > +}; > + > +/* > + * 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; > + union { > + struct rte_l2tpv2_msg_with_all_options type0; > + struct rte_l2tpv2_msg_without_length type1; > + struct rte_l2tpv2_msg_without_ns_nr type2; > + struct rte_l2tpv2_msg_without_offset type3; > + struct rte_l2tpv2_msg_with_offset type4; > + struct rte_l2tpv2_msg_with_ns_nr type5; > + struct rte_l2tpv2_msg_with_length type6; > + 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 i= ndex > 0000000000..9ea633baa7 > --- /dev/null > +++ b/lib/net/rte_ppp.h > @@ -0,0 +1,35 @@ > +/* 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 id(16) */ } __rte_packed; > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* _RTE_PPP_H_ */ > -- > 2.25.1 Best, Ori