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 1FC99A054F; Tue, 18 Feb 2020 15:20:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F8901C11F; Tue, 18 Feb 2020 15:20:34 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2048.outbound.protection.outlook.com [40.107.20.48]) by dpdk.org (Postfix) with ESMTP id B05A91C11F; Tue, 18 Feb 2020 15:20:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ao1z9M3tKfJOwnfeiDgmw9g8FBWJIxIqKy6UTkBtke6x+Ja4qbvsf+TLMGRR/7L0FaCidPJfQSuuHjY1q205XOEzigR2bWfE3OqFzRdtSw48RWMXfp8ddzdNlhugA9C7DLBi+UJjvXj8yZ7QoHELZgFwLmog/74LpcNC4grv6LWrbHEsTF633Sa5wPTZn9hpu+p3u1KwIAerauBcb0nKFgoZmUwmXj3tjMv7BYQ+EvAnkzNJGoa3tzpa1166zSmkBbIkULboeO7Tvcj08vtzBmTYn/8lpOBojaFUtEXULFWXVvxvWE2s7QOHZVdlvwU56wyobA96R2A46Bm3O2oHWA== 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=NHl4xDr9YI/KaX22MkGAETd658EZDWd94RtyERCoKqk=; b=YxnrlRa3ZVGiIMK8lu22rUVHUr7yMqVEd5NLhhooreRnnCWxayM9Tmc89szG5f3S3MX8dhRoeAlp5zZ4q4CJuGmRPx5Wm0LCb+7SIcV9V6ksJ3RSZsLdzyd/Ovx8CHxigCJCU7oQNMomljKdHYVZpeRMDUuxyTDOLKMuwt2geRJOXMfvhxUmddCOMOdLkiyBVvSCtBdSxjstzXZ02tDeQVGC9C0trSEhwP3Pl143Z6LJfWZ/4oEBQnnaRwtmDb0FWOYl5bDaP55DtJLuixdFI9tDFcxhxs+4Lexexkc6Qz/O8VT1Mz+/oLc8SaroJBfrKjbZ5DsnGbnJMpptMSSxdQ== 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=NHl4xDr9YI/KaX22MkGAETd658EZDWd94RtyERCoKqk=; b=bZmjjRqTSVNKUu72u6Iz2o/zHcYmbXPvANWJZp5T8fLGZR/6oRK+ZnRFckw2cCjocJPOim/y3VvNIR68PmNE0y24lJFovCgpTL6y3z8c1uBY9AXCbcYl1Vz7CJuFyzElgBzh9/YPdmh6SOisty4re+e1zJxIY0fBNbrvte0Dj/g= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB6116.eurprd05.prod.outlook.com (20.178.202.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Tue, 18 Feb 2020 14:20:32 +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.2750.016; Tue, 18 Feb 2020 14:20:31 +0000 From: Raslan Darawsheh To: Bing Zhao , Ori Kam , Slava Ovsiienko CC: Matan Azrad , "dev@dpdk.org" , Jack Min , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix the matching for ICMP fragments Thread-Index: AQHV5ZwhXa236amMqkm+yokJjgFnL6ghAYdw Date: Tue, 18 Feb 2020 14:20:31 +0000 Message-ID: References: <1581948655-2491-1-git-send-email-bingz@mellanox.com> In-Reply-To: <1581948655-2491-1-git-send-email-bingz@mellanox.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=rasland@mellanox.com; x-originating-ip: [212.29.221.74] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 888fff32-0d15-4814-3bca-08d7b47db655 x-ms-traffictypediagnostic: AM0PR05MB6116:|AM0PR05MB6116: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 031763BCAF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(199004)(189003)(2906002)(71200400001)(9686003)(33656002)(55016002)(478600001)(316002)(6636002)(6506007)(186003)(66946007)(66446008)(8936002)(110136005)(66556008)(64756008)(8676002)(81166006)(54906003)(7696005)(5660300002)(450100002)(81156014)(86362001)(4326008)(52536014)(26005)(66476007)(76116006)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB6116; 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: suMfxEKWQjo4LIhlbTKxoiQWMGKgWTQS7LTJX+Vc7FXINyp2gj9I28t9rV1iNq0sSbhdgQ5AiEE5vuQlZ4PuzmDQ+btJGe+Nz69ZoHzedfKB4OX5c4V7LQdWVHknigAoook0z4YgNU3NXkZcPrx4Nbz0G0opk9D4b1vIDOZEKfyc+hHX6jqigdsnVCCB2LF60H2QHxnc9rLeChngR8EUUCVCPr3jV2gS+CtYiRH+QiMbnnq65jPZTkqwmtEGImVc9o/HqxtL0+8CwM67EYc7o9+yS7Q4cdK223DdMHw9i/lm1IbSkAqEFlnV+Dl4xd1K/HDYKnnGu0aJ4Rqy3niuykTHlrdCpyVl7wVKEusKUiCZwxkmPe3wmCqT5CD+Cxud8dHKXcKpf4s/9NUWJC9bmbmrLuhwPbvGWdIXHv/2kbDU5al/gGdnH18c9QwMMaA7 x-ms-exchange-antispam-messagedata: F9jYBQHVBH4njFz3pZQst801vxKrwmOhrE05mlOoC9V7V+Y5rf0S90r/V0b5HjYO11nG3gSSIap75uduNjK/PRleGWcdoTchhMLjs9owrc4Johp7SdGYGbkYkVN6v09PRk/m1gfVqyUl+Jb9nQufMQ== 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: 888fff32-0d15-4814-3bca-08d7b47db655 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2020 14:20:31.6188 (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: GHODhni6MbX4mQaWUkdqkITVVFpIBnMAbKS2EAInqs6tlTrfcYwS/4VDAh5VuPWiaiW1HINvuIsSG5H4Csr0Kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6116 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix the matching for ICMP fragments 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: Bing Zhao > Sent: Monday, February 17, 2020 4:11 PM > To: Ori Kam ; Slava Ovsiienko > > Cc: Raslan Darawsheh ; Matan Azrad > ; dev@dpdk.org; Jack Min > ; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix the matching for ICMP fragments >=20 > The hardware can recognize and mark the layer 4 protocol type for TCP, > UDP and IPSec non-fragmented packets. For all the fragmented packets, > L4 type will be considered as None. This can be used when creating a > flow with L4 matching, then hops number will be reduced and a better > performance could be gained. >=20 > But for ICMP packets, it cannot be recognized correctly because it is > not a L4 protocol in the stack, even if the packet format is similar. >=20 > All the fragmented and non-fragmented ICMP will have the None L4 type. > Fragmented packets with incomplete headers could not hit the flow, > even for the first fragment. Because then it will make it complex to > defragment for both HW and SW. For other types, the implicit rules > could be used directly and all the fragments will miss the flow. >=20 > For ICMP packets, this should be done explicitly because all packets > have None type. The first fragment will still hit the flow if there is > no explicit rule. >=20 > All ICMP fragments will still hit the rules like ETH, ETH + IP, and > ETH + IP + "ICMP protocol" only since they are wildcard rules, and > there is no next layer protocol specified field in such rules. >=20 > Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6") > Cc: jackmin@mellanox.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Bing Zhao > --- > drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index a9bb0b4..0e31c69 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -6403,6 +6403,12 @@ struct field_modify_info modify_tcp[] =3D { > return; > if (!icmp6_m) > icmp6_m =3D &rte_flow_item_icmp6_mask; > + /* > + * Force flow only to match the non-fragmented IPv6 ICMPv6 > packets. > + * If only the protocol is specified, no need to match the frag. > + */ > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, frag, 1); > + MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, 0); > MLX5_SET(fte_match_set_misc3, misc3_m, icmpv6_type, icmp6_m- > >type); > MLX5_SET(fte_match_set_misc3, misc3_v, icmpv6_type, > icmp6_v->type & icmp6_m->type); > @@ -6450,6 +6456,12 @@ struct field_modify_info modify_tcp[] =3D { > return; > if (!icmp_m) > icmp_m =3D &rte_flow_item_icmp_mask; > + /* > + * Force flow only to match the non-fragmented IPv4 ICMP packets. > + * If only the protocol is specified, no need to match the frag. > + */ > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, frag, 1); > + MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, 0); > MLX5_SET(fte_match_set_misc3, misc3_m, icmp_type, > icmp_m->hdr.icmp_type); > MLX5_SET(fte_match_set_misc3, misc3_v, icmp_type, > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh