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 B7413A034F; Tue, 9 Nov 2021 13:37:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50A6641104; Tue, 9 Nov 2021 13:36:52 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2069.outbound.protection.outlook.com [40.107.237.69]) by mails.dpdk.org (Postfix) with ESMTP id 2B178410F2 for ; Tue, 9 Nov 2021 13:36:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A3DeNUD+ZvrySFDH4PyNQsSHWy0Zt26eKGt52syDImHuSYd9NlLdejgo4EKq1P7SAyClwTH0wkKgWndP7ftn6hX+WyWEs9bYW5QGT1FUj1swZqfermxOTqV2mriRziOIUNHktafriFl7XPlJSEI0Tp3mE9WVCoN/pWNhsbua/w8nhIYS/UHlSSFfyxIsEvvCx4Rgdlh55/d2a1Ivo4P5zFq1e3sv9d7MyKmyx6JZXb20GOLIcPJelldL8TWegvp7N+M4neTHx0McIqSp//AAqD3vHeRmsf6aVL2mQwrFFqQKbz+0b7VIbN4Hng7kXC3HXI06WnJHKybrcp6Af2jt7Q== 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=AYXvHfiOQ0tjxnICzuOeu2j/E5o8rXyt2JxxVlhgeeE=; b=X0iz5a/FD1q21gLs48f6vBfoW2QPxDLFvc/IXXXFj90F9Erv6tNzjd/q/ulxhaj2XjkC0aMylJsJNTIUKVRBE7JHbYNDR77FBFFPXH9/JpDOA2ejBbTJT2Qz35tzJKdRL7TG0059dlS4+35DFyXJqdpBac4Tlkot+RCgVEu+MS/tws8wbavO3851XWrSFPUQi9V/vSgn5pp534lz4c+l6mn7sx5qJE3UWQQ7RqTei5X8ByaNAXekrrVQgcO0ebnhEkQWvEB7DG+yNVEV+ug5BMhzm6lgOxtxsge8G8dbEC3iAUU7IvV+bv68LTyvZPDLQd6roHwiDMnF1zbXj3I2iw== 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=AYXvHfiOQ0tjxnICzuOeu2j/E5o8rXyt2JxxVlhgeeE=; b=urSasGL7YhP45rd2K84WwSwOAKWrgi0kguaV0zDhhwJvsf0JWI7EB5uw4wJOwvuYImbbxNIODeHvpZhjNdU4O9Kh5LqHkh47Wb9i39+uESO9lz2xjiyDA46SZC6afdnyWwPVKaeQCwtdmknVp3M3ovn1wBzZkifgxiKQsR0CWxwqGgyL96PorbvFLI3TkFNqn3UvvlOa9domKynaI1MHlOwJ1t8Qn8LrYQg/2I6KQZepKWW/tw5sxQjbSq2CUt7rg0bdh7WMnfrFjockUZcWOvZKebxRvsB+vEDv8oTPuDZ8a/kmFo3Mr4stq/ARS/oIbTqExIAhjBN7PY/3WJ80Zw== Received: from MWHPR15CA0065.namprd15.prod.outlook.com (2603:10b6:301:4c::27) by BN7PR12MB2596.namprd12.prod.outlook.com (2603:10b6:408:29::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Tue, 9 Nov 2021 12:36:30 +0000 Received: from CO1NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:301:4c:cafe::78) by MWHPR15CA0065.outlook.office365.com (2603:10b6:301:4c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Tue, 9 Nov 2021 12:36:30 +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 CO1NAM11FT065.mail.protection.outlook.com (10.13.174.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Tue, 9 Nov 2021 12:36:29 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 9 Nov 2021 12:36:28 +0000 From: Matan Azrad To: Viacheslav Ovsiienko CC: , Thomas Monjalon Date: Tue, 9 Nov 2021 14:36:07 +0200 Message-ID: <20211109123612.2301442-1-matan@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211108172113.2241853-1-matan@nvidia.com> References: <20211108172113.2241853-1-matan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] 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: 404df86b-361d-4152-8cf3-08d9a37d8e27 X-MS-TrafficTypeDiagnostic: BN7PR12MB2596: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nw4SdLurtmG5mnhIEkxdFKuky20hwpjk2bojnwjZgdCbnNlQBBroYjRVshUqR7rtv1iY22ZDhmTry419RniFsr3gOUCVkNDT8lrGBJQjQZg3BastSOgseDe1o00cSZngUnLk9JN1AR5rJkwIWhYST6/lUrlp7FzF0K49qSdJRaUiCt+Oplsjtr52sWksNuqovxGfRZ+dWJU2eBCFLmTHV+d8gmtRbV4SUVhEXl9bL7Gxff4q+trOnpfzINsjWJ3mfyjf1uIBYIug+Y42kCQ+uN93rh2qPbWSRoTyFRrnpkNSuf8EIhEd6D3tKgG4W7AbRtA/dK4DZf+u62aFzQSwN3opdI85tGXWw+XAY0JysNH4RFKxL4COdkQ8d/8pwqviMKeoPHN/aYCPLJA2vtfKUldz5uZ4pnJw4ic2d39c3etnupxDr454QO2hoDcjO46qVN0jQgF4FNQFfZka5x1fU+tvZk/Ongu7IbyjmQUe+eV5i6+xrXNz6xWYF84pl2Ox9BaPBLgtOKa2Yj75Avjfp+f2mrvO+UZgQDxM03itYsL4cpJEU5sM5Wd0CY74cMlJxIbomzMEkX3Sf7CbX8vTBYou2dRQN7/TDjXSOf0HhMIwwpciyzcOQ5KSE1rKSHKtNn3bfeTLPFU4jPvgGpkDysTe8+P2E9OdYwVRA22svtped4P3YQmE8JXkb4EGceumx3MnToF/v0lGvUrFKpKt3g== 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)(36840700001)(46966006)(6666004)(26005)(186003)(16526019)(5660300002)(8676002)(36756003)(2616005)(4326008)(8936002)(47076005)(7696005)(7636003)(508600001)(82310400003)(54906003)(356005)(6636002)(70206006)(83380400001)(316002)(36906005)(336012)(86362001)(2906002)(426003)(55016002)(70586007)(1076003)(36860700001)(37006003)(6286002)(6862004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 12:36:29.9672 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 404df86b-361d-4152-8cf3-08d9a37d8e27 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: CO1NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2596 Subject: [dpdk-dev] [PATCH v3 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) created by the kernel. 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. Use this logic in flow counter query management and in LM. V3: Fix issue in 32bit compilation. V2: Fix missing implementation for 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 | 38 +++---------- drivers/vdpa/mlx5/mlx5_vdpa_mem.c | 43 +++++---------- 13 files changed, 175 insertions(+), 93 deletions(-) -- 2.25.1