From patchwork Mon Jan 11 15:05:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 8005291 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45836BEEE5 for ; Mon, 11 Jan 2016 15:06:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 671C5201FE for ; Mon, 11 Jan 2016 15:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B652520138 for ; Mon, 11 Jan 2016 15:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760532AbcAKPGc (ORCPT ); Mon, 11 Jan 2016 10:06:32 -0500 Received: from [193.47.165.129] ([193.47.165.129]:49620 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1759310AbcAKPGb (ORCPT ); Mon, 11 Jan 2016 10:06:31 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 11 Jan 2016 17:06:08 +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 u0BF68ps001087; Mon, 11 Jan 2016 17:06:08 +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 u0BF683i024836; Mon, 11 Jan 2016 17:06:08 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id u0BF68Z8024835; Mon, 11 Jan 2016 17:06:08 +0200 From: Yishai Hadas To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, yishaih@mellanox.com, matanb@mellanox.com, majd@mellanox.com, ogerlitz@mellanox.com Subject: [PATCH V2 libibverbs 1/2] Change rereg_mr API between libibverbs and the provider's library Date: Mon, 11 Jan 2016 17:05:17 +0200 Message-Id: <1452524718-21575-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1452524718-21575-1-git-send-email-yishaih@mellanox.com> References: <1452524718-21575-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 ae22768..48e868c 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -951,7 +951,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,