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 C4B21A04F0; Tue, 10 Dec 2019 11:16:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EAE161B13C; Tue, 10 Dec 2019 11:16:22 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50080.outbound.protection.outlook.com [40.107.5.80]) by dpdk.org (Postfix) with ESMTP id 56D981F5 for ; Tue, 10 Dec 2019 11:16:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jj2spWe5D8CYuQW44no6YEArqal+2BbGxVhik8Mhcvj/gTt8+wRjqlhsA6k0wkGnPvXZhGTtVYEdrO2NDpUfvYa4vg6o/LufgsjOP1du4gQiZCUPgoORMfap6wyUqXGC73VvBJFy9BfhcYvULb1MANxtKkaiqvgurgy1CQY+v0RdrwLz9jOm/TCdG6MynFto9E1a3B5J1QAkdI17OZg1+kgKqBLHmECEH5NVPUTAFJz8esZzhd/BK7HdQQynqo04cuCAzlwN/bjxYQiAtB4AsHjCKgTVpKL0z0vuMeOSCexGqhv2v93xbKBwn4JLzlvS96HqdICk0g2FDdokRsgpXA== 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-SenderADCheck; bh=0Z2/gWCrbDdg8Fn+8AFSG+8EIOJbtoQN5eiwEAinNPI=; b=GJ4iW5JhbIJunsghgAs8KmpW5qga3nyPpEzglW91T5vt5TDMve/8wz9YEGYDROZY5ruqOM7OFCaF5KZwpMNPXCuV+5gji6U0bCvtSPnH4vnyqQy3DIlVn82qnVAyr+LMSNSLOMafsd5DIg/PJP/J6vxg3V35YpAC+J9CAdioT7MvvUDk8I1vzy4gJUsU5aRIP69NTDhVBvhInbPJPeuDF6D5E3CO3TDyF6Oeqi0sz2qaXGz267KoWPdfFgyymQYW3JbtVTNADiba/GRqln0zoLoS55SqH+geDIPH+vBOunWDJMQUM7oNRVWWgeZd5wRDy9Hx5NwNj3zu6OhRxrQKrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Z2/gWCrbDdg8Fn+8AFSG+8EIOJbtoQN5eiwEAinNPI=; b=XUg1dBU/02VmGxf7Yioe+M20qDVLWX7sbf9KplrkVBTaIFCneOlaz/UtICrB0Sogo7lWOdy49vDqDy5lXc2UqsLsaxuqWfai+gjWAgrqDXwBl3h6TwAivDyZNnrs+o67NazNaOrh3J1lIwxPmdbqNnR213ekYzPOx0p08/U2aLU= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by AM4PR05MB3315.eurprd05.prod.outlook.com (10.171.190.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.14; Tue, 10 Dec 2019 10:16:18 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::d877:95ed:5f94:a4a]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::d877:95ed:5f94:a4a%3]) with mapi id 15.20.2516.018; Tue, 10 Dec 2019 10:16:17 +0000 From: Ori Kam To: Rory Sexton , "dev@dpdk.org" CC: "qi.z.zhang@intel.com" , "beilei.xing@intel.com" , Adrien Mazarguil , Dariusz Jagus Thread-Topic: [dpdk-dev] [PATCH] ethdev: add L2TPv3 header to flow API Thread-Index: AQHVqq0+rDvHUb8LykqFESCNqlVVt6ezLT2g Date: Tue, 10 Dec 2019 10:16:17 +0000 Message-ID: References: <20191204141055.3647-1-rory.sexton@intel.com> In-Reply-To: <20191204141055.3647-1-rory.sexton@intel.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-ht: Tenant x-ms-office365-filtering-correlation-id: 32c16480-779c-462c-592e-08d77d59fef0 x-ms-traffictypediagnostic: AM4PR05MB3315: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 02475B2A01 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(39860400002)(396003)(366004)(346002)(13464003)(199004)(189003)(5660300002)(8936002)(8676002)(81166006)(81156014)(86362001)(55016002)(33656002)(52536014)(478600001)(66556008)(66476007)(7696005)(66946007)(66446008)(64756008)(186003)(54906003)(2906002)(71200400001)(4326008)(316002)(53546011)(6506007)(76116006)(26005)(110136005)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3315; 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: BCL:0; x-microsoft-antispam-message-info: Zc5buONCzEeiSkkCtSZDCSUb8om+MyjFoiwOtTFp3sjk5HdqcwiQCjywwBVK59sNK+g33rwIjh4/33NDYTUTu7Pw7bsDjj7i3C4EuQCromqhGpY5hqVaEsomIcJLn754jA2pInMSUTSxGxd7l1SikxC1PTH8yaPDteJQSaN90w7n//dCmnAyE6VMcvsbGEmbsc8cAmT3fM+IbH+qn0fzeGOQLD117dFkOkMjK7/gsJXzmdd0Vz+lFl4pGAx2OUt3I89yKA9yS5XcXeUobm6XqKQ8Qc+JFgnsPrcBZiPkuTTaWmnSdbYb2etmgA0e30XW9289XBLB5A1VvGvvv6Ta8nsp+wPXQ0OfT9NVAwtWO+eibB4cJ5/5E5mD8bdj+ipvdGsMBT4S3L8CAj4jocqb5Kh0dKe/9ZmiaAvvBpi76ff4P+S9cgfbFAAq7Rurp1HqdbViWwHHFVPlCQwGN2ni2k0aUv0PiCDeqpJpQXRqvc1jMSlOs2fKOEHHxspGYtUg x-ms-exchange-transport-forked: True 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: 32c16480-779c-462c-592e-08d77d59fef0 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Dec 2019 10:16:17.7760 (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: nkPCq2jiF8zMoVSPWV6EA80YCuSTSmD39HCi/KPO+VTSfJjBe/lg0le/ghJQScuzUpYzZY9dRbbUTi5dd3jdnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3315 Subject: Re: [dpdk-dev] [PATCH] ethdev: add L2TPv3 header to flow API 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" Hi Rory, One general question why do we want to support only v3 and not also v2? PSB for some other comments. Best, Ori Kam > -----Original Message----- > From: dev On Behalf Of Rory Sexton > Sent: Wednesday, December 4, 2019 4:11 PM > To: dev@dpdk.org > Cc: qi.z.zhang@intel.com; beilei.xing@intel.com; rory.sexton@intel.com; > Adrien Mazarguil ; Dariusz Jagus > > Subject: [dpdk-dev] [PATCH] ethdev: add L2TPv3 header to flow API >=20 > - RTE_FLOW_ITEM_TYPE_L2TPV3: matches a L2TPv3 header >=20 > Signed-off-by: Rory Sexton > Signed-off-by: Dariusz Jagus > --- > app/test-pmd/cmdline_flow.c | 28 +++++++++++++++++++++ > doc/guides/prog_guide/rte_flow.rst | 8 ++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++ > lib/librte_ethdev/rte_flow.c | 1 + > lib/librte_ethdev/rte_flow.h | 27 ++++++++++++++++++++ > 5 files changed, 68 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 99dade7d8..a7fe7a7a8 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -213,6 +213,8 @@ enum index { > ITEM_TAG, > ITEM_TAG_DATA, > ITEM_TAG_INDEX, > + ITEM_L2TPV3, > + ITEM_L2TPV3_SESSION_ID, >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -746,6 +748,7 @@ static const enum index next_item[] =3D { > ITEM_PPPOE_PROTO_ID, > ITEM_HIGIG2, > ITEM_TAG, > + ITEM_L2TPV3, > END_SET, > ZERO, > }; > @@ -1030,6 +1033,12 @@ static const enum index item_tag[] =3D { > ZERO, > }; >=20 > +static const enum index item_l2tpv3[] =3D { > + ITEM_L2TPV3_SESSION_ID, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -2593,6 +2602,21 @@ static const struct token token_list[] =3D { > NEXT_ENTRY(ITEM_PARAM_IS)), > .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_tag, > index)), > }, > + [ITEM_L2TPV3] =3D { > + .name =3D "l2tpv3", > + .help =3D "match L2TPv3 header", > + .priv =3D PRIV_ITEM(L2TPV3, sizeof(struct > rte_flow_item_l2tpv3)), > + .next =3D NEXT(item_l2tpv3), > + .call =3D parse_vc, > + }, > + [ITEM_L2TPV3_SESSION_ID] =3D { > + .name =3D "session_id", > + .help =3D "session identifier", > + .next =3D NEXT(item_l2tpv3, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct > rte_flow_item_l2tpv3, > + session_id)), > + }, > + > /* Validate/create actions. */ > [ACTIONS] =3D { > .name =3D "actions", > @@ -6238,6 +6262,10 @@ flow_item_default_mask(const struct > rte_flow_item *item) > break; > case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID: > mask =3D &rte_flow_item_pppoe_proto_id_mask; > + break; > + case RTE_FLOW_ITEM_TYPE_L2TPV3: > + mask =3D &rte_flow_item_l2tpv3_mask; > + break; > default: > break; > } > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index a254c81ef..c7ddb38c5 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -1336,6 +1336,14 @@ Broadcom switches. >=20 > - Default ``mask`` matches classification and vlan. >=20 > +Item: ``L2TPV3`` > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +Matches a L2TPv3 header. > + > +- ``session_id``: L2TPv3 session identifier. > +- Default ``mask`` matches session_id only. > + >=20 > Actions > ~~~~~~~ > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 73ef0b41d..a48e77619 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3954,6 +3954,10 @@ This section lists supported pattern items and the= ir > attributes, if any. >=20 > - ``proto_id {unsigned}``: PPP protocol identifier. >=20 > +- ``l2tpv3``: match L2TPv3 header. > + > + - ``session_id {unsigned}``: L2TPv3 session identifier. > + > Actions list > ^^^^^^^^^^^^ >=20 > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 87a3e8c4c..fcda73320 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -93,6 +93,7 @@ static const struct rte_flow_desc_data > rte_flow_desc_item[] =3D { > MK_FLOW_ITEM(IGMP, sizeof(struct rte_flow_item_igmp)), > MK_FLOW_ITEM(AH, sizeof(struct rte_flow_item_ah)), > MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)), > + MK_FLOW_ITEM(L2TPV3, sizeof(struct rte_flow_item_l2tpv3)), > }; >=20 > /** Generate flow_action[] entry. */ > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index 452d359a1..5ee055c28 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -510,6 +510,16 @@ enum rte_flow_item_type { > * See struct rte_flow_item_tag. > */ > RTE_FLOW_ITEM_TYPE_TAG, > + > + /* Missing *. It should be /** > + * Matches a L2TPv3 header. > + * > + * Configure flow for L2TPv3 packets. > + * > + * See struct rte_flow_item_l2tpv3. > + */ > + RTE_FLOW_ITEM_TYPE_L2TPV3, > + > }; >=20 > /** > @@ -1373,6 +1383,23 @@ static const struct rte_flow_item_tag > rte_flow_item_tag_mask =3D { > }; > #endif >=20 > +/** > + * RTE_FLOW_ITEM_TYPE_L2TPV3. > + * > + * Matches a L2TPv3 header. > + */ > +struct rte_flow_item_l2tpv3 { > + rte_be32_t session_id; /**< Session ID. */ > +}; Does it make sense that in future we will want to match on the=20 T / L / ver / Ns / Nr? Please also consider that any change will be ABI / API breakage, which will= be allowed only next year. > + > +/** Default mask for RTE_FLOW_ITEM_TYPE_L2TPV3. */ > +#ifndef __cplusplus > +static const struct rte_flow_item_l2tpv3 rte_flow_item_l2tpv3_mask =3D { > + .session_id =3D RTE_BE32(UINT32_MAX), > +}; > +#endif > + > + > /** > * @warning > * @b EXPERIMENTAL: this structure may change without prior notice > -- > 2.17.1 >=20 > -------------------------------------------------------------- > Intel Research and Development Ireland Limited > Registered in Ireland > Registered Office: Collinstown Industrial Park, Leixlip, County Kildare > Registered Number: 308263 >=20 >=20 > This e-mail and any attachments may contain confidential material for the > sole > use of the intended recipient(s). Any review or distribution by others is > strictly prohibited. If you are not the intended recipient, please contac= t the > sender and delete all copies.