From patchwork Fri Oct 1 19:34:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 100352 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F7FDA0032; Fri, 1 Oct 2021 21:35:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 584B241254; Fri, 1 Oct 2021 21:35:06 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2077.outbound.protection.outlook.com [40.107.102.77]) by mails.dpdk.org (Postfix) with ESMTP id 538DF411D9 for ; Fri, 1 Oct 2021 21:35:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/IPJzEpZ0qvitqvce6tWBy/3YxNANrAJ1oOkf53JrurB7tWbgkPwBGWu9keLbMQ92BrBBB42dGkU4Ny+P3rxez3RQDWzgXuQ5+XRjstmklR6WAazy1tnVtzRbUPNCPklwjOgZHsT3I7HiJEng//IZAut+mbvZuxSNlB19ThBfekDJ5OFnb7eYW8AqxkirQUh+KNkM+Hl82ghNwp9rzwxVL5Mfrg/7eETL9+0qvdA2rsY76YcusTaBhB60kBUn8TT0wsjfK2847LdW2ceg7/B7EbyGZ0+Ui+NZkWwehtjQjkkQ9LEk7JT1PyTw0Ryb8nDmeXARlE+7v82BF0y1Bt0A== 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=74dGVAbQmYV9m9222VYMZ2rkxm1WWrAMObUJ78yDTNE=; b=dwDxHLSAmW9ol5Clxdn6wVfO9B3b7NuPZEXYZmSacO5Nta7pddgoVSabH4jGltKx+7EbFUCjLq4251GgpNjLzGzWctp5m9Un3BUrRXOorZBPVx9aR8GcrRMA0dZGjCbz9Uxhf2whs8/aoAT6V7H3CKoclv2/WqKuXNoRXqab1MLsBaR/Y9rMfR5OliiCU65/2AZfDJUdpsxVYJs/ooYd6rzBEk6r6cnd3+qD0IhtEOgabjMQ7xqAQWUiICaqJGgC/v2ZfAy0Vibl1aiwu7qGgHqsZwylYjbO4iwWuA1YMGc/xJyVhX6An9nQW4BQVtOGEA5ZLrAlKI/Qj0nH4kXyNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=74dGVAbQmYV9m9222VYMZ2rkxm1WWrAMObUJ78yDTNE=; b=UPhE1pbltaokW1JczqkG/CCm3Yt7vxfBGvxd2vKUOM4ooQNceRzk6iEf3vwF7PghgAJTZOUqgExqD6idIYrADPcD6e+Ci6YXoJXE+7FFGxvNcvF0XwBury6ekERd7qbBg64wkVVpKe/kXA7ruVorzJXjKyxWrknNwUM1wUaUEKA4HbkScMVd8MRE3a37U0f7G9TQBJnBle5Go1ddOrvGdJDiiMZgO+Di8dKFeGjHxwh9AmhPD57pvZKUG+nXgFanOFwOJOVS5/Do6a5Xk8rlIE9BWKusPinlfDf4E8e5j4BHeXOvnwiLyqRE5gERnd9DnYJAQeh5zeEesQTLX5xIeA== Received: from BN6PR17CA0019.namprd17.prod.outlook.com (2603:10b6:404:65::29) by BL1PR12MB5351.namprd12.prod.outlook.com (2603:10b6:208:317::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.16; Fri, 1 Oct 2021 19:35:02 +0000 Received: from BN8NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:404:65:cafe::94) by BN6PR17CA0019.outlook.office365.com (2603:10b6:404:65::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.17 via Frontend Transport; Fri, 1 Oct 2021 19:35:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT018.mail.protection.outlook.com (10.13.176.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Fri, 1 Oct 2021 19:35:02 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 1 Oct 2021 19:34:59 +0000 From: Viacheslav Ovsiienko To: CC: , , , , , Date: Fri, 1 Oct 2021 22:34:10 +0300 Message-ID: <20211001193415.23288-10-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20211001193415.23288-1-viacheslavo@nvidia.com> References: <20210922180418.20663-1-viacheslavo@nvidia.com> <20211001193415.23288-1-viacheslavo@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f1591a6-6eb8-4054-1465-08d985129007 X-MS-TrafficTypeDiagnostic: BL1PR12MB5351: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GlXFqsiJyw/g2DNHyeRW0VOouyxVplJZO2XAwkAKTC1dkao2R6DJomvXr6mlJ7BodjMBck8tbpxkZnhPnHBvP+ukrqEFr/mxU5EsFCbMMjrAgVZONWPS9gSAbxoCTLU8kMKPrDg0J0f/ObRZQK2zNGjG/Ia1UCIxKWjaP6Ho/Ymd6cCVnZQSxHaYr7+QtNzOhfE0w6YZVfny04EFSkUDQXtwVen8bECdWuzjqxKETrSVFg202GdnwhcpLG9EvpeD79fJYYrWcJ0WIRs7vF0VSng0TdcG2qK/s7Reu2hJqMd+HvNs8ZCHglzU+VV8B8lxZAkeBVoJMz8fdvCgJ/12/ZgpIOo3IV1O5WQSYvLALH6yOyUuiq5STYtCFKn0wVvk4DZ9l4LzyOsOfkkRMpGXbj16T1a8JgkeBYBKC/ed/mWp9iq7rRQsm3NkLe6jnu2E6mzbghFf5mPhKwN9pd9YcgDxpvEO5LiocpkI7HuROn1uY7rsH+kOBdjx4x1txZ1l7l48zVzW+izUN7BcTdj4WTobq+7kM0McELkQwRX94v9Ktk8CQ14p7dHRxKU8VOlF0M6/PaN3Xdxn63bUS5/ChlN3mnnZz+wMQXkwzT+a1gxjFGonnlNUI/ySFFLtrnMKLp18ng1/sQyemgSZKL9fDN7ypf//IGDSmZVAeOaUPgrd+qcF8qR+x4b+nUT0Y24g6WPFPN+xz1eyCowin2YPF6DXfPZH9YmO4VGPlxG6wZA= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(7636003)(36756003)(2906002)(82310400003)(316002)(47076005)(36860700001)(70206006)(86362001)(83380400001)(8936002)(54906003)(7696005)(426003)(356005)(6666004)(5660300002)(336012)(4326008)(70586007)(508600001)(26005)(8676002)(2616005)(1076003)(6916009)(55016002)(16526019)(6286002)(186003)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2021 19:35:02.0262 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f1591a6-6eb8-4054-1465-08d985129007 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5351 Subject: [dpdk-dev] [PATCH v2 09/14] net/mlx5: update eCPRI flex parser structures X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" To handle eCPRI protocol in the flows the mlx5 PMD engages flex parser hardware feature. While we were implementing eCPRI support we anticipated the flex parser usage extension, and all related variables were named accordingly, containing flex syllabus. Now we are preparing to introduce more common approach of flex item, in order to avoid naming conflicts and improve the code readability the eCPRI infrastructure related variables are renamed as preparation step. Later, once we have the new flex item implemented, we could consider to refactor the eCPRI protocol support to move on common flex item basis. Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 9 +++------ drivers/net/mlx5/mlx5.h | 12 +++--------- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 45ccfe2784..aa49542b9d 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -858,8 +858,7 @@ bool mlx5_flex_parser_ecpri_exist(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_flex_parser_profiles *prf = - &priv->sh->fp[MLX5_FLEX_PARSER_ECPRI_0]; + struct mlx5_ecpri_parser_profile *prf = &priv->sh->ecpri_parser; return !!prf->obj; } @@ -878,8 +877,7 @@ int mlx5_flex_parser_ecpri_alloc(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_flex_parser_profiles *prf = - &priv->sh->fp[MLX5_FLEX_PARSER_ECPRI_0]; + struct mlx5_ecpri_parser_profile *prf = &priv->sh->ecpri_parser; struct mlx5_devx_graph_node_attr node = { .modify_field_select = 0, }; @@ -942,8 +940,7 @@ static void mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_flex_parser_profiles *prf = - &priv->sh->fp[MLX5_FLEX_PARSER_ECPRI_0]; + struct mlx5_ecpri_parser_profile *prf = &priv->sh->ecpri_parser; if (prf->obj) mlx5_devx_cmd_destroy(prf->obj); diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 3581414b78..5000d2d4c5 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1035,14 +1035,8 @@ struct mlx5_dev_txpp { uint64_t err_ts_future; /* Timestamp in the distant future. */ }; -/* Supported flex parser profile ID. */ -enum mlx5_flex_parser_profile_id { - MLX5_FLEX_PARSER_ECPRI_0 = 0, - MLX5_FLEX_PARSER_MAX = 8, -}; - -/* Sample ID information of flex parser structure. */ -struct mlx5_flex_parser_profiles { +/* Sample ID information of eCPRI flex parser structure. */ +struct mlx5_ecpri_parser_profile { uint32_t num; /* Actual number of samples. */ uint32_t ids[8]; /* Sample IDs for this profile. */ uint8_t offset[8]; /* Bytes offset of each parser. */ @@ -1190,7 +1184,7 @@ struct mlx5_dev_ctx_shared { struct mlx5_devx_obj *tis; /* TIS object. */ struct mlx5_devx_obj *td; /* Transport domain. */ void *tx_uar; /* Tx/packet pacing shared UAR. */ - struct mlx5_flex_parser_profiles fp[MLX5_FLEX_PARSER_MAX]; + struct mlx5_ecpri_parser_profile ecpri_parser; /* Flex parser profiles information. */ void *devx_rx_uar; /* DevX UAR for Rx. */ struct mlx5_aso_age_mng *aso_age_mng; diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index b610ad3ef4..fc676d3ee4 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -10020,7 +10020,7 @@ flow_dv_translate_item_ecpri(struct rte_eth_dev *dev, void *matcher, */ if (!ecpri_m->hdr.common.u32) return; - samples = priv->sh->fp[MLX5_FLEX_PARSER_ECPRI_0].ids; + samples = priv->sh->ecpri_parser.ids; /* Need to take the whole DW as the mask to fill the entry. */ dw_m = MLX5_ADDR_OF(fte_match_set_misc4, misc4_m, prog_sample_field_value_0);