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 1B7F4A034F; Tue, 9 Nov 2021 13:23:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB22440E03; Tue, 9 Nov 2021 13:23:45 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2087.outbound.protection.outlook.com [40.107.102.87]) by mails.dpdk.org (Postfix) with ESMTP id 043CC4068B for ; Tue, 9 Nov 2021 13:23:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MFI2TpATCIVWbMNXc2zF9f8Qf2N26rm3Xamgx8mrU23c5Gvxf+yRqBiGJciE2NKCNMIZRFSgLmK17ymlXuVX+rj6NGyoi2Z6GTiYRckaCwp0zpHOuT4x1l+eOIb4dwPdkMyJWdQ5uod9QiBC0vwlHhpQgccUopJbqbB1oFdMFNhCiX4+Y21AfqNezcYi/E+Sq9P0ThyvVlFRt/Smwn7WEpExlXPVTLqMzifQUnswlktgMoOFi3ah8R7PH0ayHXjoojRb4pW7i3/ghudCt6nNCj6e33TsVETW//n2lvsSTILebd2qL4F8/DPumYFUDrG2gQ6nYo4+damVgpeuUAcaGQ== 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=VDwnEOPpHMHThHHZN2M/zs2t1JQa+YcdP5GbLfGK7m4=; b=m8lX2J2F01ckn9dDFZQKorHGTENXFGepVjEPiHe3VfQuhmOhO0MjVXhT2K5Qa+FkTLQ7SF2PU2gKD5hQaX9qSktv/JIVfRAjjg1kciIhd/lq0VChMGqRMolppBwq6alEbyPjX7rebiNZkcPXG1f1e8BVTvtezICJYKoXCuMnjHyc30QXFPdBnqhTRcR+nrYYugxco836CNOVh0wSln7OPzqgaooAfLpNA+7tTifWmoKV0GBq3Z8AWR3xcE4olZJ6Kl30fiijGIMX0vtDuIHbUEzM0QhEqI80ZkH04mJeyY9rSO0y4djhQ+NLJXWxojZr0+ADFGOzJlhV4TVc5+mCWA== 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=VDwnEOPpHMHThHHZN2M/zs2t1JQa+YcdP5GbLfGK7m4=; b=QTkQkp2old+LjBhU7KbgU2hVLZOckXeq1Fz4fkOkXmk2TdFlTYz5dMRX2yEMujfVUABagFtl59+2WtzATwmdT5dUly8KYgkaa0qq2wdfk47yI71zddzQY/1gkzpWLS4xkSlnjgDWMUbIHfeXc/zRxW6C2xvk3c5w3xfUTtfxybHO6YHGer76Dnb+l8hKah9sbpM0EpO1mvxTywWGRXo6d0EhpvKnOiXf6tvsdJA4rHTY4z0N0ujiSN4k18FBbBIDSH4QjmZ8EUiECOFAK529oqm/WmstN+T6O4eo4ffElh/CnHFSNXxovH4119PcUmpwooRJ1QcOhut4ObLIQmCJSg== Received: from DM5PR21CA0055.namprd21.prod.outlook.com (2603:10b6:3:129::17) by BN6PR1201MB0019.namprd12.prod.outlook.com (2603:10b6:405:4d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Tue, 9 Nov 2021 12:23:42 +0000 Received: from DM6NAM11FT050.eop-nam11.prod.protection.outlook.com (2603:10b6:3:129:cafe::dd) by DM5PR21CA0055.outlook.office365.com (2603:10b6:3:129::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.3 via Frontend Transport; Tue, 9 Nov 2021 12:23:42 +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 DM6NAM11FT050.mail.protection.outlook.com (10.13.173.111) 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:23:41 +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; Tue, 9 Nov 2021 12:23:39 +0000 From: Matan Azrad To: Viacheslav Ovsiienko CC: , Thomas Monjalon Date: Tue, 9 Nov 2021 14:23:19 +0200 Message-ID: <20211109122324.2300306-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.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 438819e1-c384-46d2-bf6c-08d9a37bc416 X-MS-TrafficTypeDiagnostic: BN6PR1201MB0019: 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: zcEXF9tpP0FIEvxbTi0P++OslYcoHm9/MnAxkkuTb0lGpYUFXlKpdR8f81ucoLaZSzC6peeG9/+I8FnUtQn0JggMAcQDa+TL1QoG4S6xkxrkUfQbCzct7YgwcAE6xYHimKIBUOaSo+dlixBgE/RXK3HeZyqm0u9862AM4QzONmPTwz8KGScu1uW5Re4XaCdhPq5znX/Hj5Hil73PWGAICDRXzaFtm3kjkC8lRp86m/s/oajNSKY4+j+g+i4AhslgzBqph6e9EoGqpXSPLWL8yZT5JU49C0LbKfPK1Pkl9VSvQr7I9uyuwSjyu3XSRKGKUaeUHa15TKaIFGF2WysoLi8z0/JC9TNZ/4YbYUaDK83jN0u4GXYZg5ucIV1uOymFzfgX3MGeBzcwH+0otOaYqC6J1tX0ChTp9Hh9KpavZUfmtTO6dgP4pDKkn+xo0hyn5N9CQ6L0RViEDCcS7uOJ1Ge6jYybRX6GY0d7p/BFwCEBHkDGeq6MaEJCJ7iuEBkDF8X5NOtLYtP/rJiTcPGZDkNA0me5Z2dSMMIK+hMv1kYEN+etqeAghGFBos2OITYLBORDh6ge+nre3co4wn3Tn/cAmcM6Wp/wJg0Na6bsoVX1OeFhp3Bo+QRjYzJ6awbMmzUISfLp7nW1x4t/CB9bb3UEmhkwZmNGwTZ+RyrMdCUcq95KroH6WR9vz5qR5FhmrBS+UULwGj14JfVZnNdw8Q== 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)(356005)(508600001)(36860700001)(7696005)(426003)(16526019)(86362001)(2906002)(8936002)(6636002)(47076005)(6666004)(83380400001)(1076003)(2616005)(4743002)(55016002)(336012)(6286002)(36756003)(26005)(36906005)(70206006)(8676002)(82310400003)(54906003)(186003)(5660300002)(4326008)(6862004)(37006003)(70586007)(7636003)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 12:23:41.4586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 438819e1-c384-46d2-bf6c-08d9a37bc416 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: DM6NAM11FT050.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0019 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 parameter. 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 for counters and LM management. V3: Fix 32-bit compilation issue. V2: Fix Windows compilation issue. 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