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 554F7A054E; Sun, 8 Mar 2020 12:33:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D3742BE6; Sun, 8 Mar 2020 12:33:09 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2047.outbound.protection.outlook.com [40.107.20.47]) by dpdk.org (Postfix) with ESMTP id B7A10FEB for ; Sun, 8 Mar 2020 12:33:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vx0jWCM1a9BJHWrCofgTK8vn0eoJ0B80gTY+sVFfM+/isS2NLw6sanOY4NNvK4hSQ7CRkxoBcvaG2hflZSZv/QL6mpBBlQvM3ZU4oytTsGwW3p5m1pfp1iz/AEr+Yp6rf8tlR8O968qJqplE/5pUSsd5wjZq6sypnRjiA6AGBMfYqDj9EQWIe+y4Db87dWqJjFrgVUn3bzxlxjavbtm3qBfnEbcClha62GLYn/uQ1EY3WJ/dvdujO8sO+A3GrbF8J0xyt/v6//ZpKI9WW9StK+S5JtSEw4K99pYMpVBUfFQo8bL6yfp3KJp0X3tYNX4UBSTJJe8khkkgz8Fn46XwdQ== 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=ZNKaIC5Xsw3OWa9s0ULjkbaR+FDZFW/NeKK75xlxZvQ=; b=U1BM3dn7O45kyUJIG+Va8kacEryE1SP39IInCCOwlYuogpy4F+E8bYWqc2nsN6UxQfdJY4nqRSWO9E+zUTNRiu3sy3uJRlCnAXAy57c8uxlKCOKoCPmIUTGSMcCDvzff49vm4Yypp7o/dHvVnYOF8bZB3u4kCK9rNqsnRGuFfhBmby6BwXe8hjvPvubacBTtg07RPpxiugujRfgvNjqLGUjQ9aH56SkWdaub8Ow//19yHHqfRQuk4RIcekceD/e0H+I5UFswklO61xQK9h4FcNM4vPBTexj2k0WGnoGFUwNlUWShcBXkmmAFuejYf6foXN4gqPE2zZtXnXl4ThMKOw== 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=ZNKaIC5Xsw3OWa9s0ULjkbaR+FDZFW/NeKK75xlxZvQ=; b=Q16hdVh5PGQ33VzJqomrNp1CAqwaO7iE+hh+3qvI2D56AXn7GFSsOu//Pu/H5VB1WGGASNLVTpoEdYdfzdUcWrD+675f1tOxKQENJtShL3//SwA2ZRIe7PyHIvikeTwBlTf5983QKq2W9vr3dQT3ePHZRlCd9jydyIHFJlcqWIA= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB4500.eurprd05.prod.outlook.com (52.134.124.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Sun, 8 Mar 2020 11:33:07 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::adbd:45ca:54:bba9]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::adbd:45ca:54:bba9%7]) with mapi id 15.20.2793.013; Sun, 8 Mar 2020 11:33:07 +0000 From: Raslan Darawsheh To: Dekel Peled , Matan Azrad , Slava Ovsiienko CC: "dev@dpdk.org" , Eli Britstein Thread-Topic: [PATCH] net/mlx5: support match on IPv4 TTL and IPv6 HLIM Thread-Index: AQHV8Vil2qtG+wn/HkqoiKwkULiSLKg+l+iA Date: Sun, 8 Mar 2020 11:33:07 +0000 Message-ID: References: In-Reply-To: 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=rasland@mellanox.com; x-originating-ip: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a188a8fe-ade6-4c43-d0e9-08d7c3547968 x-ms-traffictypediagnostic: AM0PR05MB4500:|AM0PR05MB4500: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 03361FCC43 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(39860400002)(346002)(366004)(396003)(199004)(189003)(66556008)(86362001)(66446008)(64756008)(8936002)(33656002)(81166006)(81156014)(8676002)(9686003)(7696005)(478600001)(76116006)(66476007)(66946007)(55016002)(5660300002)(186003)(4326008)(26005)(107886003)(2906002)(6636002)(54906003)(71200400001)(53546011)(6506007)(52536014)(316002)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4500; H:AM0PR05MB6707.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: a0MDHb+6OGHw2GqaWuvaoNfhMX99fko5VuEu2LdGqZEU70eioToP2hSD/IaGHCi8eV0PRr3kqJzvhdqv2BjNk3GjzsaB5equRfmdNGGOXYlIKAdYyvbm0sUv2HZvtcKRfKPQrn7ORm+9YPL1LFmWicbncQsfahvz8mcYWeuo0xC2UeFmNSyyni+ojWrYf2p1pmbIea8GKfkvbH38F9ds0Y8XiqvIoNyxI2+4hT97KD9jtqRelyvFQJw57JC/Kf9cptnp/3PT5OeIQLjBfPQGgkWsakEQczk70XkJWDfdYp26d/GkWqHamr1wr77xKExfwafJro3ybL2KrhnqGnru1K7fSrNKOaB1Lh9NjpTcXYj4VDYcsKfUH8doz3nV250cGmVggKLc/phvTGMHK8V6l8TnfpxJCeUtJ4kmswvYfgqbXeg+2NuWX/Or1AJOsrMK x-ms-exchange-antispam-messagedata: UAh1+3lyDucidZq4U0BXxvy4mKQWHHAEcm6IdzUH0GSW4ehImD95ro6nXMYz2NpqC9STTNBcojTszPAdJjsQjgi0/IdaHvU2JMOJgUwNhS93R5Xyzbm7nz8QOpowecObQg+1fAbwFbszpH6hWcUWJQ== 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: a188a8fe-ade6-4c43-d0e9-08d7c3547968 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2020 11:33:07.6123 (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: pdeVPiYYKaQKqiMYeC03t8PJwuFXW/2mOd7SKPDDWxIAafYrcCROepZe9efsEwzc4RWWmz6USyDirWmy6LA72g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4500 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: support match on IPv4 TTL and IPv6 HLIM 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: Tuesday, March 3, 2020 2:38 PM > To: Matan Azrad ; Slava Ovsiienko > ; Raslan Darawsheh > Cc: dev@dpdk.org; Eli Britstein > Subject: [PATCH] net/mlx5: support match on IPv4 TTL and IPv6 HLIM >=20 > This patch adds to MLX5 PMD the support of matching on IPv4 TTL and > IPv6 hoplimit. > Support is valid when using DV flow engine (Verbs flow engine doesn't > support matching on this field). >=20 > Signed-off-by: Eli Britstein > Signed-off-by: Dekel Peled > Acked-by: Matan Azrad > --- > doc/guides/rel_notes/release_20_05.rst | 6 +++++ > drivers/common/mlx5/mlx5_prm.h | 3 ++- > drivers/net/mlx5/mlx5_flow_dv.c | 40 > +++++++++++++++++++++++++++++++--- > 3 files changed, 45 insertions(+), 4 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_20_05.rst > b/doc/guides/rel_notes/release_20_05.rst > index 2190eaf..000bbf5 100644 > --- a/doc/guides/rel_notes/release_20_05.rst > +++ b/doc/guides/rel_notes/release_20_05.rst > @@ -56,6 +56,12 @@ New Features > Also, make sure to start the actual text at the margin. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >=20 > +* **Updated Mellanox mlx5 driver.** > + > + Updated Mellanox mlx5 driver with new features and improvements, > including: > + > + * Added support for matching on IPv4 Time To Live and IPv6 Hop Limit. > + >=20 > Removed Items > ------------- > diff --git a/drivers/common/mlx5/mlx5_prm.h > b/drivers/common/mlx5/mlx5_prm.h > index 4ac3d4b..eee3a4b 100644 > --- a/drivers/common/mlx5/mlx5_prm.h > +++ b/drivers/common/mlx5/mlx5_prm.h > @@ -651,7 +651,8 @@ struct mlx5_ifc_fte_match_set_lyr_2_4_bits { > u8 tcp_flags[0x9]; > u8 tcp_sport[0x10]; > u8 tcp_dport[0x10]; > - u8 reserved_at_c0[0x20]; > + u8 reserved_at_c0[0x18]; > + u8 ip_ttl_hoplimit[0x8]; > u8 udp_sport[0x10]; > u8 udp_dport[0x10]; > union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits > src_ipv4_src_ipv6; > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index 2414a97..e7278f0 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -4490,13 +4490,35 @@ struct field_modify_info modify_tcp[] =3D { > const struct rte_flow_action_raw_decap *decap; > const struct rte_flow_action_raw_encap *encap; > const struct rte_flow_action_rss *rss; > - struct rte_flow_item_tcp nic_tcp_mask =3D { > + const struct rte_flow_item_tcp nic_tcp_mask =3D { > .hdr =3D { > .tcp_flags =3D 0xFF, > .src_port =3D RTE_BE16(UINT16_MAX), > .dst_port =3D RTE_BE16(UINT16_MAX), > } > }; > + const struct rte_flow_item_ipv4 nic_ipv4_mask =3D { > + .hdr =3D { > + .src_addr =3D RTE_BE32(0xffffffff), > + .dst_addr =3D RTE_BE32(0xffffffff), > + .type_of_service =3D 0xff, > + .next_proto_id =3D 0xff, > + .time_to_live =3D 0xff, > + }, > + }; > + const struct rte_flow_item_ipv6 nic_ipv6_mask =3D { > + .hdr =3D { > + .src_addr =3D > + "\xff\xff\xff\xff\xff\xff\xff\xff" > + "\xff\xff\xff\xff\xff\xff\xff\xff", > + .dst_addr =3D > + "\xff\xff\xff\xff\xff\xff\xff\xff" > + "\xff\xff\xff\xff\xff\xff\xff\xff", > + .vtc_flow =3D RTE_BE32(0xffffffff), > + .proto =3D 0xff, > + .hop_limits =3D 0xff, > + }, > + }; > struct mlx5_priv *priv =3D dev->data->dev_private; > struct mlx5_dev_config *dev_conf =3D &priv->config; > uint16_t queue_index =3D 0xFFFF; > @@ -4563,7 +4585,8 @@ struct field_modify_info modify_tcp[] =3D { > &item_flags, &tunnel); > ret =3D mlx5_flow_validate_item_ipv4(items, > item_flags, > last_item, > - ether_type, NULL, > + ether_type, > + &nic_ipv4_mask, > error); > if (ret < 0) > return ret; > @@ -4588,7 +4611,8 @@ struct field_modify_info modify_tcp[] =3D { > &item_flags, &tunnel); > ret =3D mlx5_flow_validate_item_ipv6(items, > item_flags, > last_item, > - ether_type, NULL, > + ether_type, > + &nic_ipv6_mask, > error); > if (ret < 0) > return ret; > @@ -5421,6 +5445,7 @@ struct field_modify_info modify_tcp[] =3D { > .dst_addr =3D RTE_BE32(0xffffffff), > .type_of_service =3D 0xff, > .next_proto_id =3D 0xff, > + .time_to_live =3D 0xff, > }, > }; > void *headers_m; > @@ -5470,6 +5495,10 @@ struct field_modify_info modify_tcp[] =3D { > ipv4_m->hdr.next_proto_id); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, > ipv4_v->hdr.next_proto_id & ipv4_m->hdr.next_proto_id); > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_ttl_hoplimit, > + ipv4_m->hdr.time_to_live); > + MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit, > + ipv4_v->hdr.time_to_live & ipv4_m->hdr.time_to_live); > /* > * On outer header (which must contains L2), or inner header with L2, > * set cvlan_tag mask bit to mark this packet as untagged. > @@ -5583,6 +5612,11 @@ struct field_modify_info modify_tcp[] =3D { > ipv6_m->hdr.proto); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, > ipv6_v->hdr.proto & ipv6_m->hdr.proto); > + /* Hop limit. */ > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_ttl_hoplimit, > + ipv6_m->hdr.hop_limits); > + MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit, > + ipv6_v->hdr.hop_limits & ipv6_m->hdr.hop_limits); > /* > * On outer header (which must contains L2), or inner header with L2, > * set cvlan_tag mask bit to mark this packet as untagged. > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh