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 9635CA04BA; Mon, 5 Oct 2020 11:21:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 127233256; Mon, 5 Oct 2020 11:21:38 +0200 (CEST) Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by dpdk.org (Postfix) with ESMTP id 5C8522E81 for ; Mon, 5 Oct 2020 11:21:37 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 05 Oct 2020 02:21:22 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 5 Oct 2020 09:20:10 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.175) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 5 Oct 2020 09:20:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nXUSwPuuRmoxTg+gOOOAruKbcaLprcW00xe9FsEJL6+g2FnSB54ZxXVJDn/6fWquy3k8XQoQrvStQrpVnQhBzJaHDkQo+q9n6Ouys4WP6RjGoei3bdgvvelxqoqHbxYI7hAyVcpeFcFDaddT7osyiQXzSDf9P5/DtOseO3HaxiNAQKS8hAyQItDB8qvJ+9qMP4nMBqtrqFz0QvooTowHvKeO7FliVcWjIys/kE7hThL2im3XeDuB6Zr6d1NnMo5zWHlxIIzLwQFpjyivvp1O8Ukwp7AQS0W8dsT2nuXwvTJ3GlmC357T7AZi5QEYlem7ZosPGhdcaoaZY6xnjVQp7Q== 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=NY+KC4IxGOyCQ4fkW+rSKlnl2otxufEMFaktFllEgig=; b=P4RuEPhCEQ5sViM5Q5pbBPvp5Hpx6lmjEiz+lV7JaidwZys7JsaWeSJ6oGkj6LNYYEFFfh8GbcsaijBivnybGXf91pf5rjbVRwcFRVJH3MXp2Ss3cdYGDDFbif8fmaHebr1TGTYNvAzbn/t6Hua20afLU9VNDDmAUcmOIDsm/i9KHWorr/4nWSHN7wGc9Jyg3cl33qdiuGRk/y9Tr+LRoF0JyvKtAm6/ZSg4WcK9V5hh3Fe/LUxPQZL/+UvtBKlNjBNnXqT3gxEEg6n5TkGA8M84HdbIMo+SCh0TnZL0OKfBLSkqTqKFersvDJ2mUmkj69kDXSmrBYQjy6ZHJVJRXQ== 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 DM6PR12MB4331.namprd12.prod.outlook.com (2603:10b6:5:21a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.36; Mon, 5 Oct 2020 09:20:09 +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:20:09 +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: AQHWmJfOzBxOhbr75kq2HIUWoE8sXqmHWl4AgAFlbzA= Date: Mon, 5 Oct 2020 09:20:09 +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: e48b0b69-de4b-4221-c518-08d8690fdb0c x-ms-traffictypediagnostic: DM6PR12MB4331: 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: kzpaARVdX5oWY+6G+cdFMYvAoMfJDNGYY/YsIU2aDzpjLenevF5Uq5E6BEOZtpsWOtUcW8mIN9SyPjgx/zcfyAhq8xSgFkHcl10HLmrjrKbP4VMAe2ZQwx2aV1rls/RbDi1PlLcvrNAqdRTRUb5ydHZ2FzAov6OR8MggSL8vFr7ksjF7dFzr7mmY0+PxDoXMFMHr3UGn3GrwX9blIdrE3uJeZ2azZSUZijstQx4khWrS+Q6tf72ivI2HhC6c4clOGNPuSXTcmKYSaZel/JfUoU+6Ig5nEkKweUu0jDi2nziNVhV8h98dtr2sqE+FMl2G9Q63lmnYNsIiPPp5eqyw+EDA1n/P2mIzu0yRRjZzvme4KQ2wdoV1ZbXQFypNRdci 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)(376002)(396003)(39860400002)(366004)(346002)(136003)(4326008)(76116006)(107886003)(66446008)(66476007)(186003)(66946007)(52536014)(6636002)(316002)(9686003)(86362001)(2906002)(66556008)(64756008)(54906003)(110136005)(33656002)(26005)(478600001)(8936002)(5660300002)(55016002)(6506007)(53546011)(7696005)(71200400001)(83380400001)(137570200002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: lw69N4NVapWPmZMcd/HVwva57nAFCjYtRVcg8zao0VCsnK41Gz+8EviEzwyIpKbyy85gKWb9JPiXoH24htpdstq0yda6WzFQVnp9N7b2pJd+NmmxK6RDP6nS4IQJDi8fcBivU7Eylz085Z2e+kikxW9EFyT2aKF13ygqlLNpjMTVerp46NFJfWqgS6zb3vkCmU/YjGqQg/jpgEdW4ATAPXk2cv06YVDNKzTLBCr/tAfWbsQw0bccKE/t7Q4cG0fVAD4RT1S8HQYLu7Ojwi/bu5MHc6sh8aiAuLkcDOQrQG9Sgla0hRZwo+HCCi4vLnlD3ndfV5Oz6M4OjH9XPItHDb+w9EkOZR81kekJhHT0qoLeF5i8hv6+OzLOuaHDZYYCMHsswr0QtYDLTlgzvt76uuBX44pQBIXoEG6ooaL3BpA+Wx1VZSUhl2qi5Dicfa391wVRl0xq4TjHKOUwU9SCyTNIlBnqTdRW1vvRKyVn/8c9da2nNrPbwplogBEuP9t3mhjWPaiI18ycJ3r74Q5R4tIm51Q40WHTKXrTvzTBj70CFXSqc8rWFi6cJ+rCVM3rbpz0wqhDNBEtOARqp+1nSLo5lgni2Rd9bzdO0WSIL2yilTQTie1M9rnXi2PHi1PR8y1FIZXwXrfcLNdPS/JkKA== 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: e48b0b69-de4b-4221-c518-08d8690fdb0c X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2020 09:20:09.1556 (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: U1GkJSGvsJROTPgKM6SgKF8ao+zBL3u3yZ9IRcYN30cb35NthFakLZvT6lqNB3As X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4331 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601889682; bh=NY+KC4IxGOyCQ4fkW+rSKlnl2otxufEMFaktFllEgig=; 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=HY3vkmHS7SBf/kQoP9qHM7kZd1ALgvz/NoFLvjHugKZJOciWXq/q9RO5RTMtSXORX 8P2XhZmVPQBtfZ5lhdwMAPkqiIFhD1j68lqo5+op44DnvBaZmt5eF80WUvFjbanJfG Q5EZsVahUoVqB2vkRFtajNPmsIq/y8ShtDQA9Cz9GxQ7OwOqY3IADOQZDPUGD+iRbr KdCZXdWzgavEU2uluer6u35wSSjXm/Qysbx1/CCBlre6X1HQUh73sD1iwf2dgIB7xl lRpp1nrYDb08UTu+QPZgYEtVQal06yH2VSkM0ZTyPySR1pQgnhmzfYcGMZ9zu0Myse dUR19CiNgksNw== 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, Thanks for your comments. I will update it in V5 patch. Please help review it to make sure I got your point. Regards, Li Zhang > -----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 >=20 > Hi Li >=20 > PSB >=20 > 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 removed= . > > > > -- 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), > > + }; >=20 > 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 ju= st > matched on the rte_default now with our new version all the matching will > fail. Since you are adding more must fields. >=20 > > + 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; >=20 > Please see comment above. >=20 > > + } 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