From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B38843CED for ; Tue, 19 Mar 2024 15:25:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E13FE40ECF; Tue, 19 Mar 2024 15:25:41 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2097.outbound.protection.outlook.com [40.107.92.97]) by mails.dpdk.org (Postfix) with ESMTP id A67A740298 for ; Tue, 19 Mar 2024 15:25:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MDPyviqh0J5nTjSDeLxwNZm2hJSZUfh/aXvkpX3QS6rhyisvvVYAAAZt/Nhk2YWtSklVPXTQHJnwk3igTdEZfD2KXkPWua67hh+oNuhBKMeSzAJwvTtplEz23EGnF540flY18MCnSW23EWI0LftcgXNcYTVpq2EoHGAJWkqpIJeWiePJcMxeotJo6KS4CgtrZULYTWeWpxgc007Dioag4wgDdHd8kFiWT9+WUCokVy/Xutgaj3i5qujBohIWkNJ616Rieqy+UOT8LO9ORsvMlaMggV4GNbdk4MDHLR6H7/w/Bc/kkLixzmf2JIFFqpVB5afQEn/aIpE0lRecSEBzYQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q08M1YYbexNAY/gE+Nm0p55o4pEMccUbZ5geRiXSRFs=; b=KTUsI/qRMO0cghYIjuAvOF23gbqKxtbJO9oFgO0AIyX4srjivm4ndrmA3ZIJvrxcFjB1DJBYgTLaNJGJs9NFOAt8BTM4GYlc9T/8lPqK4pPD6HSoJhOtAStpAvyhNmZahgNixi/nzSV3uPpCBqh0OrLw+TIEP2U7OyKnuMVpK/DKXpJyYv9Qbgkspv6uKCV5+q3pghQFibYMSL4VcaLn2u7S7oR5SODTlNDGhW43xecO2tN0p0w8Jfie3qHXv49NN2GtKT8FHRdYsb1zdvU7RBhwjrWyRRt0aidBHwCPKZ8942ijbXm4Rbv2Ta1//L4mCRJ+AUMX+VgoPQ5LqPn3+A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q08M1YYbexNAY/gE+Nm0p55o4pEMccUbZ5geRiXSRFs=; b=kwzRrJFrZ3Vu+iC31QI4r2/Y7gvhVv3719HsE6TjTUB4U+f6shjYR9hV8sOHdk0AYgCdBtmFKSTs/HjLOJzhGrJQU8jXkU5joIxEGMvR+x5DWQS+qnuxlVCEqPUP2FC1npPjLv0eIiIcycHfOtswHveuGih/kHnhHLQpGvX7L31EoE6j4moxmuNR3eEaKEaZCDmxiGWO7uWGLF+4zcnv3AR7LhkooW5op94S6v/BKdFfy/xdrSjeKQyPZHiRlJTUo+lKVvTO6MWWvmQgfv2HrR/Vg8/qpNfgvcEvSc6hbOP9KMxs7vdxSmClhEiq4rp1lAXHFzmrxTR5SqicjQIlGg== Received: from IA1PR12MB6332.namprd12.prod.outlook.com (2603:10b6:208:3e2::13) by SJ0PR12MB6941.namprd12.prod.outlook.com (2603:10b6:a03:448::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.29; Tue, 19 Mar 2024 14:25:36 +0000 Received: from IA1PR12MB6332.namprd12.prod.outlook.com ([fe80::abca:c0e2:1a95:d6ab]) by IA1PR12MB6332.namprd12.prod.outlook.com ([fe80::abca:c0e2:1a95:d6ab%4]) with mapi id 15.20.7386.020; Tue, 19 Mar 2024 14:25:36 +0000 From: Gregory Etelson To: Suanming Mou , Guvenc Gulce , "users@dpdk.org" CC: Ori Kam , Maayan Kashani Subject: Re: mlx5: rte_flow template/async API raw_encap validation bug ? Thread-Topic: mlx5: rte_flow template/async API raw_encap validation bug ? Thread-Index: AQHaeR69o94Z6fNcNEezdQ6xUTy3g7E+NUeAgADRCNw= Date: Tue, 19 Mar 2024 14:25:36 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA1PR12MB6332:EE_|SJ0PR12MB6941:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DfwMK/8b3g6POWIGe940y0acmMzHGrvBF51m9b6EXEGv6AIlkFFNMiljLeyNN8E1nq5SvcRihiNtz7VIajwslisVTCCyHK/hl5UlxH0op4JT4+dSDWnPj/Et6LufVE+u05Gm1WnwbWkYvlEeqkzTZDwGitdrCLZFml31k2kGICevmz0WaurFXNgMaQKAmRbTaTy/S69ERvwfAocaqbn71FDFOSuVoKolY8Kj0FPLu4TA1yb7e9CGc061hlTcM3joHGhrAc4LzYIDzKBzzZvHtrR7Tjt+FwKuoTfP6o6r9YwaqHRt+w9sMy2cM+Ok4f2KYz2D9OC1MMI0bf3V2YxGNbyx9RV1WGMOhTcOg6VHhhsXPmxyNx4PuWAbLG5jC9rEgxWmB3xmwilPcRQ3EvUU69du39RcP8ROEYOoOkmFI8aLFnxxUmeyQy8dGxxc0ULYS0xlXVMcLtDM+o3WcU8ukt1vT21H6e7JPbk0UrdjmLHOR6eDldqbGtmf4qM1cyyWTka82lPYReWervl4KcJQONBDjA/NowGhJJR+MsYs9/p3PcWahQKj4//NvicM/M5lByUWmBDskvy21jUZ5iMhQFoDkHCzj+PpB5vuu0HYpelRCAkI30SXUwpFWH2XoCQSdCpT1WQov3vuEBdyqxCWqd5lOymzLEbgt8BNilqhQd4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR12MB6332.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?7R2yOA6vAqWsZ9NAKdNsi0tPAL/RiwhaqtZ1FZo6g9rArVAWQWudyDn27q?= =?iso-8859-1?Q?qbXJNaCWA1VziS/30hR0YxGPMSVcYq7FDSkhJPulSF2cP9f1+j0uyc8ptZ?= =?iso-8859-1?Q?LPlWNlKeaNskiz9V5cXhpdH17fwHbJzOGWmhPqeqhgJ6rjOTOFf0u+NHkU?= =?iso-8859-1?Q?T+dyrkhsoUZFVqsdKl/XSoNNqTtfOYgBsfGJ2srSrRX2NkKYExPM99vbmP?= =?iso-8859-1?Q?HV2Wiw/Bgvv8XQ9oeoNhDbOAtzeMwLEsnzhj18z3qhiFCcFbzCLodyfvTN?= =?iso-8859-1?Q?WvrH+gnfFsgSpVFmRgwoWHBByLeHJbohgsjKbBUWlLjc16k7XqOwJpSjnJ?= =?iso-8859-1?Q?io1dlsdP62d1L149u7msxMLjXPXII7O5zWc4yXtUzbLw+3LMagVpkYSVQ1?= =?iso-8859-1?Q?Yz0BSHIJpnYLWKaio93YNtyGdt3ZtJhknnesj2tpL4LVwYn40uHuoJ4pXJ?= =?iso-8859-1?Q?dNVIOq0xzKBMW9OjBzlYTiIMT76RM12hiZ6PScmhBHRrZtSIi5xWvfBiot?= =?iso-8859-1?Q?yhzUSRXbY3U/TGhsoXhZJb6wZDcXnIDy3aXG/eFLf8nFcH5GYtqRlYhJ9h?= =?iso-8859-1?Q?HWg7OCzF7y7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h?= =?iso-8859-1?Q?/jJcm/JT0dUV6mi1oXP1zpEFQEOswlxhkXjrg7JduXBl/QW8Dp4UDYoJAv?= =?iso-8859-1?Q?Fs4UdmvbUWnIfConN5kX0XPw9zaSiQXUPru4Ae+V/9XW7Z1fOiEQVojMho?= =?iso-8859-1?Q?o+tYCoMRiHPKx/dJthjZzVsdEpg4fFb4fX?= Content-Type: multipart/alternative; boundary="_000_IA1PR12MB633255D40F27999831F7666FA52C2IA1PR12MB6332namp_" MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6332.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 213b3b02-5752-4733-2653-08dc482071eb X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2024 14:25:36.6973 (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: 07wP+VPNvGTghA+qth7zNqD2FdcV2L6Xc9KJULnuPG1l/sni6KTwRqkVVHoVBj3GRh7QNZYcBiSKARxoCtZ/sQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6941 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --_000_IA1PR12MB633255D40F27999831F7666FA52C2IA1PR12MB6332namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello Guvenc, Flow actions in MLX5 PMD actions template are translated according to these= general rules: 1. If flow action configuration in template mask was not NULL, PMD constructs = the action according to the action configuration parameters. PMD will use that pre-build action during async flow creation. The action parameters cannot be changed during async flow creation. 2. If flow action configuration in template mask was NULL, PMD ignores the act= ion configuration in the template. The action will be constructed according to configuration data provided dur= ing async flow creation. Before patch 2e543b6f18a2 ("net/mlx5: reuse reformat and modify actions in = a table") the PMD ignored the RAW_ENCAP NULL mask configuration and used the action c= onfiguration for construction. 2e543b6f18a2 does not allow access to RAW_ENCAP configuration if the action= did not provide correct mask. If flow action configuration has several parameters, the action template ca= n be partially translated - some action parameters will be provided with the template and other with as= ync flow. In that case, if the action mask parameter has any non-zero value, it's con= figuration parameter will be used in a template. If the action mask parameter is 0, that parameter value will be provided du= ring async flow. Partial action translation used for pre-defined flow actions. MLX5 PMD requires the `size` parameter of the RAW_ENCAP action during the t= emplate action translation. The action data can be provided ether with the template action configuratio= n or with async flow. Therefore, the RAW_ENCAP template configuration can be fully masked with th= e action size and data or partially masked with size only. Regards, Gregory ________________________________ From: Suanming Mou Sent: Tuesday, March 19, 2024 02:24 To: Guvenc Gulce ; users@dpdk.org ;= Gregory Etelson Cc: Ori Kam ; Maayan Kashani Subject: RE: mlx5: rte_flow template/async API raw_encap validation bug ? Hi Guvenc, From: Guvenc Gulce Sent: Monday, March 18, 2024 6:26 PM To: users@dpdk.org Cc: Suanming Mou ; Ori Kam Subject: mlx5: rte_flow template/async API raw_encap validation bug ? Hi all, It is great that we have rte_flow async/template api integrated to mlx5 driver code and it is being established as the new standard rte_flow API. I have the following raw_encap problem when using the rte_flow async/templa= te API with mlx5 driver: - raw_encap rte_flow action template fails during validation when the actio= n mask conf is NULL but this clearly contradicts the explanation from Suanming Mou= 's commit 7f6daa490d9 which clearly states that the raw encap action mask is a= llowed to be NULL. 2. RAW encap (encap_data: raw) action conf (raw_data) a. action mask conf (not NULL) - encap_data constant. b. action mask conf (NULL) - encap_data will change. Commenting out the raw_encap validation would make it possible to create rte_flow template with null mask conf which can be concretized later on. Things seem to work after relaxing the rte_flow raw_encap validation. The change would look like: [Suanming] I guess maybe it is due to the raw_encap and raw_decap combinati= on. I added Gregory who added that code maybe can explain it better. @Grego= ry Etelson diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_h= w.c index 35f1ed7a03..3f57fd9286 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -6020,10 +6020,10 @@ flow_hw_validate_action_raw_encap(const struct rte_= flow_action *action, const struct rte_flow_action_raw_encap *mask_conf =3D mask->conf; const struct rte_flow_action_raw_encap *action_conf =3D action->con= f; - if (!mask_conf || !mask_conf->size) +/* if (!mask_conf || !mask_conf->size) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, mask, - "raw_encap: size must be masked")= ; + "raw_encap: size must be masked")= ; */ if (!action_conf || !action_conf->size) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, actio= n, But this can not be the proper solution. Please advise a solution how to ma= ke the raw_encap work with rte_flow template/async API. If relaxing the validation= is ok, I can also prepare and send a patch. Thanks in advance, Guvenc Gulce --_000_IA1PR12MB633255D40F27999831F7666FA52C2IA1PR12MB6332namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello Guvenc,

Flow actions in MLX5 PMD actions template are translated according to these= general rules:

  1. If flow action configuration in template mask was not NULL, PMD constructs = the action according
    to the action configuration parameters.
    PMD will use that pre-build action during async flow creation.
    The action parameters cannot be changed during async flow creation.

  2. If flow action configuration in template mask was NULL, PMD ignores the act= ion configuration in the template.
    The action will be constructed according to configuration data provided dur= ing async flow creation.
  
Before patch 2e543b6f18a2 ("net/mlx5: reuse reformat and modify action= s in a table")
the PMD ignored the RAW_ENCAP NULL mask configuration and used the action c= onfiguration for construction.
2e543b6f18a2 does not allow access to RAW_ENCAP con= figuration if the action did not provide correct mask.

If flow action configuration has several parameters, the action template ca= n be partially translated -
some action parameters will be provided with the template and other with as= ync flow.
In that case, if the action mask parameter has any non-zero value, it's con= figuration parameter will be used in a template.
If the action mask parameter is 0, that parameter value will be provided du= ring async flow.

Partial action translation used for pre-defined flow actions. 

MLX5 PMD requires the `size` parameter of the RAW_ENCAP action during the t= emplate action translation.
The action data can be provided ether with the template action configuratio= n or with async flow.
Therefore, the RAW_ENCAP template configuration can be fully masked with th= e action size and data or partially masked with size only.

Regards,
Gregory



From: Suanmi= ng Mou <suanmingm@nvidia.com>
Sent: Tuesday, March 19, 2024 02:24
To: Guvenc Gulce <guvenc.gulce@gmail.com>; users@dpdk.org= <users@dpdk.org>; Gregory Etelson <getelson@nvidia.com>
Cc: Ori Kam <orika@nvidia.com>; Maayan Kashani <mkasha= ni@nvidia.com>
Subject: RE: mlx5: rte_flow template/async API raw_encap valida= tion bug ?
 

@Gregory Etelson