From patchwork Wed Nov 5 08:23:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Barak X-Patchwork-Id: 5232781 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A155CC11AC for ; Wed, 5 Nov 2014 08:23:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC0C120165 for ; Wed, 5 Nov 2014 08:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F364720138 for ; Wed, 5 Nov 2014 08:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbaKEIXW (ORCPT ); Wed, 5 Nov 2014 03:23:22 -0500 Received: from mailp.voltaire.com ([193.47.165.129]:34655 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750908AbaKEIXW (ORCPT ); Wed, 5 Nov 2014 03:23:22 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from matanb@mellanox.com) with ESMTPS (AES256-SHA encrypted); 5 Nov 2014 10:23:15 +0200 Received: from rsws33.mtr.labs.mlnx (dev-r-vrt-064.mtr.labs.mlnx [10.212.64.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id sA58NE6V019885; Wed, 5 Nov 2014 10:23:15 +0200 From: Matan Barak To: Roland Dreier , Doug Ledford Cc: linux-rdma@vger.kernel.org, Or Gerlitz , Matan Barak , Jason Gunthorpe , Sagi Grimberg , Yishai Hadas Subject: [PATCH v2 libibverbs 1/2] Change rereg_mr API between libibverbs and the provider's library Date: Wed, 5 Nov 2014 10:23:02 +0200 Message-Id: <1415175783-4612-2-git-send-email-matanb@mellanox.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415175783-4612-1-git-send-email-matanb@mellanox.com> References: <1415175783-4612-1-git-send-email-matanb@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=-7.5 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 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 --- 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 cfa1156..7276c40 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -881,7 +881,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,