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 5591DA0350; Mon, 11 May 2020 16:25:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E95F32BFA; Mon, 11 May 2020 16:25:28 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) by dpdk.org (Postfix) with ESMTP id AA1352B96 for ; Mon, 11 May 2020 16:25:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XtBj+cwo5PR6qdHa5WrovhLNooASauKaC0MyUX2BXjY/NQkOL2Xx5dRNyRovLZ2RwPuMbmKZyGT+U5ZLMegXXuqaWQASmlqRLiYhovreAyw8ywTxpySln+T1gsV2IdMmSMCWBD+yodY7l/9kKcfjYmRtonHtK7X28VVj6axL6+mz9to9CjUlUuHxWxsSD2fqV5mQyQR8itLZ9glUZZ7ymJ60CCWEw80wsTyEbV6XtMyobOqyl5mkoNDcXGuoUyAVyKg91YdMVxSXbSrAv4UbEXcjLWUGSCWgG93zdCj2Mwy+hSfzool4wW2+AnMCKSnscrr2Si5sHnmrIHpZemde5g== 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=OaiWzBfErHmNda0s7txuGNTKjxTBtLSjrJa47et+JI0=; b=gpSvJxfQ/wrQ6VLaqt0NWzdZ+MPm7vTSQue1eH6lzFmUj0WVK2UfrE1JFPqZs1RaRbhysuZwwmyEqZ9GC7X5NmAvQrJ8/x4rmAhIYHkTWIPTL6yUf+FOdXlMvN0HZzTNbnHd2IwzKmQz3/olbJKCt1vQlBNbLR9NcdfBF7sRK2cOIR6MMIH6K5WJAf0gZzL/sO/j/JBPyAMTvM+vDJOrmKG6NGlRFKMhxNuW5ibgnha/fD/PAyjdneYx/h5UH/P0gxyLrUNr+vLneqCCKw8BITykRCiAKIP93fmda1m6NS6dieCSBSE4PYEgRQTirqRlMgkgP4MHIr+ZsRjn9fwGEQ== 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=OaiWzBfErHmNda0s7txuGNTKjxTBtLSjrJa47et+JI0=; b=QOOs6xxXQbMkP9euOqSws5enxUyKnAP2L63BPKVHBD1MMkKpjubvEGiiOMp/F7RcocXB8xA/V9XHrlj4kM/IEqF9yKEJ7qXNOY0jVOtK7WwhgJwG3ULEBR8gpKtQjcwAdksKeH7zPx0BEppV7lZCJW0HjPM536vFDVQRStM/CWc= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB4226.eurprd05.prod.outlook.com (2603:10a6:208:57::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Mon, 11 May 2020 14:25:26 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 14:25:26 +0000 From: Raslan Darawsheh To: Dekel Peled , Matan Azrad , Slava Ovsiienko CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: support match on GTP flags Thread-Index: AQHWI8m1HBMPaJPbW0WgfstDD15ynaii+GCA Date: Mon, 11 May 2020 14:25:25 +0000 Message-ID: References: <172bff51c15e003369174831b3777575e358097a.1588785170.git.dekelp@mellanox.com> In-Reply-To: <172bff51c15e003369174831b3777575e358097a.1588785170.git.dekelp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [188.161.229.217] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4f0f0673-3b13-4334-7350-08d7f5b725ff x-ms-traffictypediagnostic: AM0PR05MB4226:|AM0PR05MB4226: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 04004D94E2 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Az/NfDkiaGqvxiINMJzgQACN29e200Q0oYPFZll+yamWO5hU2XHMau/yTbt5qVFWeHOGsL85AL09aAh3JTCGsVErPZVJ5sXx5RFjkWfpp/GlcifrGokW5HePhCN0GEAu7H5ZTz3y3JIJHwzUttLWU9Dlhxl6J2KJA6s5wXBWVX32U38n/JeqN0JAImfJrzHUHpCWf5nuxahjDSB1f6jUSDztYxew7KI4ddwh8gSsobln4wCStTda+bHm0wAF7DgENztSPHiuop6qK/BET3y2b7T2r3L0PuC5AWJT8IdJpIifU+APy+fCCRG98ErEO8lo8K0HuJEGkKqNA+Qh5amS4NFtjZo8N3n7934Q/Cga29j/YPTd7gtj8INfhdQ3+7jKTB+iT/hNCLbn1W1HeOLyKng5Vuy5CXOuWrRGGVsngHFec75IK5YMCuQrPFkzQBAjlxz0sjCLW+q+jKk0UYz7cpJsaNJxNS/y917OyHVFlZUrxM4Q+wN1iZGA94mHMdaCor1KLS2aIj+U4qP1BuABHA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(366004)(39860400002)(346002)(136003)(33430700001)(66476007)(316002)(7696005)(76116006)(55016002)(86362001)(9686003)(8936002)(6636002)(33440700001)(8676002)(5660300002)(26005)(2906002)(4326008)(66556008)(52536014)(186003)(6506007)(110136005)(66946007)(66446008)(64756008)(53546011)(33656002)(71200400001)(478600001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: gjRIPT4BJDA9hQSO8gcKRQUR/IM4N0ETZ25prHZDaJZZLVqi5qS4ovCUh1xu5EpGX/QaEn92S5JtazlnC88clrtfPB0J3r/0coyzf2aPcMF1X7Kdb8KqvsyRXZjZ5Cwv03oLVE3/YB5bb4NbsD6L8AlSSH0Sd+fJ8JWa3Dw7YdRiu9yekuDWTklSqrORub8GRI+zKh6E1fcjI31bvmT480QzbYYw2nA6YKIJLQAT4gE/pzFoegN2FJ/aoB3WhSHTkSF+TcO5jqI1nhcwi0g2si1SmyT2p4ZVSHzR8TeTEyHKUA9dsN+YH0SVzGqmyivEVNKW+txMZ7LvXJ0VQM4og168mL7fvrOU4C/u0euitQwxSYuCsZdxwI4+zzSgEYyxKhvUr9ImYg2jO3KIV37tGmIxr7gWam5wOvgbJ+BAKoXUeWhVUle/wkG0HmWHiIkxhIDPpk0mdvuIJd4IkOqtiY7vJZuU4U74CV95LsrY6roPl8f+K+YmNcpMJ1Psp0fN 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: 4f0f0673-3b13-4334-7350-08d7f5b725ff X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2020 14:25:25.9940 (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: aogqrMqU4k+T3kTIpmKKknrTKHkzejNrBrKsXjDFI5Dc5T8l1Ii5z1j/2BNP2gXsHNlHAuqeoJWBdbhPZr/Zpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4226 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: support match on GTP flags 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, > -----Original Message----- > From: Dekel Peled > Sent: Wednesday, May 6, 2020 8:14 PM > To: Matan Azrad ; Slava Ovsiienko > ; Raslan Darawsheh > Cc: dev@dpdk.org > Subject: [PATCH] net/mlx5: support match on GTP flags >=20 > This patch adds to MLX5 PMD the support of matching on > GTP header item v_pt_rsv_flags. >=20 > This item is contained in 1 byte of the format: > ------------------------------------------- > | bit | 0 - 2 | 3 | 4 | 5 | 6 | 7 | > |-----------------------------------------| > | value | Version | PT | Res | E | S | PN | > ------------------------------------------- >=20 > Matching is supported only for GTP flags E, S, PN. > Therefore values 0 to 7 are supported. >=20 > Mask must be set accordingly: > ... gtp v_pt_rsv_flags is 1 v_pt_rsv_flags mask 0x07 ... >=20 > Signed-off-by: Dekel Peled > Acked-by: Matan Azrad > --- > doc/guides/nics/mlx5.rst | 1 + > doc/guides/rel_notes/release_20_05.rst | 1 + > drivers/net/mlx5/mlx5_flow_dv.c | 23 +++++++++++++++++++++++ > 3 files changed, 25 insertions(+) >=20 > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > index c4bc77c..f561683 100644 > --- a/doc/guides/nics/mlx5.rst > +++ b/doc/guides/nics/mlx5.rst > @@ -162,6 +162,7 @@ Limitations >=20 > - Match on GTP tunnel header item supports the following fields only: >=20 > + - v_pt_rsv_flags: E flag, S flag, PN flag > - msg_type > - teid >=20 > diff --git a/doc/guides/rel_notes/release_20_05.rst > b/doc/guides/rel_notes/release_20_05.rst > index 2f60e67..8bab5a3 100644 > --- a/doc/guides/rel_notes/release_20_05.rst > +++ b/doc/guides/rel_notes/release_20_05.rst > @@ -144,6 +144,7 @@ New Features > * Removed flow rules caching for memory saving and compliance with > ethdev API. > * Optimized the memory consumption of flow. > * Added support for flow aging based on hardware counter. > + * Updated support for matching on GTP header, added match on GTP > flags. >=20 > * **Updated the AESNI MB crypto PMD.** >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index aa5c353..e5e656f 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -1639,6 +1639,18 @@ struct field_modify_info modify_tcp[] =3D { > return 0; > } >=20 > +/* > + * GTP flags are contained in 1 byte of the format: > + * ------------------------------------------- > + * | bit | 0 - 2 | 3 | 4 | 5 | 6 | 7 | > + * |-----------------------------------------| > + * | value | Version | PT | Res | E | S | PN | > + * ------------------------------------------- > + * > + * Matching is supported only for GTP flags E, S, PN. > + */ > +#define MLX5_GTP_FLAGS_MASK 0x07 > + > /** > * Validate GTP item. > * > @@ -1661,8 +1673,10 @@ struct field_modify_info modify_tcp[] =3D { > struct rte_flow_error *error) > { > struct mlx5_priv *priv =3D dev->data->dev_private; > + const struct rte_flow_item_gtp *spec =3D item->spec; > const struct rte_flow_item_gtp *mask =3D item->mask; > const struct rte_flow_item_gtp nic_mask =3D { > + .v_pt_rsv_flags =3D MLX5_GTP_FLAGS_MASK, > .msg_type =3D 0xff, > .teid =3D RTE_BE32(0xffffffff), > }; > @@ -1682,6 +1696,11 @@ struct field_modify_info modify_tcp[] =3D { > "no outer UDP layer found"); > if (!mask) > mask =3D &rte_flow_item_gtp_mask; > + if (spec && spec->v_pt_rsv_flags & ~MLX5_GTP_FLAGS_MASK) > + return rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_ITEM, > item, > + "Match is supported for GTP" > + " flags only"); > return mlx5_flow_item_acceptable > (item, (const uint8_t *)mask, > (const uint8_t *)&nic_mask, > @@ -7047,6 +7066,10 @@ struct field_modify_info modify_tcp[] =3D { > return; > if (!gtp_m) > gtp_m =3D &rte_flow_item_gtp_mask; > + MLX5_SET(fte_match_set_misc3, misc3_m, gtpu_msg_flags, > + gtp_m->v_pt_rsv_flags); > + MLX5_SET(fte_match_set_misc3, misc3_v, gtpu_msg_flags, > + gtp_v->v_pt_rsv_flags & gtp_m->v_pt_rsv_flags); > MLX5_SET(fte_match_set_misc3, misc3_m, gtpu_msg_type, gtp_m- > >msg_type); > MLX5_SET(fte_match_set_misc3, misc3_v, gtpu_msg_type, > gtp_v->msg_type & gtp_m->msg_type); > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh