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 7B7F3A054F; Tue, 18 Feb 2020 10:05:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 56E7C1D667; Tue, 18 Feb 2020 10:05:54 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2076.outbound.protection.outlook.com [40.107.20.76]) by dpdk.org (Postfix) with ESMTP id 19A911BF78; Tue, 18 Feb 2020 10:05:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kbo2SQjBiQPQQRa5vL+nxlTr0C5Ro+E+6rrkjMYYGIZ7beZFFrKwpkwLJepc2pTJcjFzDHBpx5LVfSSNwXzQ4bKnRgS0JRMZSkvoMBFLLoUDFZoJszzhaycoVS01XgUV3mMcG/Sd7C60KdjHI23yuOYPErwsRGxFzFNB80eyiCV+OvzLhVsGZZ1KUnFgu6fSOh/bSx2ldFUmGuBWH4rz+BOSRQvh2+ah6BeQvSqmAna6iom8jQOHdUXdCWMlROhNJ+b2WsqZX9YCufIDETKL55TwZHFC8Uw5SkNYx7THgCcljoJ3jFUEMmfmhbtN3BIdD1lYnqTBapgqJVbMZSDg7Q== 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=9mj210VXkDlIvGPdqzhVIpLqPtxaNXonm43gH++4vyY=; b=PuwLxkA+84fyA0fGMKwBWsVdqMr8qL5tfhyhseef3NJtjEG53z/dG3oj8Y5P6hPDdn4WFklWkkFcTQgoFRm/JjI7apN148eynCS5eGqxBxRi38mTqd2vHHn5kIPO7wyBx1hc5o8rnopBso6K22fl52Yx+UmZeMfCFpU9RPP1Tan5U5MljPo9it+w7Mc3H4XDmzAsj+z9ODQASWl5VRijezGtmMgwPV28PwPThb7u2dajzoyTn1f9fY/rol19YnGqw1KyqpxKaaKSAVz1QNeJ+/x+lAfSBzaoSuRHjkdPyCUvYERo47qgsDcEWfz6mlhoWpjUdwKiwtCOhQXTlAKbuw== 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=9mj210VXkDlIvGPdqzhVIpLqPtxaNXonm43gH++4vyY=; b=jZNKRqs5k2AhjA31x5gr5Gxvi3fQBNcJkpOsVxU5tRNOXZXIQajBGhpBamQNPDJV5UdKViYA2i7QWiYiWxCpVraedzQTb4gqzWGBbQKrLLd04JAGrTTsXAmlIjW38zV58ynMdnIHIpIofEpywyFKfi/g001aIFWZEVeGECtakOU= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (20.177.196.158) by AM6PR05MB4936.eurprd05.prod.outlook.com (20.177.35.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.29; Tue, 18 Feb 2020 09:05:52 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::1888:dbf5:a84e:c53b]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::1888:dbf5:a84e:c53b%6]) with mapi id 15.20.2729.032; Tue, 18 Feb 2020 09:05:52 +0000 From: Ori Kam To: Bing Zhao , Slava Ovsiienko CC: Raslan Darawsheh , Matan Azrad , "dev@dpdk.org" , Jack Min , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix the matching for ICMP fragments Thread-Index: AQHV5ZwhyAYmrmiCQE2seZi0sgKqlqggqePA Date: Tue, 18 Feb 2020 09:05:52 +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=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: da56d217-a0da-41e5-2016-08d7b451c127 x-ms-traffictypediagnostic: AM6PR05MB4936:|AM6PR05MB4936: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd 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)(366004)(396003)(39860400002)(376002)(136003)(346002)(189003)(199004)(52536014)(110136005)(86362001)(7696005)(478600001)(54906003)(6636002)(6506007)(5660300002)(316002)(186003)(55016002)(71200400001)(81156014)(81166006)(66946007)(66556008)(66446008)(8936002)(64756008)(76116006)(66476007)(9686003)(8676002)(26005)(2906002)(33656002)(4326008)(450100002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4936; H:AM6PR05MB5176.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: QPasP/vHOcI4QrEitKeiWOKkcCq87/wnKbOS0fSUqDsjwy+5H9o+v3HmMwuwl3mwfpUCXNupbXCS73ZEJrdnOPDBp1HdzI1fjh11MKHi+VKT03TFPUaqMtMTItjA8g67yc6+prMbAulPuDWD8mcVQcoGLQbLvaoMv7frr2t4g49jLdHNArUjwMGsskA+qyIFYAvfjQ6OnXYk4SPg/XjonQBxcEWY4xc1juZZA/ui46yYnq+iZ0VtW+PsSNnR7J7600JxO7x5/BV0EUODn/CPF8VIrzRcA8JE2FD68U/W6dXSywHBciLJHn6aIq3uMZYAXnVQw68vFkCDYrLbjhwMWpGhISNmTjreVixj4Hm293FJDXhf80oJTiBBhzNbjw1LhcOXpu1wN9r0xSTiCiEo2DEue4dL2GSXnAH7zZSi9YjpskEqTJBEWqij5ZN78anz x-ms-exchange-antispam-messagedata: R8Lx3m31PgGf0jF5JH6EcvxKLZtU/vPosTmYu7FFBBdQpRTVxV7fiXll2vB2fojoX4NVdUW9tTdqcIk3bAJJlKL+1vjmNTfRPsymSKDQKMsAEHDhe/eZWjuRkk6J7Nip+oq72wnJSNmPFMQ1tqYehQ== 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: da56d217-a0da-41e5-2016-08d7b451c127 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2020 09:05:52.0592 (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: VivgVXRK5/nt6j9oS2/zLjRoF+KbVWaJdwyIVocNDxqS7eySfc4xUlZEcwHtcz/EWYnQzEyjdRDA1cjqUhmyCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4936 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" > -----Original Message----- > From: Bing Zhao > 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 Acked-by: Ori Kam Thanks, Ori > --- > 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