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 08E8EA04BA; Mon, 5 Oct 2020 11:41:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D43DD1B7C0; Mon, 5 Oct 2020 11:41:10 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id 8DC5D1B76B for ; Mon, 5 Oct 2020 11:41:07 +0200 (CEST) Received: from HKMAIL103.nvidia.com (Not Verified[10.18.92.100]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 05 Oct 2020 17:41:06 +0800 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 5 Oct 2020 09:41:05 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.57) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 5 Oct 2020 09:41:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hyxPWveyRr2daGViK9LmacZ6pq1caX8QdkDpm/p8E9RroPvoTwk0AG1NqcePp+ovWAlRWGRYRKXxiOcdDJV4ZpVcpWE3p1FJB+y2Mrz1/Hj9ybMG6KJ0el8+ecaGOD05tGf3x+YDfEs271Cy/oopihvW+bE6ckncRednS8AqYA/8jTu4brKWj0DKAaVf4sbEedG67mVH6fAgWX4xggd14llojh3VpaqJ1Gb/fJNOlsP6Z2NUcRZQHxhYFGmDEu42vBF7pIbZ9YOtiIlWiebuP5bY+W5owT9rWxg2P2eylVJvcB0Rur9ykLwX2dFDC0/ofjkVlZcwx89V7RQXUzH/Ew== 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=QRhn6zQavt55Av0qb3/uipMGktGb2yXmKnW90hK565g=; b=T7rJkiCyUAqvnTECUWBSAKjDX/VQk9Bc5MyKqBJkPWr8i975K8kdZx3/XeTp2k6lVEzHPrIaujSiXVSrJqbOE4w5suwOolRSAsHGVy06xmbh7HNw9KfMzDuYivtCr0Heen441bXoie0ArtV2JYWOxPMJTVwB5tx19zfFwzenUv+mEWT6dUkiYNr86coi/MbtTAqR7L1kNrmTndc713mYDDvdXoeVUs48z99xWJ2Il422YI/91HICxAYkNQmOyq9NYTil+LHzuMxfiQQjOiPHiEOqvpbcxo/iYlNDVeVqZDJ7loniDpkmo/N18vFztgIQpUASYlLchftFab9BkoLo9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB4090.namprd12.prod.outlook.com (2603:10b6:5:217::11) by DM6PR12MB3003.namprd12.prod.outlook.com (2603:10b6:5:38::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Mon, 5 Oct 2020 09:41:03 +0000 Received: from DM6PR12MB4090.namprd12.prod.outlook.com ([fe80::8c42:6852:1b18:13ad]) by DM6PR12MB4090.namprd12.prod.outlook.com ([fe80::8c42:6852:1b18:13ad%7]) with mapi id 15.20.3433.044; Mon, 5 Oct 2020 09:41:03 +0000 From: Li Zhang To: Ori Kam , Dekel Peled , "Slava Ovsiienko" , Matan Azrad CC: "dev@dpdk.org" , NBU-Contact-Thomas Monjalon , Raslan Darawsheh Thread-Topic: [dpdk-dev] [PATCH v4 1/1] net/mlx5: support match ICMP identifier fields Thread-Index: AQHWmJfOzBxOhbr75kq2HIUWoE8sXqmHWl4AgAFlbzCAAAYTUA== Date: Mon, 5 Oct 2020 09:41:03 +0000 Message-ID: References: <20200930164734.23675-1-lizh@nvidia.co> <20201002084059.4049-1-lizh@nvidia.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [172.105.113.100] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 53534116-f2bb-4bbb-8167-08d86912c6b0 x-ms-traffictypediagnostic: DM6PR12MB3003: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: J0YTUaOjPUXHoTdVQdm2AFoNiXMs9Tnsq9noS6wqyRsveLeVdH+IxDxTaSy/GhuAdAKUKHiYP6Yjkc5WaZrC7RQAVOMVHpmaZZxBCxfa2lF6ezBD4QXEqQHRjysxTTFSUYqktfGlfq5ctbC858oZyeLOEy/XTf7V/Ck4nd9TwmS+v2oryeaj1et6MuF3Di7lFspJtWlT5qfxrBc2Qki+lpBsvHh58BCFskFDdhEn/Ay/a8r5OVdaUpObKVXwMBUQyj/2wlQ6++fOLpdXKG/40FITrWolxSoCbARidOg8+GJd8lmKqXpiGxz4bgMVM2FlA1OCqIHVfCTAJevctZFYMosDmLj8zGTzDqzIIcoP/U70pYs7lhBdBbcQ/Fv3aNn2gFLURjmTl4Zr0/duW0dKd2wP4fFJVAFLVRCX63FQ00S1OPl170SxCfECV4l9viJ+d0jvLjHTOtrFzqgNVLaHEw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4090.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(366004)(136003)(396003)(39860400002)(52536014)(76116006)(86362001)(5660300002)(2940100002)(2906002)(54906003)(7696005)(316002)(110136005)(83080400001)(4326008)(8936002)(83380400001)(107886003)(53546011)(6506007)(26005)(55016002)(33656002)(9686003)(186003)(478600001)(966005)(71200400001)(66476007)(66446008)(66556008)(66946007)(64756008)(6636002)(137570200002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: NXOjqHasqz2NhsrgRdhMeRIzAFDD44yTjnfIESew7yNfxyyTnbE+kJvhHF21yrUYTg3E7Wl4mSR97JQRtsT7g5yWp+9e2CKrP1KOXiPUn+/hjIuNJM3bS4qAS7aE12+VkSexbaN+wnn74o/01dpeN9t+jIIIAdWUGSB+sotQmNF1kjtMtRB4gGXsFNFFC+kehaeQodTwChBclS5cTS9HPKam5hd5m5+sWUQtezYKNDs8Q2oU6NUKiUSjsgeGDxJJpfgKuQHwPJeEJsCQKhY/pEfA1+pbm4o8YaP9lMBjq3dCtQNybKvMvwG9fLSNOa0S5rEvIDqqL18YF/56S5afX0oIpIs8rl5C8QejhVzpYHkBqcsyw85YcC997yCa4C6K3KogEhsmaFX2blWi+y9E8uOXZWFfk7xPBjK+jvk3sgC8s22Oqsc4icae0gXknJEDHRLPRwLRgO8plwZE+VSI0HfB5eXHwPVnvnQrLAUki1jumwFdR7Ol7CAxpxCe/gJuqJdYMqtVDox7CkCroGrint01JUBvfddLLbR8JE10mjnLZT9FnVFilcs82sy3dVepbAQlk4PEBQ/ibWVhxGddyJ5nVgD39tndvhTyMeFByxaiNR1cKtIMY1tjTqnBM8Lk4Q4/wc+Lb5+I1c/qnd+MAg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4090.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53534116-f2bb-4bbb-8167-08d86912c6b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2020 09:41:03.5225 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UvsrpuHnXCMhYrEhWE8xXuRo4jTdkkm279214ysBUVQLW/xFzgmhWaH3uy/B+Fwf X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3003 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601890866; bh=QRhn6zQavt55Av0qb3/uipMGktGb2yXmKnW90hK565g=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=iVbnaIerXwf50yhYbW1XYJ28YZ5tSIsCGjvIi0pDanz3fsJOBghbOfgifNmmtZQfz 7KwcryVJTPzf1KVhmy1Vo/XYgNzBRsB0klTu1gAG8P/syNUW5c0pL2ZIOsJjjebwcs QOYggCwvFYQ5lgP7KuFUhsdOOZ9+8FLpT1nWlB7XeDWbfTcaxCsPAyRdLj0IxgIDH8 B+Tqu4UnttEI+NZF3312zx0G677JKklv6cDWxRebVtqeXQTlhqinrQoNsaf5QICnU9 VAJ7wnBeFSJk7TNZ6bhISsPGG+QEwkccSzBX3vaNMMXI8EPoxB4VrMLWYsjuk5tugU tRWhEMTt9LhsA== Subject: Re: [dpdk-dev] [PATCH v4 1/1] net/mlx5: support match ICMP identifier fields 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 Qri, Please help review the new patch V6 https://patchwork.dpdk.org/patch/79613/ Regards, Li Zhang > -----Original Message----- > From: Li Zhang > Sent: Monday, October 5, 2020 5:20 PM > To: Ori Kam ; Dekel Peled ; Slava > Ovsiienko ; Matan Azrad > Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon > ; Raslan Darawsheh > Subject: RE: [dpdk-dev] [PATCH v4 1/1] net/mlx5: support match ICMP > identifier fields >=20 > Hi Qri, >=20 > Thanks for your comments. > I will update it in V5 patch. > Please help review it to make sure I got your point. >=20 > Regards, > Li Zhang >=20 > > -----Original Message----- > > From: Ori Kam > > Sent: Sunday, October 4, 2020 7:59 PM > > To: Li Zhang ; Dekel Peled ; Slava > > Ovsiienko ; Matan Azrad > > Cc: dev@dpdk.org; NBU-Contact-Thomas Monjalon > ; > > Raslan Darawsheh > > Subject: RE: [dpdk-dev] [PATCH v4 1/1] net/mlx5: support match ICMP > > identifier fields > > > > Hi Li > > > > PSB > > > > Best, > > Ori > > > -----Original Message----- > > > From: dev On Behalf Of Li Zhang > > > Sent: Friday, October 2, 2020 11:41 AM > > > Subject: [dpdk-dev] [PATCH v4 1/1] net/mlx5: support match ICMP > > > identifier fields > > > > > > PRM expose fields "Icmp_header_data" in IPv4 ICMP. > > > Update ICMP mask parameter with ICMP identifier and sequence number > > > fields. > > > ICMP sequence number spec with mask, Icmp_header_data low 16 bits > > > are > > set. > > > ICMP identifier spec with mask, Icmp_header_data high 16 bits are set= . > > > > > > Signed-off-by: Li Zhang > > > --- > > > doc/guides/nics/mlx5.rst | 4 ++-- > > > doc/guides/rel_notes/release_20_11.rst | 2 +- > > > drivers/net/mlx5/mlx5_flow.c | 10 ++++++++-- > > > drivers/net/mlx5/mlx5_flow_dv.c | 24 ++++++++++++++++++++++-- > > > 4 files changed, 33 insertions(+), 7 deletions(-) > > > > > > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > > > index 211c0c5a6c..576dbe5efd 100644 > > > --- a/doc/guides/nics/mlx5.rst > > > +++ b/doc/guides/nics/mlx5.rst > > > @@ -288,7 +288,7 @@ Limitations > > > - The input buffer, providing the removal size, is not validated. > > > - The buffer size must match the length of the headers to be remov= ed. > > > > > > -- ICMP/ICMP6 code/type matching, IP-in-IP and MPLS flow matching > > > are all > > > +- ICMP(code/type/identifier/sequence number) / ICMP6(code/type) > > > +matching, > > > IP-in-IP and MPLS flow matching are all > > > mutually exclusive features which cannot be supported together > > > (see :ref:`mlx5_firmware_config`). > > > > > > @@ -1009,7 +1009,7 @@ Below are some firmware configurations listed. > > > > > > FLEX_PARSER_PROFILE_ENABLE=3D1 > > > > > > -- enable ICMP/ICMP6 code/type fields matching:: > > > +- enable ICMP(code/type/identifier/sequence number) / > > > +ICMP6(code/type) > > > fields matching:: > > > > > > FLEX_PARSER_PROFILE_ENABLE=3D2 > > > > > > diff --git a/doc/guides/rel_notes/release_20_11.rst > > > b/doc/guides/rel_notes/release_20_11.rst > > > index c6642f5f94..791f133d8f 100644 > > > --- a/doc/guides/rel_notes/release_20_11.rst > > > +++ b/doc/guides/rel_notes/release_20_11.rst > > > @@ -73,7 +73,7 @@ New Features > > > * Added flag action. > > > * Added raw encap/decap actions. > > > * Added VXLAN encap/decap actions. > > > - * Added ICMP and ICMP6 matching items. > > > + * Added ICMP(code/type/identifier/sequence number) and > > > ICMP6(code/type) matching items. > > > * Added option to set port mask for insertion/deletion: > > > ``--portmask=3DN`` > > > where N represents the hexadecimal bitmask of ports used. > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > > b/drivers/net/mlx5/mlx5_flow.c index 416505f1c8..3cabfd4627 100644 > > > --- a/drivers/net/mlx5/mlx5_flow.c > > > +++ b/drivers/net/mlx5/mlx5_flow.c > > > @@ -1303,6 +1303,12 @@ mlx5_flow_validate_item_icmp(const struct > > > rte_flow_item *item, > > > struct rte_flow_error *error) { > > > const struct rte_flow_item_icmp *mask =3D item->mask; > > > + const struct rte_flow_item_icmp nic_mask =3D { > > > + .hdr.icmp_type =3D 0xff, > > > + .hdr.icmp_code =3D 0xff, > > > + .hdr.icmp_ident =3D RTE_BE16(0xffff), > > > + .hdr.icmp_seq_nb =3D RTE_BE16(0xffff), > > > + }; > > > const int tunnel =3D !!(item_flags & MLX5_FLOW_LAYER_TUNNEL); > > > const uint64_t l3m =3D tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 : > > > MLX5_FLOW_LAYER_OUTER_L3_IPV4; > > @@ -1325,10 +1331,10 @@ > > > mlx5_flow_validate_item_icmp(const struct rte_flow_item *item, > > > RTE_FLOW_ERROR_TYPE_ITEM, > > > item, > > > "multiple L4 layers not supported"); > > > if (!mask) > > > - mask =3D &rte_flow_item_icmp_mask; > > > + mask =3D &nic_mask; > > > ret =3D mlx5_flow_item_acceptable > > > (item, (const uint8_t *)mask, > > > - (const uint8_t *)&rte_flow_item_icmp_mask, > > > + (const uint8_t *)&nic_mask, > > > sizeof(struct rte_flow_item_icmp), error); > > > if (ret < 0) > > > return ret; > > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > > > b/drivers/net/mlx5/mlx5_flow_dv.c index 3819cdb266..a0b78934fd > > > 100644 > > > --- a/drivers/net/mlx5/mlx5_flow_dv.c > > > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > > > @@ -7378,6 +7378,14 @@ flow_dv_translate_item_icmp(void *matcher, > > void > > > *key, { > > > const struct rte_flow_item_icmp *icmp_m =3D item->mask; > > > const struct rte_flow_item_icmp *icmp_v =3D item->spec; > > > + const struct rte_flow_item_icmp nic_mask =3D { > > > + .hdr.icmp_type =3D 0xff, > > > + .hdr.icmp_code =3D 0xff, > > > + .hdr.icmp_ident =3D RTE_BE16(0xffff), > > > + .hdr.icmp_seq_nb =3D RTE_BE16(0xffff), > > > + }; > > > > This is incorrect, like before, you are changing existing app behavior. > > Think about it this way, until now the app didn't place any mask so he > > just matched on the rte_default now with our new version all the > > matching will fail. Since you are adding more must fields. > > > > > + uint32_t icmp_header_data_m =3D 0; > > > + uint32_t icmp_header_data_v =3D 0; > > > void *headers_m; > > > void *headers_v; > > > void *misc3_m =3D MLX5_ADDR_OF(fte_match_param, matcher, @@ - > > 7396,8 > > > +7404,14 @@ flow_dv_translate_item_icmp(void *matcher, void *key, > > > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, > > > IPPROTO_ICMP); > > > if (!icmp_v) > > > return; > > > - if (!icmp_m) > > > - icmp_m =3D &rte_flow_item_icmp_mask; > > > + if (!icmp_m) { > > > + icmp_m =3D &nic_mask; > > > + icmp_header_data_m =3D UINT32_MAX; > > > > Please see comment above. > > > > > + } else { > > > + icmp_header_data_m =3D rte_be_to_cpu_16(icmp_m- > > > >hdr.icmp_seq_nb); > > > + icmp_header_data_m |=3D > > > + rte_be_to_cpu_16(icmp_m->hdr.icmp_ident) << 16; > > > + } > > > /* > > > * Force flow only to match the non-fragmented IPv4 ICMP packets. > > > * If only the protocol is specified, no need to match the frag. > > > @@ -7412,6 +7426,12 @@ flow_dv_translate_item_icmp(void *matcher, > > void > > > *key, > > > icmp_m->hdr.icmp_code); > > > MLX5_SET(fte_match_set_misc3, misc3_v, icmp_code, > > > icmp_v->hdr.icmp_code & icmp_m->hdr.icmp_code); > > > + icmp_header_data_v =3D rte_be_to_cpu_16(icmp_v- > > >hdr.icmp_seq_nb); > > > + icmp_header_data_v |=3D rte_be_to_cpu_16(icmp_v->hdr.icmp_ident) > > > << 16; > > > + MLX5_SET(fte_match_set_misc3, misc3_m, icmp_header_data, > > > + icmp_header_data_m); > > > + MLX5_SET(fte_match_set_misc3, misc3_v, icmp_header_data, > > > + icmp_header_data_v & icmp_header_data_m); > > > } > > > > > > /** > > > -- > > > 2.21.0