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 6CA2B43238; Sun, 29 Oct 2023 17:32:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BBE1640A75; Sun, 29 Oct 2023 17:32:41 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2054.outbound.protection.outlook.com [40.107.223.54]) by mails.dpdk.org (Postfix) with ESMTP id B1A79406FF for ; Sun, 29 Oct 2023 17:32:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A6EeM5xSRFbyds+Fyd/FNo4nT0BmK8e1GW4FRdZa4IGJxJtYZRptuhfjIEyk1eLxcthYyYNnf1qK1Qgi6oi5YIYp3R9J6XTN4d/xMmYi/W6QGB2x6eqN6Yf3mnxrMVhLK13tj4ucMTzJuJkjW/t0MTdlyyYB1NoR/NkYYpT0m7823qUKZZJUPQz2e3MPhxijw+ypzB8jR7y6TGfN91iCbyRgu519Sbpr/3Jy3mcRJe80S9bkUMwOEDeYlaR6lzu66lLOb3wnczBCy0oi974O66S32Mw18uRT86ocFsIkhOedPsWISetAq9GY59Np5wmGU9f/8G9d8eLLBwszFeP1cQ== 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=cTKKzOBMqc+xecALtf391Gi07dCBbhVRf0tV7UVdOYw=; b=gFvNZ1ivJjyvFwQYYh2JLvj5ybsQq+QFJdkpUuUvLtVCu+iJ0QZIdORZDzGffw1hHNoNS8ufHpLzFPO4KDpBGAHTC+03vGxTKN25jE0vvQh1XDELkjNc2H6fqQYx3lKUKjgoFI8+9UszT1+vmS3g+sERHLEZyQWwZL+V0r+gTPSJ3YWH3RDZfjhxnMTVbTAbu808ApbyKDKqrmIhhj+n5Jj239uRT1N+t0rDXAZMGJDMo2rSdUyafSXEiUyenRxB1zvcewRPyEKIjW8aVPXRDq0GcBkERPG1LOBc0CjFs01ddmJF9a7eJXCTSFpgNb5BxJB7bdTjvXAEMLaVxHugog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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 (0) 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=cTKKzOBMqc+xecALtf391Gi07dCBbhVRf0tV7UVdOYw=; b=MHXl61OS0m5QuJZlntf2C+ihrlzxHA+XYQcWHFSs2cwhRE7mlQEiqwqZZ+/fa0p7eDXbBGc8KHmoQQ821A2NjQRUldZDvh2eERbmoXUsWFKlFhXhoaDr0roYmj6Cts89HOBvh9izhvsOHNR/8bHcsIKDJCE/V5etS78ZLZ10zEPuvnVm/QfjHGGkNKDYfLkAS3nucg/NDQmV0PLAabOyrpoMs8n7NMRNpjWrCVH7om7s90FLOVSLMXhJijqdmWLTDMwJfwXa2GIfLr48qS3ol08MJSyQsQxpD+tnY1I6zQ5sbyLbSNd5s10Tse+oItqYSgbFfTrocRbQ6xti8pgsfA== Received: from BL1PR13CA0106.namprd13.prod.outlook.com (2603:10b6:208:2b9::21) by PH7PR12MB8121.namprd12.prod.outlook.com (2603:10b6:510:2b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.26; Sun, 29 Oct 2023 16:32:38 +0000 Received: from BL02EPF0001A0FD.namprd03.prod.outlook.com (2603:10b6:208:2b9:cafe::4f) by BL1PR13CA0106.outlook.office365.com (2603:10b6:208:2b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.15 via Frontend Transport; Sun, 29 Oct 2023 16:32:37 +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 BL02EPF0001A0FD.mail.protection.outlook.com (10.167.242.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Sun, 29 Oct 2023 16:32:37 +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.41; Sun, 29 Oct 2023 09:32:26 -0700 Received: from nvidia.com (10.126.231.35) 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.41; Sun, 29 Oct 2023 09:32:23 -0700 From: Gregory Etelson To: CC: , , , "Ori Kam" , Matan Azrad , Viacheslav Ovsiienko , Suanming Mou Subject: [PATCH 03/30] net/mlx5/hws: Definer, use flow_hw_get_reg_id_from_ctx function call Date: Sun, 29 Oct 2023 18:31:35 +0200 Message-ID: <20231029163202.216450-3-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231029163202.216450-1-getelson@nvidia.com> References: <20231029163202.216450-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] 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: BL02EPF0001A0FD:EE_|PH7PR12MB8121:EE_ X-MS-Office365-Filtering-Correlation-Id: da3ffa6c-996d-4449-43c3-08dbd89ca9d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sk9liCAQ/CEzpSYCSm/n6UsfvsdtCO4IVrcaAr32lO75EVozHOS7xHdxuIdChBjidpssyISuaDhwx2Voyzcrq/RXSjHBaPazv6oQbVivHMJyPwNOKVuCI9a/i3r/X3whVWVFHXSGNRNsEj3nlH3OZ/+i9Q3PQW67mAdEvUfwEaitm19X9C4Rds3eCMNS6RJPsmGeV/IEUptHuAlRi+iSnFofJQqgenK2SUIBLA8SRgtgJU9svGpENHCUuWxeML5ndpc1NeIQvy2tThzUlRIR5q+sBghN2CP9fJIQ5vdQRZxWBknLm9EbMnzcq25NdguQHU/4bz2XOj+lDqjUx2LeGEMyhOHZjk6Y3Whfk3zM9eGldrBhJBiQge0Nr6EDyUbGhDPAXK8XNDx3DS16YJ1+mPSHIXEc9Aod8L3nyavnhYxjoqym9mQTyQpah5dbAfEiQYvJdpNvXE8pHxTglt3eEAcw4CrrL1BGXSqET3unETt96AhqbgxCkEYBJneY8b6+baiV2E9xtJeUGV3qqOELZbmoKDURQRjOfxoPnlsahw6rW/3Au3ttGvcUeMdjf1pJNulTjKuJnUKq6dV3PUviALPECntgfbVRlP3taiFL0aedXhHFPi0YQlVj5bKkRUc17ryKCGccVnlOmEsfvfEzfN5Ih1g9tgDEqOitFEI+h7Cxh7Pp2GBbnOGDdcgBgyUNZErtL8wDn/Hggep4VHIm8FlBHXVA5faMNhDSGhpvt7jtYtnLxxQHcxdgK3Kh14qV 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:(13230031)(4636009)(396003)(39850400004)(346002)(136003)(376002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(82310400011)(36840700001)(40470700004)(46966006)(2906002)(86362001)(41300700001)(4326008)(8676002)(8936002)(5660300002)(40460700003)(36756003)(478600001)(55016003)(40480700001)(47076005)(7696005)(6666004)(1076003)(107886003)(7636003)(6916009)(54906003)(316002)(16526019)(6286002)(26005)(70206006)(336012)(426003)(70586007)(82740400003)(83380400001)(36860700001)(2616005)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2023 16:32:37.6653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da3ffa6c-996d-4449-43c3-08dbd89ca9d2 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: BL02EPF0001A0FD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8121 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 New function call `flow_hw_get_reg_id_from_ctx()` matches REG_C register to input DR5 context. Signed-off-by: Gregory Etelson Acked-by: Ori Kam --- drivers/net/mlx5/hws/mlx5dr_definer.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index 75ba46b966..0f53c1e3b5 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -1448,7 +1448,9 @@ mlx5dr_definer_conv_item_tag(struct mlx5dr_definer_conv_data *cd, return 0; if (item->type == RTE_FLOW_ITEM_TYPE_TAG) - reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_TAG, v->index); + reg = flow_hw_get_reg_id_from_ctx(cd->ctx, + RTE_FLOW_ITEM_TYPE_TAG, + v->index); else reg = (int)v->index; @@ -1508,7 +1510,9 @@ mlx5dr_definer_conv_item_quota(struct mlx5dr_definer_conv_data *cd, __rte_unused struct rte_flow_item *item, int item_idx) { - int mtr_reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_METER_COLOR, 0); + int mtr_reg = + flow_hw_get_reg_id_from_ctx(cd->ctx, RTE_FLOW_ITEM_TYPE_METER_COLOR, + 0); struct mlx5dr_definer_fc *fc; if (mtr_reg < 0) { @@ -1538,7 +1542,7 @@ mlx5dr_definer_conv_item_metadata(struct mlx5dr_definer_conv_data *cd, if (!m) return 0; - reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_META, -1); + reg = flow_hw_get_reg_id_from_ctx(cd->ctx, RTE_FLOW_ITEM_TYPE_META, -1); if (reg <= 0) { DR_LOG(ERR, "Invalid register for item metadata"); rte_errno = EINVAL; @@ -1748,7 +1752,8 @@ mlx5dr_definer_conv_item_conntrack(struct mlx5dr_definer_conv_data *cd, if (!m) return 0; - reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_CONNTRACK, -1); + reg = flow_hw_get_reg_id_from_ctx(cd->ctx, RTE_FLOW_ITEM_TYPE_CONNTRACK, + -1); if (reg <= 0) { DR_LOG(ERR, "Invalid register for item conntrack"); rte_errno = EINVAL; @@ -1889,7 +1894,8 @@ mlx5dr_definer_conv_item_meter_color(struct mlx5dr_definer_conv_data *cd, if (!m) return 0; - reg = flow_hw_get_reg_id(RTE_FLOW_ITEM_TYPE_METER_COLOR, 0); + reg = flow_hw_get_reg_id_from_ctx(cd->ctx, + RTE_FLOW_ITEM_TYPE_METER_COLOR, 0); MLX5_ASSERT(reg > 0); fc = mlx5dr_definer_get_register_fc(cd, reg); -- 2.39.2