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 1F67542BA3; Fri, 26 May 2023 05:15:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4D7A4114A; Fri, 26 May 2023 05:15:43 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by mails.dpdk.org (Postfix) with ESMTP id 8C71540A87 for ; Fri, 26 May 2023 05:15:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HphENWiqSMUwvMHXXVWk0O1Vfngh/Pz5kUuNg43ma9fHXPubMe6en+Fi4Qd9umxkTMFPH6w9iUCBG9R1wSlC2ODy1g+7TFjjz93QevWd9RH7Z02elLBewRKuLJdV0YmyKqaHQ2vHwEmE4EU73OeR3/oRpjhvOxq6SMGZgMhTr/iuXTmogloB76GHoeaHcADvWvGVRliSfyuEzeWmN8xtuv9eY884XZ0Au2iw0drwlp2wZlVAAghZ7BCpk8Uc/sMLUn2W8Bet2Tb/UFrq6ET8hCiJEU6rlGBvq40aiTBzXxg9L9qSmmSWGqqupra2aLJCLP/R69RRaMgFx3igN7bUGA== 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=qrhr6JbVmVgkOPC42Lratv+TLSusXswEJEXXIrH/Tlc=; b=JfHtEHXPMODDC/j0V7MqYH11Aqjz4M5HJ5POv50nddZIv2gvEEvibcYpNh1mLKbKI5gEdaZlBcduzPtzrLrCvhmzToUU365EwOqMQNqvtFU2WjjYF+siFon8qgM0rMVuAwjlTTunS4HK35esE49OqSUGUH6af8oL1HpAeYSWwQH0sPc4+ThHTcxQWJbI+xet6M5s9OYidKpphLDsyom/Py/MUbRdNh7weSZsVQvEw3wb1SEtZYRTxCEbIFXujUu/u2ceHPs8PlUo01NUFVACHOp8pfga2Ld3izplHuy7ztiM4C/oP7mhiLQI/2puYnca1+Ib0zy2imdpo9DGw0nM6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=qrhr6JbVmVgkOPC42Lratv+TLSusXswEJEXXIrH/Tlc=; b=ESLWTD6eSO7ULGrxB+1QQaCFv+eyo4DmEogiLIiyIFw/01ZRJ3/H0Qk8fMPLkBHtDrfnHlejrwS9tqIytf+VlZVczTH+/0B7y5KsGwKHTn+TWbomUG5gWlBLm2Y4f7+9+pud+GN1A8u2W0NUq8xmjRGDwRX7VOz7UHthL1mBQjPvW6cxavKWII5bl8rOFlEJMW48Vsr0TBq0GzLLOUsJyCpNqc655sEmqEVZQVT5CHP2dbaoq5btNPQN8SydfL5AbPSQ1jC5Brb9R0lA/4t4g1fvJgdqa2j+H4Cq5YrV0hZUqhkewj8Fe/+z8WaLjowxerGNQSMKGkjWv4AyUhN8IQ== Received: from BN7PR02CA0005.namprd02.prod.outlook.com (2603:10b6:408:20::18) by CY5PR12MB6156.namprd12.prod.outlook.com (2603:10b6:930:24::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Fri, 26 May 2023 03:15:38 +0000 Received: from BN8NAM11FT069.eop-nam11.prod.protection.outlook.com (2603:10b6:408:20:cafe::6f) by BN7PR02CA0005.outlook.office365.com (2603:10b6:408:20::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.17 via Frontend Transport; Fri, 26 May 2023 03:15:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT069.mail.protection.outlook.com (10.13.176.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18 via Frontend Transport; Fri, 26 May 2023 03:15:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Thu, 25 May 2023 20:15:22 -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.37; Thu, 25 May 2023 20:15:19 -0700 From: Suanming Mou To: Matan Azrad , Viacheslav Ovsiienko CC: , Subject: [PATCH v2 1/9] common/mlx5: export memory region lookup by address Date: Fri, 26 May 2023 06:14:13 +0300 Message-ID: <20230526031422.913377-2-suanmingm@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230526031422.913377-1-suanmingm@nvidia.com> References: <20230418092325.2578712-1-suanmingm@nvidia.com> <20230526031422.913377-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] 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: BN8NAM11FT069:EE_|CY5PR12MB6156:EE_ X-MS-Office365-Filtering-Correlation-Id: 607df5d6-2254-4af3-86c9-08db5d977ab0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IwZ1FFqCmiRZFgXKaVJYv8lbjL9ZVSwGiRrNa6zzk6OFe45s8KecUbMwmu9j97sJcibn8lviPdRvuE+2WHoY8/MrHGtzKcYipte14jzRxFK4qYRq6BPkBOkfGbfQiUwvZ/XTzlNk3bi+6hfe3Znl5qvsiY8dJWfz5KYtJxq17kmMD+pnRzaUpPNu1lcEOM2CQPYrMG6tuTSpmCVQ+vkgsr+Ru4tetRZKnmXM+vEVFWuVAd4i8Ge03wqrplFvjhtRo60lwpw/5dEAZj9s8VB/eMbu9J08gwtu80vV7T7aK5NQk/GwdGb7F6gLxIXT1ECOiNj3b1Svmi8z2mRmLW0/HBZ3d4wkOLnLsyHM/hR9dKsQxGviCoBKtlGbIGkk5iayPcbJ2fmtZV/+WT3NpSIszX46tC2yv5oecnQyzxgNud5dXEtTqkpDNyK0voPFRYxyzliLYAS1nx7WZ934s6C6HAJPHZDFWcBNOTTE2hr+dNd/1f8cE3+NosoL8ZU7mBd0gIjJkMIHYDMP1VXJVJwccVu5p1fMhevfczMGNSxKcRkRaPbiVIq3uGBj/rA0gQf0u3EeqDn2o7ZY5gM6Fw9UOsHdk/GFEur8EwRcI/h3pjuVoobbGrrxdDiHpzE+mW7YBswVVWHPWE8aGEzaZoBGzM47FjMPCDng6Il0bSiyHv0nipe2Ur6xp3x0BkOANa4y0mKBTdyTDdp0t0eLH5RGXwifd8Eq+yOi8/lNwpHvjjHf7QtxmucJCuTDzh4dUYi6 X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199021)(36840700001)(46966006)(40470700004)(186003)(356005)(7636003)(40460700003)(1076003)(82740400003)(26005)(6286002)(107886003)(2616005)(36860700001)(47076005)(83380400001)(36756003)(2906002)(40480700001)(16526019)(55016003)(70586007)(70206006)(316002)(6636002)(4326008)(6666004)(41300700001)(54906003)(426003)(336012)(82310400005)(110136005)(7696005)(86362001)(478600001)(8676002)(8936002)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 03:15:38.1016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 607df5d6-2254-4af3-86c9-08db5d977ab0 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT069.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6156 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 In case user provides the address without mempool. Export the function to lookup the address without mempool is required. Signed-off-by: Suanming Mou --- drivers/common/mlx5/mlx5_common_mr.c | 2 +- drivers/common/mlx5/mlx5_common_mr.h | 4 ++++ drivers/common/mlx5/version.map | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c index 7b14b0c7bf..40ff9153bd 100644 --- a/drivers/common/mlx5/mlx5_common_mr.c +++ b/drivers/common/mlx5/mlx5_common_mr.c @@ -1059,7 +1059,7 @@ mr_lookup_caches(struct mlx5_mr_ctrl *mr_ctrl, * @return * Searched LKey on success, UINT32_MAX on no match. */ -static uint32_t +uint32_t mlx5_mr_addr2mr_bh(struct mlx5_mr_ctrl *mr_ctrl, uintptr_t addr) { uint32_t lkey; diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h index 12def1585f..66623868a2 100644 --- a/drivers/common/mlx5/mlx5_common_mr.h +++ b/drivers/common/mlx5/mlx5_common_mr.h @@ -240,6 +240,10 @@ mlx5_mr_create(struct mlx5_common_device *cdev, struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr); +__rte_internal +uint32_t +mlx5_mr_addr2mr_bh(struct mlx5_mr_ctrl *mr_ctrl, uintptr_t addr); + /* mlx5_common_verbs.c */ __rte_internal diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map index e05e1aa8c5..f860b069de 100644 --- a/drivers/common/mlx5/version.map +++ b/drivers/common/mlx5/version.map @@ -122,6 +122,7 @@ INTERNAL { mlx5_mr_ctrl_init; mlx5_mr_flush_local_cache; mlx5_mr_mb2mr_bh; + mlx5_mr_addr2mr_bh; mlx5_nl_allmulti; # WINDOWS_NO_EXPORT mlx5_nl_ifindex; # WINDOWS_NO_EXPORT -- 2.25.1