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 51105A0C4E; Mon, 8 Nov 2021 18:21:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A5C940E5A; Mon, 8 Nov 2021 18:21:52 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by mails.dpdk.org (Postfix) with ESMTP id 106DB40040 for ; Mon, 8 Nov 2021 18:21:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TyWysRmQK6OYY3Emsy6ui3bU8xBADQcM4xNpl8QbJ3YWQlqpAyEq68ti+vCujNfNfOiYf9iGN0c1cuNUs0XMsvH49kxEIz7RhCmdtkZvBeHmz9yQPH+dhyiOfdXt6VWeUTm3I48oZnrFLyf9I9bIwGOMke8sM0lAO/q4zVKCfXp++zgV6+T7Z1E9A26kK/hclkxx27nv4Tj6n6G3yR936ZG+yj98X1odWKglW85ElVGFOr3/zISaK2xG65RtxaCQgpJ4zyzgJwcouu9KMLdUbyMR69RWwNqID31d68xKss16/yw2Wa/dRlJwdus6x8CsAZ/d6p/pvdANW98jy+XdAQ== 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=2qISvfsLe/LbBjEGB2Dc56RBwIkkyERgLsYjZ3d3OiM=; b=eIT5sz/Lwfm7ROeBisquzcAeF0cO/LTTCXLhqXfMmuy/ouPkusXGRozNXAL2KKtoNkgLn+Tijjj6lDlHc1mFXTQ8YndXeqKYHSFhNtocfORY9waxiK+D4PmLAh1H+3PADSGOMMDnL2qB2tHmmpfXh3VqzuQr3z7JMLGQ+lmQ/Ns2yHDTyhVLpYhNB7leVeDsIFuOE+bwWbl4YrRyxxLiH97A33GfnWbie/OaABetW2Io+Nam3okME/nPp398h3bsC59yJ1sieGcyalID8yMqWOgqWtlcL3p7TN1ix4F+n8FApTJ1AQjbL0JgGuifUw+7dIumRY8YshjrovZsQEcvBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=2qISvfsLe/LbBjEGB2Dc56RBwIkkyERgLsYjZ3d3OiM=; b=QPJLG48f5IPNk3viSkuVzbIt8PpBrOFdQvF54IZSgIO+83vFdN370RerMQdP/UaHbgBgHNI/CeL9HkbveAjFE3Ohbs8Hjat6BJLuUspcpWeoxYzEPgZMwJzqR7F9XlmsKyFrPINEyqY5cjn9jUnizum+5aSK5MFnV3JzI8TlCEj3rYdRMOcR9BWPM6MttDBeCAgPutdolU/o8Xo7UBer4sTsL8IFVCASyF/1QsER55JkPZCkbts9CAEjllg4wVBm/TGTJjwC1eqsNCEDmNPZ/h8u92xABa5g9KCxEhps2K2yjqaoyBOKG/P0QH22I1xOv7e8vM8ghfeBXSn52aF5lg== Received: from BN9PR03CA0290.namprd03.prod.outlook.com (2603:10b6:408:f5::25) by DM5PR1201MB0250.namprd12.prod.outlook.com (2603:10b6:4:54::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Mon, 8 Nov 2021 17:21:49 +0000 Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::85) by BN9PR03CA0290.outlook.office365.com (2603:10b6:408:f5::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Mon, 8 Nov 2021 17:21:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT054.mail.protection.outlook.com (10.13.177.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Mon, 8 Nov 2021 17:21:48 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 8 Nov 2021 17:21:34 +0000 From: Matan Azrad To: Viacheslav Ovsiienko CC: , Thomas Monjalon Date: Mon, 8 Nov 2021 19:21:08 +0200 Message-ID: <20211108172113.2241853-1-matan@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211107152919.2158802-1-matan@nvidia.com> References: <20211107152919.2158802-1-matan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ea723d2-a77c-4f50-1c25-08d9a2dc3f42 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0250: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NDK/wGmDZfdNBS88Jk4eM0NVCYMyeciKX+6w1oU1vhSWOIL0XVlzDx4Nf0B/6zbZNXHgixq0H92IPL6luvZuXHAzfXfXP7+E7lGGTBJ1ig2Xf5Akzb4JYqmOxL1AJtKkcRZ1B71kwI4btDbNzufhpx0HxJpASfjKA9yKa8GrYPoBsRCUO558jHe9jYv5N8OurzxKDcxvxGtLBgQWPKeryFTlI+4YTdHQga+0BwbIdGA5uoZWbs+T1zAI9xYdIDsidepbxz2CxxMjzgmE4TseGlTxzkzq8v3gnn0yGeAw/cGvMjuT0JzCeBbOFdbffm896DCVGBvAiUJxbqki8e9DLfR8Czb2/REk2N2q+6irH4D4tHqMUfIo3iIqvpOvqMUaePslXOcx6jyXqTl8aht5tFrnb5QIyy/36/lPEHIghJ75NruiB6uVEA6x+3XUFwnJLthjdQHMGi3HQpIjuNmCyyVzvyuROeRw2PaF3XSG+ubDwqDnMDlpzpXU48Z7WWNh2ZSMjs6Po9FrAtK6Vip7n8mGmMFQPhn8EC0iNELwVJ6JZV0BBtQScEMM1neJyINis/dEUSeWnVWEXSmvFzmMXD7JPVH4ZGKb9bBtjpKhQKbw6alS5E5M6+CEIm2dF7omQd37XqNZrgePEwIJQKdcsA+eKdbkhrUdClfHDZo/GARPoVBlqfWFcnlUjJk+oVSS3Y/JvVr/pa/aRe4aBPqfUg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(70206006)(37006003)(36906005)(426003)(83380400001)(2906002)(70586007)(316002)(6862004)(4326008)(186003)(16526019)(54906003)(26005)(47076005)(86362001)(336012)(7696005)(6636002)(55016002)(8676002)(7636003)(36756003)(8936002)(82310400003)(1076003)(6286002)(36860700001)(5660300002)(356005)(508600001)(2616005)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 17:21:48.5668 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ea723d2-a77c-4f50-1c25-08d9a2dc3f42 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0250 Subject: [dpdk-dev] [PATCH v2 0/5] mlx5: workaround MR issues 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 Sender: "dev" The mlx5 PMD uses the kernel mlx5 driver to map physical memory to the HW. Using the Verbs API ibv_reg_mr, a mkey can be created for that. In this case, the mkey is signed on the user ID of the kernel driver. Using the DevX API, a mkey also can be created, but it should point an umem object (represents the specific buffer mapping). In this case, the mkey is signed on the user ID of the process DevX context. In FW DevX control commands which get mkey as a parameter, there is a security check on the user ID and Verbs mkeys are rejected. Unfortunately, also when using DevX mkey, there is an error in the FW command on umem validation because the umem is not designed to be used for any mkey parameters. As a workaround to the kernel driver/FW issue, it is needed to use a wrapped MR, which is an indirect mkey(created by the DevX API) pointing to direct mkey created by the kernel for any DevX command uses an MR. Add an API to create and destroy this wrapped MR and use it for any control DevX command. v2: - fix compilation issue on Windows. - improve logs. Matan Azrad (2): common/mlx5: add wrapped MR create API vdpa/mlx5: workaround dirty bitmap MR creation Michael Baum (3): common/mlx5: glue MR registration with IOVA vdpa/mlx5: workaround guest MR registrations net/mlx5: workaround MR creation for flow counter drivers/common/mlx5/linux/meson.build | 2 + drivers/common/mlx5/linux/mlx5_common_os.c | 56 ++++++++++++++++++++ drivers/common/mlx5/linux/mlx5_glue.c | 18 +++++++ drivers/common/mlx5/linux/mlx5_glue.h | 3 ++ drivers/common/mlx5/mlx5_common.h | 18 +++++++ drivers/common/mlx5/version.map | 3 ++ drivers/common/mlx5/windows/mlx5_common_os.c | 40 ++++++++++++++ drivers/net/mlx5/mlx5.c | 8 +-- drivers/net/mlx5/mlx5.h | 5 +- drivers/net/mlx5/mlx5_flow.c | 25 +++------ drivers/vdpa/mlx5/mlx5_vdpa.h | 9 ++-- drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 37 +++---------- drivers/vdpa/mlx5/mlx5_vdpa_mem.c | 43 +++++---------- 13 files changed, 174 insertions(+), 93 deletions(-) -- 2.25.1