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 7C98F43238; Sun, 29 Oct 2023 17:32:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FFD34067D; Sun, 29 Oct 2023 17:32:37 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by mails.dpdk.org (Postfix) with ESMTP id 33E51402E9 for ; Sun, 29 Oct 2023 17:32:36 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i8ZyaVO0Bh43DGfl7BBXEm+PfPsyp4iQ5FIR+4pNlH4j6xJjPJUAQ9xmCZS2HxzoPqr4KYurMRV8waJjhFECbBJqJgTHJr/gB7ODUZSoIUURGXlNrIRUxT38UaHhbA1tcYYX9pMnh2gFb7o4qVSoYplQ1UG6LmvacQy65OK6uLhqCw4/fZfifQCeWMBSakaulesrpJliRmjRzRgMK1N9wZUc94Mwewlqi8y0Be/HJVqIQE8U3BWQCpbM1uciVn4gH0GrRnT6ladvDyiv8TFIWEQfkimhoEirUw3YJhJIAl/ZzwsBnn6/d6n6PZQymmQkjyz2kVQJdUIPhR5q/3EXLg== 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=lJedk7XMylLnZVEIGW3YhE9NmxG/kF30b5rXL3oiz2w=; b=VWEDE0q3nckN8DvaSwd4lt+JmYpt1NWMDgC/7SlL4kA8CZt9j+HjjH9XR1A7a+6AS1gUshzMWJ4cIGOLuy3Mh3RVuV7S6pCGOG6Q12IVl3dG9aCP1YHva3nFUdMEliUH9PQYRdiPVYAJB9DcS790d5mnxCVNGrb/RgHGj9agnz6CMzIqXsl4kD6sBCEwhH4kBhSH0ruM6zbLPgmQPS5SM0ge1BNkW6G7SS++stUBeQzIVYfolt3aEsvepj3crD7UvMxQcjyT79flJeL+QpZT1rbSlC8MI4RsOzIoPVZA+lwlBY+7S1Iz0m/DPtzmnq+bFvy2Co3JlAbKcuc+N/DFsQ== 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=lJedk7XMylLnZVEIGW3YhE9NmxG/kF30b5rXL3oiz2w=; b=laVtpT7uignrAljeksFXziFJhup66p3nK00m9+MLyKbEdRJvkR3/QG//eIo5/8teTLeiQT4faAgdAt+HND79YVgplA7865MAZn51lEeHsAg7X/5mQPLo+D+/xEKVqk1RtAvXHySepztQ1HqBFWoDlSUa5ntc8Wq2MXoINgq1pmj6AHOv7R7lFnEf3Us9P1EDLgEi8/4zGknk4GA1fNxLNyrPDg+mxZmhaPDl77ZFe02OaDtC27/oD3E6MVv6yddFni0x87hoQOzFw828V5/XFwRwAheaXft9N0IXkQTkrjE6AZVr5A5QMhnBrjiND6tPunn8ysg2QvarwwBUGFxvJw== Received: from MN2PR16CA0028.namprd16.prod.outlook.com (2603:10b6:208:134::41) by DM4PR12MB5988.namprd12.prod.outlook.com (2603:10b6:8:6b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.22; Sun, 29 Oct 2023 16:32:34 +0000 Received: from BL02EPF0001A0FC.namprd03.prod.outlook.com (2603:10b6:208:134:cafe::a7) by MN2PR16CA0028.outlook.office365.com (2603:10b6:208:134::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30 via Frontend Transport; Sun, 29 Oct 2023 16:32:34 +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 BL02EPF0001A0FC.mail.protection.outlook.com (10.167.242.103) 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:33 +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:23 -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:20 -0700 From: Gregory Etelson To: CC: , , , "Ori Kam" , Matan Azrad , Viacheslav Ovsiienko , Suanming Mou Subject: [PATCH 02/30] net/mlx5: add flow_hw_get_reg_id_from_ctx() Date: Sun, 29 Oct 2023 18:31:34 +0200 Message-ID: <20231029163202.216450-2-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: BL02EPF0001A0FC:EE_|DM4PR12MB5988:EE_ X-MS-Office365-Filtering-Correlation-Id: 35863683-7117-4ebc-f2d7-08dbd89ca78e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dqZsdfFT1Dkr9KUOfw+R3NR3EbxRnDjAyAXE/AG7DmUCrlcScmYlnlHNG8ULQj6aytoyZLbaJbPN0C5PAlKkavPJp9VR52r6iKQOFPYWVMV1GixiGe4fb8XWTN6SHe2z0l5Ey3+OjnGZqnfOLUMvuVAj+eR5d7ThGbjYINzQcNeQsd0Op4619GrbPrjWQm4VM9aNCqvlyOj2Pqeve7m0LirCsZzNbdr2I0qFk+MUP3pR6OvFEQLcAQmp8zfl+W3392Nn7ImNDHxyBeSdNEHi6tk1wYgIedYaXwtDP5PPQCx2uyoJZkTCe08dVXPY0vEZFCv4gB1OFXffVZbVbiQ/TRBuDQVofGMYmXQOc03nRztukBGfU8cTruVMSTN5E6KdLMhqYNdDHf8FzccYwRMXVqu6cSYHMCiujSOgWSV++v0H8bpukGg6iizTffvxRDJhfs3/+7Y9y8EyOy4Ah3o2YuDAYjPk9SKOabrCxQQ3S6JRCfAVPwxofAWjUyxCsxRgZbhzi9O+4/Bs3LpoznUCH0sLi8PHShRyTAkLAQCRB76w9RjfKgYJU/TY9FBEiKe1DsjVfXB7ROg2421XWd1sTOi7hjDqI/T2GL1JCTpYQBzWN9QJAut1YACB8NmdETHW9LG/PPlWd4P9YQSo3E6dwqlBnsiS8F4ig4wGsLLxfRyY85/pamOMhCwyGL3zZntpzFgV6O9dI0r4bUAvI6D1S8579Tky4UwHhUcmoJjKFAcNG/caflpmTggMkUVoANoI 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)(39860400002)(376002)(346002)(136003)(230922051799003)(186009)(82310400011)(1800799009)(451199024)(64100799003)(40470700004)(46966006)(36840700001)(2906002)(36860700001)(47076005)(426003)(40480700001)(55016003)(336012)(1076003)(7636003)(107886003)(5660300002)(356005)(2616005)(82740400003)(86362001)(41300700001)(36756003)(316002)(70586007)(6916009)(54906003)(40460700003)(6666004)(7696005)(8676002)(16526019)(6286002)(26005)(478600001)(70206006)(8936002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2023 16:32:33.8843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35863683-7117-4ebc-f2d7-08dbd89ca78e 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: BL02EPF0001A0FC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5988 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 The new function call `flow_hw_get_reg_id_from_ctx()` maps input DR5 context and register type to REG_C register. Signed-off-by: Gregory Etelson Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 3ea2548d2b..92dfd9a3a4 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1711,6 +1711,28 @@ flow_hw_get_reg_id(enum rte_flow_item_type type, uint32_t id) } } +static __rte_always_inline int +flow_hw_get_reg_id_from_ctx(void *dr_ctx, + enum rte_flow_item_type type, uint32_t id) +{ +#ifdef HAVE_IBV_FLOW_DV_SUPPORT + uint16_t port; + + MLX5_ETH_FOREACH_DEV(port, NULL) { + struct mlx5_priv *priv; + + priv = rte_eth_devices[port].data->dev_private; + if (priv->dr_ctx == dr_ctx) + return flow_hw_get_reg_id(type, id); + } +#else + RTE_SET_USED(dr_ctx); + RTE_SET_USED(type); + RTE_SET_USED(id); +#endif + return REG_NON; +} + void flow_hw_set_port_info(struct rte_eth_dev *dev); void flow_hw_clear_port_info(struct rte_eth_dev *dev); -- 2.39.2