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 82EB3A00C5; Thu, 30 Apr 2020 14:26:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4FE041DBB7; Thu, 30 Apr 2020 14:26:36 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60080.outbound.protection.outlook.com [40.107.6.80]) by dpdk.org (Postfix) with ESMTP id 730BF1DB7D; Thu, 30 Apr 2020 14:26:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qwc2JtI4y5NIFNtXyE+TgiIdtX6v7Jh9ORkYQPhxxQpiMliUTg3jNUryUhTykrRlisPJXr2FVASV3udlvmMbN1Drlt9OQdkMprIk9OU0CqCTJw1IoSJ6Pvs9eRpxcBXjKCVOcgiHmUu8Qfbl8kfYnOAWI9+w2hBCPQy8eHKgTH9DtntpWPkjGhK4od4HxzwFVkSY7FU+HRw6+yqAIkmspt9Quo718KIz0bYAMBzIHOwHfhdLzKfp5Xy2fju+ifV27SfCznnGtRcRq280WecckvdWMIDFFIXhJvoUel8FJ+hq3YdY0mXkpE9FYUPauVZM5qR7ojcfd8x2SP5qqoerjQ== 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=D0y89XjzSSCXveCxPE0SdNq46CoCYaThEEU10chUvMg=; b=OhjGTwnbatv/txL4ytgOVvDw/ZNzJHnXTh3meVQOl/4Sbd7gtKFelblE5ctRgrhTqGIs3C4TPjXVgAPap3dBVlqId8pMJ3PtBOfhgD0+wGmYpP1Y9MvI3qZts1HdmsmHXWz1tFaG9ZbsqG8R5BudhGYC89xsv3bKlzULQOPTysB9nMwLHh6KFx3vwMSd+43rwJRpSxK0xfsfahsBhi7ojyKQMYa3fYKEaDtWR97iIynAUKdN/cMtC/iH8ZsEA+uav/1a2sIMnPaK7utc2qotTsFhDdbNa7TyFe9MYEYYtvjyMhKhs7WJGtGSAxtk3M+G6yFFe4M+HIfvp6WUaMDutg== 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=D0y89XjzSSCXveCxPE0SdNq46CoCYaThEEU10chUvMg=; b=NOmXJ4F/CDX+JDI+PIwAjlV/Wr82lJdn1yuOK3uLXrS6T31z5lFtW1Ra7nQSPFB2xzVkwoPjliHGfqrhNQe8RSLa7MP8aYkhl8XbTxVRSOUZAZHMzCiXox9spGh8bum2zi+bJjYeyPYRwgCPcgmmhk8ZLIALpTxM6Rr//nfZs2k= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM0PR05MB4514.eurprd05.prod.outlook.com (2603:10a6:208:af::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Thu, 30 Apr 2020 12:26:33 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::508:747b:cc12:5f6e%5]) with mapi id 15.20.2958.020; Thu, 30 Apr 2020 12:26:33 +0000 From: Raslan Darawsheh To: Bing Zhao , Slava Ovsiienko CC: Ori Kam , Matan Azrad , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix actions validation on root table Thread-Index: AQHWHiVbP1mV1Yq7KkCB5KC/h1BbeaiRmIKg Date: Thu, 30 Apr 2020 12:26:32 +0000 Message-ID: References: <1588164860-235231-1-git-send-email-bingz@mellanox.com> In-Reply-To: <1588164860-235231-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: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [188.161.230.216] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ee7230a4-ce09-4c76-de60-08d7ed01b7d4 x-ms-traffictypediagnostic: AM0PR05MB4514:|AM0PR05MB4514: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0389EDA07F x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(346002)(366004)(396003)(39860400002)(376002)(186003)(71200400001)(64756008)(55016002)(66446008)(9686003)(66946007)(66556008)(66476007)(76116006)(52536014)(7696005)(6506007)(26005)(86362001)(8676002)(53546011)(478600001)(33656002)(6636002)(110136005)(4326008)(54906003)(8936002)(450100002)(2906002)(5660300002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cRgNSZHN9bPWRjZZ6wTeaEbhjqBR5iMUJDaY8RMDp/9lAsqE/6Ir5khJjPGfOYB6okOERxik0EQOPDBse1NNtv8IowfIqnuyDrEtG75Lcf50n0LrVgGbS03KaJZLotsQsJjErahhMocr7Fgky7SMpzo08iyU8gWWnga4YFnLoqxSDg+hdZexQbVIaH33KEvJsoyn+fcQZMhwVkf8+Urtx1DuszgHp88A1bxbknbl9CBZg8OwF5XAe/eyx0NQ952lavkljmjujluxsAHLHjrGNupu3SAE936xjfB0qWEU9TMfLbU1B31VU1ry5x9PjP8Hw83EJ2u53s6p8teaSViTNf8GENHmwNdRslZS8nEEv+tkGSo0N+XwXGtdkU1y6ujuydzmq6ka4c0kx24OJ2ehhqQBLN7hr598XxtuqxsPWg7mEFM1stbOHbL6QgjWZfzN x-ms-exchange-antispam-messagedata: QNlTx6b7yeQDWzZhAqwtC3mfTR7DGMRCBG7GsD2VoxOElh0YUvrdqt7mKirgBbPgaF7EnID20opcqIP9VC1MVb1FC63YAkALWqIsNoLRzu0c8H8vT+R/J9u59YGDRHryQjxHt1O+9YVHvnj2S7VUhufmhjew76wlljm5Kh/IMa1QVFEbF2kiGkc+YX7NjSjlW1atYhvfyFQ/5kbEX6QIZCiv6HNmukUXyS4maLQFPvLAU4vipPdddj3jB2BXiTOj3oVOwv7lrxnOHDnOFE/nvF8v9CfZdXjmCAxZlZdrpamzJsNPm9nX78y8bdnaVHv73jUQd4OdgjtIeHcenIpAkx7nUKbo4Cct/TvYpadacXrbQrEbTMOSkaTBxS2G2hmyyw+Un7ajFhk17fGNtqJ7mHjID19NiGLD5Fnm/ZXUf/X0pf7nzbCFpIE7/sobbB8GU5LicX5VtHKbEWtjILRR94rFbt0JZ/R0nmcraNJkALfxj9h2JtKLD2d8H2aSd24Nuq5+1tYKGdXCoYDBkvR2DnT2DMS4bpkOtMjMyPKkFjhjTaJz83VPmfAshGhSZs+IphWGKLBTISTo/PHHUEv16aWSwriPTrf2rbf9a2LXLdnrF/nXS/09LtxUwgpzSr1XrfIrm4ii0QppQyLB/OptcLo8YYJEyWpHk0TSBPtKQv9C8Jf9Ikz3UWh/A7Mj3+0kW1NpQCIR/4bCZCbP1R+LY/kkz2abzVwD/DzDaoxrFV+0Vb93N0kWRCDLviJeCXKv+bvNwVp5zU4ZUmsJDBfdFtfixpnjttbodr2PhzGlhAiagMChjsK0Sqyl/JKqhDR9 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: ee7230a4-ce09-4c76-de60-08d7ed01b7d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 12:26:33.0050 (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: C+U9qq7MTsDTghd+LXbSIP6zJMTWfPWD7GtGvlDZkFb9CoRZM4hDmGsu//Gb/67TOusDM2OKPVBkgcqKJIuA2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4514 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix actions validation on root table 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: Wednesday, April 29, 2020 3:54 PM > To: Slava Ovsiienko ; Raslan Darawsheh > > Cc: Ori Kam ; Matan Azrad ; > dev@dpdk.org; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix actions validation on root table >=20 > The maximal supported header modifications number of a single modify > context on the root table cannot be queried from firmware directly. > It is a fixed value of 16 in the latest releases. In the validation > stage, PMD driver should ensure that no more than 16 header modify > actions exist in a single context. > In some old firmware releases, the supported value is 8. PMD driver > should try its best to create the flow. Firmware will return error > and refuse to create the flow if the actions number exceeds the > maximal value. >=20 > Fixes: 72a944dba163 ("net/mlx5: fix header modify action validation") > Cc: stable@dpdk.org >=20 > Signed-off-by: Bing Zhao > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow.h | 12 +++++++----- > drivers/net/mlx5/mlx5_flow_dv.c | 17 +++++++---------- > 2 files changed, 14 insertions(+), 15 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h > index 2a1f596..75b8288 100644 > --- a/drivers/net/mlx5/mlx5_flow.h > +++ b/drivers/net/mlx5/mlx5_flow.h > @@ -415,14 +415,16 @@ struct mlx5_flow_dv_tag_resource { >=20 > /* > * Number of modification commands. > - * If extensive metadata registers are supported, the maximal actions > amount is > - * 16 and 8 otherwise on root table. The validation could also be done i= n the > - * lower driver layer. > - * On non-root table, there is no limitation, but 32 is enough right now= . > + * The maximal actions amount in FW is some constant, and it is 16 in th= e > + * latest releases. In some old releases, it will be limited to 8. > + * Since there is no interface to query the capacity, the maximal value > should > + * be used to allow PMD to create the flow. The validation will be done = in > the > + * lower driver layer or FW. A failure will be returned if exceeds the m= aximal > + * supported actions number on the root table. > + * On non-root tables, there is no limitation, but 32 is enough right no= w. > */ > #define MLX5_MAX_MODIFY_NUM 32 > #define MLX5_ROOT_TBL_MODIFY_NUM 16 > -#define MLX5_ROOT_TBL_MODIFY_NUM_NO_MREG 8 >=20 > /* Modify resource structure */ > struct mlx5_flow_dv_modify_hdr_resource { > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index 6263ecc..ba2febf 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -3640,21 +3640,18 @@ struct field_modify_info modify_tcp[] =3D { > * @return > * Max number of modify header actions device can support. > */ > -static unsigned int > -flow_dv_modify_hdr_action_max(struct rte_eth_dev *dev, uint64_t flags) > +static inline unsigned int > +flow_dv_modify_hdr_action_max(struct rte_eth_dev *dev __rte_unused, > + uint64_t flags) > { > /* > - * There's no way to directly query the max cap. Although it has to be > - * acquried by iterative trial, it is a safe assumption that more > - * actions are supported by FW if extensive metadata register is > - * supported. (Only in the root table) > + * There's no way to directly query the max capacity from FW. > + * The maximal value on root table should be assumed to be > supported. > */ > if (!(flags & MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL)) > return MLX5_MAX_MODIFY_NUM; > else > - return mlx5_flow_ext_mreg_supported(dev) ? > - MLX5_ROOT_TBL_MODIFY_NUM : > - > MLX5_ROOT_TBL_MODIFY_NUM_NO_MREG; > + return MLX5_ROOT_TBL_MODIFY_NUM; > } >=20 > /** > @@ -5347,7 +5344,7 @@ struct field_modify_info modify_tcp[] =3D { > dev_conf->dv_xmeta_en !=3D MLX5_XMETA_MODE_LEGACY && > mlx5_flow_ext_mreg_supported(dev)) > rw_act_num +=3D MLX5_ACT_NUM_SET_TAG; > - if ((uint32_t)rw_act_num >=3D > + if ((uint32_t)rw_act_num > > flow_dv_modify_hdr_action_max(dev, is_root)) { > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ACTION, > -- > 1.8.3.1 Patch applied on next-net-mlx, Kindest regards, Raslan Darawsheh