From patchwork Mon Mar 14 10:59:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 8578241 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 316049F6E1 for ; Mon, 14 Mar 2016 10:59:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5828F20411 for ; Mon, 14 Mar 2016 10:59:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68BB12040F for ; Mon, 14 Mar 2016 10:59:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932432AbcCNK7v (ORCPT ); Mon, 14 Mar 2016 06:59:51 -0400 Received: from [193.47.165.129] ([193.47.165.129]:37620 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752381AbcCNK7u (ORCPT ); Mon, 14 Mar 2016 06:59:50 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Mar 2016 12:59:21 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id u2EAxLBe008015; Mon, 14 Mar 2016 12:59:21 +0200 Received: from vnc17.mtl.labs.mlnx (localhost.localdomain [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id u2EAxL5W004336; Mon, 14 Mar 2016 12:59:21 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id u2EAxLsN004335; Mon, 14 Mar 2016 12:59:21 +0200 From: Yishai Hadas To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, yishaih@mellanox.com, matanb@mellanox.com, majd@mellanox.com, talal@mellanox.com, ogerlitz@mellanox.com Subject: [PATCH V3 libibverbs 1/2] Change rereg_mr API between libibverbs and the provider's library Date: Mon, 14 Mar 2016 12:59:06 +0200 Message-Id: <1457953147-4280-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1457953147-4280-1-git-send-email-yishaih@mellanox.com> References: <1457953147-4280-1-git-send-email-yishaih@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matan Barak Currently, MR re-registration isn't implemented in libibverbs. The only part which does exist is an API call between libibverbs and the provider's library. Since there's no way for a user application to invoke this API call, it's safe to assume it's unused. Similarly to other verbs (for example, ibv_modify_qp), a modification to the MR shouldn't change the user's handle. The current existing API is: struct ibv_mr * (*rereg_mr)(struct ibv_mr *mr, int flags, struct ibv_pd *pd, void *addr, size_t length, int access); As a result, this API call returns the exact same pointer it gets. Instead, we propose retuning a status int, which is far more useful than the current return value. Signed-off-by: Matan Barak Reviewed-by: Yishai Hadas --- include/infiniband/verbs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index d0c2969..709926d 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -983,7 +983,7 @@ struct ibv_context_ops { int (*dealloc_pd)(struct ibv_pd *pd); struct ibv_mr * (*reg_mr)(struct ibv_pd *pd, void *addr, size_t length, int access); - struct ibv_mr * (*rereg_mr)(struct ibv_mr *mr, + int (*rereg_mr)(struct ibv_mr *mr, int flags, struct ibv_pd *pd, void *addr, size_t length,