From patchwork Tue Jan 31 09:33:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Vesker X-Patchwork-Id: 122738 X-Patchwork-Delegate: rasland@nvidia.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 E63EC41B8D; Tue, 31 Jan 2023 10:36:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AAEDC42FC0; Tue, 31 Jan 2023 10:35:10 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2044.outbound.protection.outlook.com [40.107.102.44]) by mails.dpdk.org (Postfix) with ESMTP id EC64542F9E for ; Tue, 31 Jan 2023 10:35:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e+nDFRbnKp9YbKCrie1Zhh4PA0SQ8UxXBJMSx+hWlnE7pU7TiFgs1/fGYipciXtZ/agRjjiEVNebo35LQoCuWqYR58/nl7fVeWsQunGKZcIWOieVJVtH52z0NlU+6UYFJNvcNZyKXxn284OIqWuglU7KGJXtqNNgF7VTpeqT5tc2zJqmPCgZ4cyGmsKs83jc2WY+MrJpTcqsupoasHHXDuhjyfDvce8u9TzXMZLiiY27sV7y4nZU+M3L/71YR42FW1Jexvudc/5xrONKjCiaCd/dpmmcuG6mPF3xcnTFvBxmlxf3XLxOT8TppFfiliGBP0ptm0vwrVBg8M0VlZDsMg== 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=gcjdhA+ycRYRGGPWCAIub+IYkgkzRTgwfSrBYJD5gj4=; b=aXfYqH08zpxM7CA17X027+sh3OlLoaHPL2YM/+zZm8s6pCVremoWexZEuCDv989NZpCmHFHmsoVC81JVfZSxmgxKneoYtiKVRLfQXLW1Dgt8nt+ZPxFUKpmF6zhnsk09opIAhaER7XUJ4BrVJLUA+hKZ2mtxcrm9zBYBfHoUO3Eq+PuRuevbLNewc6ypctZhM1jMGKscmbdI57Ku+PKQ78xRMU7gEEuShkMKclSjU0PM+kJgGKuZjIYq3YesCOHO1ppX5vlLhbQeDr7WA2BWfeaYh9cj8/JAwx+2S+jYOk4/6y7Rm+MuwXOJ+eHWCBH+hQMCbi/sQDNy4TWMY0KwGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=gcjdhA+ycRYRGGPWCAIub+IYkgkzRTgwfSrBYJD5gj4=; b=XfdQFfpc85J4cW9rVhYqPLIs8Op+m+zsfE8XxffQEOqyQtHPXF2nhZ2WNpn848TeDCnrjaGwscVyztzRwFZNc8tCqJRwvca7/A+Gx70Mg141kO4qLein1F5bwZOLqz4zGVI6i3CXlm3rNXtOqYufP32G8YHoItKaTzbIcmSFEsc3Pj1HfR1G17AHwp/5lQ4Jt/CV671SjMg/GFePkHWMYSegoeXHLO4eKU8SVy3ihY3ZtKlpMVensjCZrrfHZUz0T/rL3s90q6eJfGumdiEHhvzVm129Berx28R8i/c/8QZ9MVuAHcMZVn1PHpyNCQvOz00dCSPnu7Wm34BqEyTkBg== Received: from MW4PR03CA0088.namprd03.prod.outlook.com (2603:10b6:303:b6::33) by IA0PR12MB7604.namprd12.prod.outlook.com (2603:10b6:208:438::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 09:35:06 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::75) by MW4PR03CA0088.outlook.office365.com (2603:10b6:303:b6::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Tue, 31 Jan 2023 09:35:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23 via Frontend Transport; Tue, 31 Jan 2023 09:35:05 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 31 Jan 2023 01:34:40 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 31 Jan 2023 01:34:38 -0800 From: Alex Vesker To: , , , "Matan Azrad" CC: , Subject: [v1 15/16] net/mlx5/hws: rename pattern cache object Date: Tue, 31 Jan 2023 11:33:44 +0200 Message-ID: <20230131093346.1261066-16-valex@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230131093346.1261066-1-valex@nvidia.com> References: <20230131093346.1261066-1-valex@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT042:EE_|IA0PR12MB7604:EE_ X-MS-Office365-Filtering-Correlation-Id: 4beeb992-170d-4fad-1f28-08db036e6fdf X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zgv1VKj5W41f3aeyCWeZsiDIne4Kc2P85hHgmRX8p8nfaaWaigsv417bp4qDGoByoTVn0ZbBlF3hF8G0tb4R5+RJsKpHGSxhwmT0nCFPkrjDWWmahXJGALYMAboEZTqSMYhcbaqXqhHmBqFlxn06tnbn9ahxJ6RdYs8aYzMTyu0fwpdi45yV0hW/QCbVucqKJ1uCukxjKD5MdwNXSdYRq+DxcW3zM1gat4jDKnEhbrQOosnQJ6Yw2mhyk7WVBXXO900rC/1smOV6KslY49E/pMpRVwk0CsOcyap8gqiskSTpF4C/5gy4OtPTciKFtYj3p5ycoOxZ3KtFfZy8AzZ9LKK3q2Ml/dhWF4yJwyBGslXvDmUNe3SfswYShtTIFbYk93TEdmYlaj7WUFos7Vupl/+fAuV0LCJUVVmtf+8PLHQqJjYz1RMiJkm+p68FliIxILXdS7kk0Q7ryZnXLS54RVJw/XLEyVBKK9DF45LeG3++VfnmcEiZgRmIAm25+ZYj+SKwlT6S7uw3/BClv99R+wztfGGuqKZgv9c8nsG8Zi7VS2G2b6t4Ka27egQ7m6d8WJydmb9nGLzFNhHZr4IbxmP7G9uQALX1Of5cJW7C6vU/6vCq2zPT6McQAhoLJNlFMZSG4e9po3BEKpX9cQUO9GCHZNc6d4gzQW12Wn4peYp7VtblDUyCxgpQ2thjd+NqyoUVYh1E9Gk0nXFGV4Bh6w== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(6286002)(8936002)(40460700003)(356005)(41300700001)(86362001)(5660300002)(83380400001)(426003)(47076005)(336012)(36860700001)(110136005)(7636003)(54906003)(4326008)(2616005)(82740400003)(6636002)(16526019)(55016003)(70206006)(8676002)(70586007)(40480700001)(316002)(6666004)(186003)(7696005)(1076003)(36756003)(26005)(478600001)(107886003)(82310400005)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 09:35:05.9674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4beeb992-170d-4fad-1f28-08db036e6fdf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7604 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 To have the same name convention for future caches, use cache and cache item naming. Signed-off-by: Alex Vesker --- drivers/net/mlx5/hws/mlx5dr_pat_arg.c | 22 +++++++++++----------- drivers/net/mlx5/hws/mlx5dr_pat_arg.h | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_pat_arg.c b/drivers/net/mlx5/hws/mlx5dr_pat_arg.c index 152025d302..6ed04dac6d 100644 --- a/drivers/net/mlx5/hws/mlx5dr_pat_arg.c +++ b/drivers/net/mlx5/hws/mlx5dr_pat_arg.c @@ -94,13 +94,13 @@ static bool mlx5dr_pat_compare_pattern(enum mlx5dr_action_type cur_type, return true; } -static struct mlx5dr_pat_cached_pattern * +static struct mlx5dr_pattern_cache_item * mlx5dr_pat_find_cached_pattern(struct mlx5dr_pattern_cache *cache, struct mlx5dr_action *action, uint16_t num_of_actions, __be64 *actions) { - struct mlx5dr_pat_cached_pattern *cached_pat; + struct mlx5dr_pattern_cache_item *cached_pat; LIST_FOREACH(cached_pat, &cache->head, next) { if (mlx5dr_pat_compare_pattern(cached_pat->type, @@ -115,13 +115,13 @@ mlx5dr_pat_find_cached_pattern(struct mlx5dr_pattern_cache *cache, return NULL; } -static struct mlx5dr_pat_cached_pattern * +static struct mlx5dr_pattern_cache_item * mlx5dr_pat_get_existing_cached_pattern(struct mlx5dr_pattern_cache *cache, struct mlx5dr_action *action, uint16_t num_of_actions, __be64 *actions) { - struct mlx5dr_pat_cached_pattern *cached_pattern; + struct mlx5dr_pattern_cache_item *cached_pattern; cached_pattern = mlx5dr_pat_find_cached_pattern(cache, action, num_of_actions, actions); if (cached_pattern) { @@ -134,11 +134,11 @@ mlx5dr_pat_get_existing_cached_pattern(struct mlx5dr_pattern_cache *cache, return cached_pattern; } -static struct mlx5dr_pat_cached_pattern * +static struct mlx5dr_pattern_cache_item * mlx5dr_pat_get_cached_pattern_by_action(struct mlx5dr_pattern_cache *cache, struct mlx5dr_action *action) { - struct mlx5dr_pat_cached_pattern *cached_pattern; + struct mlx5dr_pattern_cache_item *cached_pattern; LIST_FOREACH(cached_pattern, &cache->head, next) { if (cached_pattern->mh_data.pattern_obj->id == action->modify_header.pattern_obj->id) @@ -148,14 +148,14 @@ mlx5dr_pat_get_cached_pattern_by_action(struct mlx5dr_pattern_cache *cache, return NULL; } -static struct mlx5dr_pat_cached_pattern * +static struct mlx5dr_pattern_cache_item * mlx5dr_pat_add_pattern_to_cache(struct mlx5dr_pattern_cache *cache, struct mlx5dr_devx_obj *pattern_obj, enum mlx5dr_action_type type, uint16_t num_of_actions, __be64 *actions) { - struct mlx5dr_pat_cached_pattern *cached_pattern; + struct mlx5dr_pattern_cache_item *cached_pattern; cached_pattern = simple_calloc(1, sizeof(*cached_pattern)); if (!cached_pattern) { @@ -189,7 +189,7 @@ mlx5dr_pat_add_pattern_to_cache(struct mlx5dr_pattern_cache *cache, } static void -mlx5dr_pat_remove_pattern(struct mlx5dr_pat_cached_pattern *cached_pattern) +mlx5dr_pat_remove_pattern(struct mlx5dr_pattern_cache_item *cached_pattern) { LIST_REMOVE(cached_pattern, next); simple_free(cached_pattern->mh_data.data); @@ -200,7 +200,7 @@ static void mlx5dr_pat_put_pattern(struct mlx5dr_pattern_cache *cache, struct mlx5dr_action *action) { - struct mlx5dr_pat_cached_pattern *cached_pattern; + struct mlx5dr_pattern_cache_item *cached_pattern; pthread_spin_lock(&cache->lock); cached_pattern = mlx5dr_pat_get_cached_pattern_by_action(cache, action); @@ -225,7 +225,7 @@ static int mlx5dr_pat_get_pattern(struct mlx5dr_context *ctx, size_t pattern_sz, __be64 *pattern) { - struct mlx5dr_pat_cached_pattern *cached_pattern; + struct mlx5dr_pattern_cache_item *cached_pattern; int ret = 0; pthread_spin_lock(&ctx->pattern_cache->lock); diff --git a/drivers/net/mlx5/hws/mlx5dr_pat_arg.h b/drivers/net/mlx5/hws/mlx5dr_pat_arg.h index d9353e9a3e..92db6d6aee 100644 --- a/drivers/net/mlx5/hws/mlx5dr_pat_arg.h +++ b/drivers/net/mlx5/hws/mlx5dr_pat_arg.h @@ -24,10 +24,10 @@ enum { struct mlx5dr_pattern_cache { /* Protect pattern list */ pthread_spinlock_t lock; - LIST_HEAD(pattern_head, mlx5dr_pat_cached_pattern) head; + LIST_HEAD(pattern_head, mlx5dr_pattern_cache_item) head; }; -struct mlx5dr_pat_cached_pattern { +struct mlx5dr_pattern_cache_item { enum mlx5dr_action_type type; struct { struct mlx5dr_devx_obj *pattern_obj; @@ -36,7 +36,7 @@ struct mlx5dr_pat_cached_pattern { uint16_t num_of_actions; } mh_data; uint32_t refcount; - LIST_ENTRY(mlx5dr_pat_cached_pattern) next; + LIST_ENTRY(mlx5dr_pattern_cache_item) next; }; enum mlx5dr_arg_chunk_size