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 CFA22A0548 for ; Sun, 28 Nov 2021 15:54:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C37D04111B; Sun, 28 Nov 2021 15:54:51 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by mails.dpdk.org (Postfix) with ESMTP id 95F5B4111B for ; Sun, 28 Nov 2021 15:54:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VjmqwI25w3vDHmKwq9ny81JcALIOQtCNOhQ9DmA370Yp2tUUlRgaxPuXCqGZyRYEUs/zA4MnjZG49Ei9UBeKhYJXNfD+VhR1/f3V4T3WMcDLrrT80Lz5b/OTgdypfZacCruSYLuQ4GDSjiZ2TAp/r0InAK0ctzNndxO1PKZN7BKYpfNV4/0BeGBC9ai9ednD7R1ZBNNn4tWtuIOxaif23AmR1WLnUyLzJMphL1AjZEuk91ehNJHGk8y2Wy8qjbR152Z8Z+6PO8oZYH7IcTF/xN1VRsvTOtDAvnRJMkb60mAc1Q1qr0j038kEhZPgXEp3V0T3ntSaNY+4rYOrwy99kg== 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=HvC/eI/hDmaKN22P2xDFhFsPKS7+HWO/uROePB6PJ8U=; b=axIJhFAiXLPP/Cgv5Zcz0nGf/JJndkfzGVC1rsNWCH/VZUOZ9MUXLle2DlzooPafclSRNmf3ksoailW3xIpTvJcIfrYL92xLWuBoasaeIFbtv3DxH9wOvaLhQPlOo/maqr3HKCAM6BSRpCC8hYtwFcvz93StPpsactu5EmKYHY4V2GBBJm8aRjWc40hgQrB3LOCaHJNr3ZOYkcyM4xcaOG54WQJ72rLk2z91qYVQdbefQCGfLfi+Y/sjBDopwYIVSViqUY6ygIiQf8HRQhsSYniaQr27ccy4wPR5mXV5lkm6xQxUJv2NQh+SIl2nNFJ6D+UEkU4H8c2AICh4291+gQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org 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=HvC/eI/hDmaKN22P2xDFhFsPKS7+HWO/uROePB6PJ8U=; b=jK3eaEh9g6ilKFm7bol9l138Z7AAik/bOK7aSBidHRjWGhQaCBFflxq9I4dCY38eW48MfU7Z2FkJU/aJFPa5D7bRc8l615PCQuFF5wjxRJFXB6HJIvbaaUUME+QY0H6zWJpHcWMWSkRR0K1NkGeLnaM3cJb1Cfg1je2OAZzksiOwcPSpTCcHAQkkfRTofd8I5pYHhMnhvuvasq8HgipNRtVsIdckxgSs8TUVS2D/AtqaNSVMaAkFGhpnOQAaW0OZlHHLhgMqa4eu2kYESu3l4WIdXrbJBuuu775YjGCwmd9y2s6jo/Zem0IQhFeLzdC041V+rUasMC3/NQS+PRx2UQ== Received: from DM5PR17CA0053.namprd17.prod.outlook.com (2603:10b6:3:13f::15) by BL1PR12MB5109.namprd12.prod.outlook.com (2603:10b6:208:309::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.24; Sun, 28 Nov 2021 14:54:48 +0000 Received: from DM6NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13f:cafe::88) by DM5PR17CA0053.outlook.office365.com (2603:10b6:3:13f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Sun, 28 Nov 2021 14:54:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.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 DM6NAM11FT053.mail.protection.outlook.com (10.13.173.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 14:54:48 +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; Sun, 28 Nov 2021 14:54:46 +0000 From: Xueming Li To: Michael Baum CC: Luca Boccassi , Matan Azrad , "dpdk stable" Subject: patch 'common/mlx5: glue MR registration with IOVA' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:53:05 +0800 Message-ID: <20211128145423.3974892-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@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: 7308d27d-edb1-40c8-feb3-08d9b27f0635 X-MS-TrafficTypeDiagnostic: BL1PR12MB5109: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 90PuEIR2VuTJ5jXPtTtgm7p/03RLgyCzupo+dGd05gWEVkUeJhDi6QX+3s6W8O8jW2ZHD6mZZkL4qIWjDLO3+czQJuO9vPS0Kp4qFZaQetXQLDMkgcq2gAX83BHFaOKQNzMuMiCs28XeW+Bti4uKRfnIoIB+ncnwj22BAI2b7MvYJF/ustuDrpQ3TJykCuHeNuNiMDiQJSq6FLRlL+4T6ldOAziC67rMVtLCFF7oL1v2rriULoWFrPoJ1f4D2nfnGyk9+Qmwb25aKKxXGKlriQsyKZa8CN/2CaaZ+AWE+MMOf8YIXHi96tU7X63/ZJhuCy3wS449wZIJbuSS+w4V5TGlheF/CHXIbGpSVLNc4bLvyPC28DlLZ3zjseQ28tU/Qoloaj/ovEQWpXPARCNzoNtqX2Lar1JBl2RBqVLvQKYy3aYprZ9TZTA8jKeKLp1CUTTKxHkQUqO2DsjRRwsjayc3dno/xXqKNHEcR/fpmB7YO8+A9gOs+U3OHUzVoCvL51OKqBd8gP6slnkLYjEhv27Rt7DJ7thheY4St4OP1nPilrnGMIdiYIDMMBT010EV8nK4RvLbxA2pF3Wt5Fkpu2HJ9FVheMJrvvtqdLRFiYMTa6XdSQUhQ3dRdgj7SSqpQ9gboRZj9/Ee4b8lbuc8QSR1R/nv0L3sC+5AHfBlpBx/9G+WIZl0k/o+JB5ToefGn44BTmJymvy9wPgRm6z0+3YM3WzHznNck0hTDx09h4pxhNpZO4cEIPSNLZdBVYb0vvpPu3UeyjTqC+D7cB4z2214Kh+FakqpYYixNkqjPRT/EuSoJmTnIRYNvRrGmEVTwDpEBmCTAAnYrtQqMqnp3A== 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)(2616005)(6286002)(6666004)(336012)(8676002)(508600001)(7696005)(356005)(36756003)(4001150100001)(426003)(7636003)(966005)(2906002)(6636002)(55016003)(16526019)(82310400004)(26005)(5660300002)(186003)(70206006)(4326008)(70586007)(8936002)(36860700001)(316002)(1076003)(54906003)(86362001)(53546011)(37006003)(47076005)(6862004)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 14:54:48.3319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7308d27d-edb1-40c8-feb3-08d9b27f0635 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: DM6NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5109 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/2991d7abc22335185b28558708a171612a581d22 Thanks. Xueming Li --- >From 2991d7abc22335185b28558708a171612a581d22 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Tue, 9 Nov 2021 14:36:08 +0200 Subject: [PATCH] common/mlx5: glue MR registration with IOVA Cc: Xueming Li [ upstream commit 6ebd062e0602f0571cf9abbe9eabd0e5f6ad0a39 ] Add support for rdma-core API to register IOVA MR. The API gets the process VA, size, and IOVA and returns a memory region with space pointed by a specific IOVA. So any access in this MR should come with an address that is relative to the IOVA specified in the API. Fixes: cc07a42da250 ("vdpa/mlx5: prepare memory regions") Signed-off-by: Michael Baum Signed-off-by: Matan Azrad --- drivers/common/mlx5/linux/meson.build | 2 ++ drivers/common/mlx5/linux/mlx5_glue.c | 18 ++++++++++++++++++ drivers/common/mlx5/linux/mlx5_glue.h | 3 +++ 3 files changed, 23 insertions(+) diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build index c2d580c4a6..43d70c1324 100644 --- a/drivers/common/mlx5/linux/meson.build +++ b/drivers/common/mlx5/linux/meson.build @@ -188,6 +188,8 @@ has_sym_args = [ [ 'HAVE_DEVLINK', 'linux/devlink.h', 'DEVLINK_GENL_NAME' ], [ 'HAVE_MLX5_DR_CREATE_ACTION_ASO', 'infiniband/mlx5dv.h', 'mlx5dv_dr_action_create_aso' ], + [ 'HAVE_MLX5_IBV_REG_MR_IOVA', 'infiniband/verbs.h', + 'ibv_reg_mr_iova' ], ] config = configuration_data() foreach arg:has_sym_args diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c index 09fdce1c22..97ac5d3b5e 100644 --- a/drivers/common/mlx5/linux/mlx5_glue.c +++ b/drivers/common/mlx5/linux/mlx5_glue.c @@ -224,6 +224,23 @@ mlx5_glue_reg_mr(struct ibv_pd *pd, void *addr, size_t length, int access) return ibv_reg_mr(pd, addr, length, access); } +static struct ibv_mr * +mlx5_glue_reg_mr_iova(struct ibv_pd *pd, void *addr, size_t length, + uint64_t iova, int access) +{ +#ifdef HAVE_MLX5_IBV_REG_MR_IOVA + return ibv_reg_mr_iova(pd, addr, length, iova, access); +#else + (void)pd; + (void)addr; + (void)length; + (void)iova; + (void)access; + errno = ENOTSUP; + return NULL; +#endif +} + static struct ibv_mr * mlx5_glue_alloc_null_mr(struct ibv_pd *pd) { @@ -1389,6 +1406,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) { .destroy_qp = mlx5_glue_destroy_qp, .modify_qp = mlx5_glue_modify_qp, .reg_mr = mlx5_glue_reg_mr, + .reg_mr_iova = mlx5_glue_reg_mr_iova, .alloc_null_mr = mlx5_glue_alloc_null_mr, .dereg_mr = mlx5_glue_dereg_mr, .create_counter_set = mlx5_glue_create_counter_set, diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h index f08c83768c..d48a06d443 100644 --- a/drivers/common/mlx5/linux/mlx5_glue.h +++ b/drivers/common/mlx5/linux/mlx5_glue.h @@ -196,6 +196,9 @@ struct mlx5_glue { int attr_mask); struct ibv_mr *(*reg_mr)(struct ibv_pd *pd, void *addr, size_t length, int access); + struct ibv_mr *(*reg_mr_iova)(struct ibv_pd *pd, void *addr, + size_t length, uint64_t iova, + int access); struct ibv_mr *(*alloc_null_mr)(struct ibv_pd *pd); int (*dereg_mr)(struct ibv_mr *mr); struct ibv_counter_set *(*create_counter_set) -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:03.641565773 +0800 +++ 0001-common-mlx5-glue-MR-registration-with-IOVA.patch 2021-11-28 22:41:03.183543455 +0800 @@ -1 +1 @@ -From 6ebd062e0602f0571cf9abbe9eabd0e5f6ad0a39 Mon Sep 17 00:00:00 2001 +From 2991d7abc22335185b28558708a171612a581d22 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 6ebd062e0602f0571cf9abbe9eabd0e5f6ad0a39 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 2dcd27b778..7909f23e21 100644 +index c2d580c4a6..43d70c1324 100644 @@ -28,4 +30,4 @@ -@@ -200,6 +200,8 @@ has_sym_args = [ - 'MLX5DV_DR_ACTION_FLAGS_ASO_CT_DIRECTION_INITIATOR' ], - [ 'HAVE_MLX5_DR_ALLOW_DUPLICATE', 'infiniband/mlx5dv.h', - 'mlx5dv_dr_domain_allow_duplicate_rules' ], +@@ -188,6 +188,8 @@ has_sym_args = [ + [ 'HAVE_DEVLINK', 'linux/devlink.h', 'DEVLINK_GENL_NAME' ], + [ 'HAVE_MLX5_DR_CREATE_ACTION_ASO', 'infiniband/mlx5dv.h', + 'mlx5dv_dr_action_create_aso' ], @@ -38 +40 @@ -index 037ca961a0..bc6622053f 100644 +index 09fdce1c22..97ac5d3b5e 100644 @@ -65 +67 @@ -@@ -1412,6 +1429,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) { +@@ -1389,6 +1406,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) { @@ -74 +76 @@ -index f39ef2dac7..4e6d31f263 100644 +index f08c83768c..d48a06d443 100644 @@ -77 +79 @@ -@@ -197,6 +197,9 @@ struct mlx5_glue { +@@ -196,6 +196,9 @@ struct mlx5_glue {