From patchwork Wed Feb 1 07:28:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Vesker X-Patchwork-Id: 122793 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 ADE9741B9B; Wed, 1 Feb 2023 08:30:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E057A42D38; Wed, 1 Feb 2023 08:29:32 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2058.outbound.protection.outlook.com [40.107.243.58]) by mails.dpdk.org (Postfix) with ESMTP id 4317B42D9C for ; Wed, 1 Feb 2023 08:29:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=azPotzoa3OtPwXXHyS9GhJZ348xjB4MvMZ2xmZFpvItAPCSuzkWqoY/fyfSN+PtaaEJvwK7w3QnVWyKoTNR27vBogIv2U/vky5mMd0hL6ac7njOcbPVG3MLlnptwaM08PVzfeEzUPq4wevTOHFjk3o76x0+DybfqEU3CyG6YJ2Qywm8+6lBbH3Ac4Rwu964Uv792qGelikxVbcF6o/kaYDYUN5K1pzI3a8Ctsqx3PNmOAE0S58nk/xTzasG04goe68XFAWe0Rfn7AErQ55HebNV6u3sEZzGH66GQGfHFo+3QOhk+cliyOHQIfugb/ljwqxPkdiYtitVd9rlRZDV+4Q== 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=JjsSz4pYG/DbhEon5YHG2E+nK/4sqJChwZRhe7vmS4x0yOQlIq/5VMOnscCZu/qyxIkMJQeKHNNN41oDuejEea3pHldbKnIbs72jPE8ltdM2qKZtXalNKQ8FCVsABvr2eKoHkmJ1JBk2Q2KNcy06te+VZdslV+z+uxhDqXS/4snQ2uJDKj0lTWGEys0hcBsdRxmscnp8VgykfwZgIl9HE75MFWtwbDy3UuncaA9LntOkzATjOG6flNxBitywCI7NL2xP1ksoI+XSW3vOFcFjS0XRLLA14OZCyJeIcbInHEGmvaLRnFokGRCbz8KL9W4Pq7A0OJrqURsAnDZR/BgT6g== 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=nCWbtQtG/jHVt8ZvEcYD09vmg9GGM77SC1nl1WhjB0IZ2mYDo2WQWXQ8x3TR0QczCZunSehoR1c9jpUPB6BJ4XkDI8u+B9au3V+2TQTgr1+YBxLcwaXzT9nRJDLhMZSssAxi2w2jt2bStcfhp0kszu3uhAt8f850hW+AP6BeznLKB11pa477glr8SyUMfr5qfiq+6iaYMkngagKWOlYsxoAnPPBf106UowabQsad5kX12RorrbCoDaD+ACBH3lCr6hpDQBEarhSC+NoBpxBAIuemUkOU5/H6oxsO0m6NvXFPxepRN7TVHO+g6H4LgSHm3Fz+1/LG3XzLMJlz6d5Etw== Received: from BN0PR08CA0029.namprd08.prod.outlook.com (2603:10b6:408:142::15) by PH7PR12MB5596.namprd12.prod.outlook.com (2603:10b6:510:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Wed, 1 Feb 2023 07:29:29 +0000 Received: from BN8NAM11FT080.eop-nam11.prod.protection.outlook.com (2603:10b6:408:142:cafe::b3) by BN0PR08CA0029.outlook.office365.com (2603:10b6:408:142::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Wed, 1 Feb 2023 07:29:28 +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 BN8NAM11FT080.mail.protection.outlook.com (10.13.176.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24 via Frontend Transport; Wed, 1 Feb 2023 07:29:28 +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 23:29:14 -0800 Received: from nvidia.com (10.126.230.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 23:29:12 -0800 From: Alex Vesker To: , , , "Matan Azrad" CC: , Subject: [v2 15/16] net/mlx5/hws: rename pattern cache object Date: Wed, 1 Feb 2023 09:28:14 +0200 Message-ID: <20230201072815.1329101-16-valex@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230201072815.1329101-1-valex@nvidia.com> References: <20230131093346.1261066-1-valex@nvidia.com> <20230201072815.1329101-1-valex@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT080:EE_|PH7PR12MB5596:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b4dc39c-dc9b-4237-4bfa-08db04260d91 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: 2Hy9oqY5L5WZKTjlytWYedcg0GvLPu4Wzgc5wXWPb8j1EtrUq0fkOQFoJQYJwpHZM3OXojO2cI2EQ4z0AYxl0zStM0/NIupM4xZGocK6kdjieaz6J00jZw5RUCy/wQLcHQ6FZuRF4ppQvyHkdFxdBJ8yvCp9MAn950WVEE7+dcH1Z8X3bwrOcjA7t9ab/rXz85RBo3hb88Dxruge2E4BbQejVcGqG12wkrwIYfLcvIb0rSG/d+auspSqgBacpls29GxeTgCFNJvZoa6oW6QlTLDReuvCUvvZyGL/tdBVjPTdRiBnrMja0MjEvKKfA7iaMmxsp+/Wqe6CMkGPiHXMTAUQkNR/szGauVhfQgexXPJWBR4Nav28f0gQcJfZqwsJm1VLO8MbpzIgY2PoktmiD4e7r4W8tvyGFGBWRZUFT553QNU1wEklz4jy3TOSAHK5yFRZohjSYZoolBDrKzUtPN5HSnI8v3RnNc8nkwItPGuMKRHLQ9cI4FTki2C100Hsdn315X+DEqHtpqVmnoCV8A5H06fRmwHKDKT7Zx1Yd6DTlVHcekIPDBCTnPWLBwlQ48al/P28LjKVw0hNZ+c1BVc5udpo8mrozNn/KyopZvQH/+FLqua9GzK5o0lexD3lt0aD3Id6oCV6fKkGChJ4mXGm7W+6Sa5kCEtqEX4tzOr6cizsfne9MVML6+FY9feuex9vBiKfoQtDxSI2l0nZnw== 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)(39860400002)(376002)(346002)(136003)(396003)(451199018)(36840700001)(40470700004)(46966006)(478600001)(8936002)(36756003)(5660300002)(4326008)(8676002)(70206006)(70586007)(36860700001)(82740400003)(83380400001)(110136005)(54906003)(6636002)(316002)(7636003)(7696005)(6286002)(16526019)(26005)(107886003)(2616005)(186003)(40460700003)(1076003)(82310400005)(41300700001)(356005)(426003)(86362001)(40480700001)(55016003)(47076005)(336012)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 07:29:28.4076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b4dc39c-dc9b-4237-4bfa-08db04260d91 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: BN8NAM11FT080.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5596 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