From patchwork Tue Dec 5 23:17:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10094099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A08160329 for ; Tue, 5 Dec 2017 23:17:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CAC728334 for ; Tue, 5 Dec 2017 23:17:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61D4828535; Tue, 5 Dec 2017 23:17:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E590D28334 for ; Tue, 5 Dec 2017 23:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752963AbdLEXRl (ORCPT ); Tue, 5 Dec 2017 18:17:41 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44725 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752781AbdLEXRj (ORCPT ); Tue, 5 Dec 2017 18:17:39 -0500 Received: by mail-wr0-f194.google.com with SMTP id l22so2019007wrc.11 for ; Tue, 05 Dec 2017 15:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=epCevgCgVZh8mFz069fE3zNsefbtPoU+wiA6LliPh0o=; b=P3ATItFQuLfxuVmnN+xxz1EQZ0wxueQC1ze3hRK5Ww2kTSqi/HrZiZ7P8dtq7ovQa3 o6VZHydvQA1YvCgzcxwS86OqzB0zGsw/GgZeAlbbSh2WUReSAM5jvHE9GrMJ/NzDnASD pn7IjJf6gAodhotgFGt1JqetteCxx0CBhta4IxNCE4iFANtku2phu/8NkY8VMr+mRuo+ gwsVN93Pk4Wta4UHF7eNfuI5CaVrKyHGtzzkdge63UUi8AXGzU8ioflf5QxK3gHdCPse c3AohjQxMhm814ixtAIMEyJTgHb4V3167YfPcbVy/5H0U+tlxYYl7WvmacIWMdXYO9Sk Mk1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=epCevgCgVZh8mFz069fE3zNsefbtPoU+wiA6LliPh0o=; b=nMktyBIx9JvbSVZRH73ztf9zyiQvCJR6moPyHD6dThpEJW/d8nHt7ezKskPDlZYVVf FcjLELNnzO44CaNym6DPuz7Xzkoo5lQ1cXGuJyyyUjW5jo8nUCKBfHMeUG1CkAXb9xUR 0FMm+16m09v2tDDVGIRMjL13ZIpschm3QCij8srWTBqu6FmDKL1lY2RlAYFVDDFJ5SLT BjspHQ7e1DiCea+9P2eYJ8xBEPcEzdXqdT35TsoKKtsq1X5fIrkbedn80AZu4w8FS5JB hdopy4W/GaSO7a9kfXMIBsBapIf+8pMpYtW30gIQ55iAwuVkSA6Oj6S0/Lpkx1tEw9Co 3M4g== X-Gm-Message-State: AJaThX7Bp1l4DXttm823yJKe2tV1tEylyGky+eacVy5JrVxNUb8rMqLd gZwBVILk3AYABI9iiVsa9UmT92V7P/k= X-Google-Smtp-Source: AGs4zMZAQX1mT5cn/aEep6FxOgUc3K57iT2hjp9g1zmSzeC8z8jB4SsRfwMv3JZjivNesprR67mPOw== X-Received: by 10.223.176.150 with SMTP id i22mr17252715wra.257.1512515858269; Tue, 05 Dec 2017 15:17:38 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id c12sm1213925wrc.92.2017.12.05.15.17.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 15:17:34 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eMMSy-00054w-I2; Tue, 05 Dec 2017 16:17:32 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH 8/8] verbs: Get rid of verbs_set_ctx_op Date: Tue, 5 Dec 2017 16:17:21 -0700 Message-Id: <20171205231721.19410-9-jgg@ziepe.ca> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171205231721.19410-1-jgg@ziepe.ca> References: <20171205231721.19410-1-jgg@ziepe.ca> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe No longer necessary now that the providers are private to verbs. Signed-off-by: Jason Gunthorpe --- libibverbs/verbs.h | 5 ----- providers/mlx4/mlx4.c | 34 +++++++++++++++++----------------- providers/mlx5/mlx5.c | 34 +++++++++++++++++----------------- 3 files changed, 34 insertions(+), 39 deletions(-) diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 34995d9c4437fa..58d8d8e3c31509 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -1703,11 +1703,6 @@ static inline struct verbs_context *verbs_get_ctx(struct ibv_context *ctx) (!__vctx || (__vctx->sz < sizeof(*__vctx) - offsetof(struct verbs_context, op)) || \ !__vctx->op) ? NULL : __vctx; }) -#define verbs_set_ctx_op(_vctx, op, ptr) ({ \ - struct verbs_context *vctx = _vctx; \ - if (vctx && (vctx->sz >= sizeof(*vctx) - offsetof(struct verbs_context, op))) \ - vctx->op = ptr; }) - /** * ibv_get_device_list - Get list of IB devices currently available * @num_devices: optional. if non-NULL, set to the number of devices diff --git a/providers/mlx4/mlx4.c b/providers/mlx4/mlx4.c index 1ba2b427071fcb..d2ccd328625c80 100644 --- a/providers/mlx4/mlx4.c +++ b/providers/mlx4/mlx4.c @@ -238,23 +238,23 @@ static int mlx4_init_context(struct verbs_device *v_device, mlx4_map_internal_clock(dev, ibv_ctx); } - verbs_set_ctx_op(verbs_ctx, close_xrcd, mlx4_close_xrcd); - verbs_set_ctx_op(verbs_ctx, open_xrcd, mlx4_open_xrcd); - verbs_set_ctx_op(verbs_ctx, create_srq_ex, mlx4_create_srq_ex); - verbs_set_ctx_op(verbs_ctx, get_srq_num, verbs_get_srq_num); - verbs_set_ctx_op(verbs_ctx, create_qp_ex, mlx4_create_qp_ex); - verbs_set_ctx_op(verbs_ctx, open_qp, mlx4_open_qp); - verbs_set_ctx_op(verbs_ctx, ibv_create_flow, mlx4_create_flow); - verbs_set_ctx_op(verbs_ctx, ibv_destroy_flow, mlx4_destroy_flow); - verbs_set_ctx_op(verbs_ctx, create_cq_ex, mlx4_create_cq_ex); - verbs_set_ctx_op(verbs_ctx, query_device_ex, mlx4_query_device_ex); - verbs_set_ctx_op(verbs_ctx, query_rt_values, mlx4_query_rt_values); - verbs_set_ctx_op(verbs_ctx, create_wq, mlx4_create_wq); - verbs_set_ctx_op(verbs_ctx, modify_wq, mlx4_modify_wq); - verbs_set_ctx_op(verbs_ctx, destroy_wq, mlx4_destroy_wq); - verbs_set_ctx_op(verbs_ctx, create_rwq_ind_table, mlx4_create_rwq_ind_table); - verbs_set_ctx_op(verbs_ctx, destroy_rwq_ind_table, mlx4_destroy_rwq_ind_table); - verbs_set_ctx_op(verbs_ctx, modify_cq, mlx4_modify_cq); + verbs_ctx->close_xrcd = mlx4_close_xrcd; + verbs_ctx->open_xrcd = mlx4_open_xrcd; + verbs_ctx->create_srq_ex = mlx4_create_srq_ex; + verbs_ctx->get_srq_num = verbs_get_srq_num; + verbs_ctx->create_qp_ex = mlx4_create_qp_ex; + verbs_ctx->open_qp = mlx4_open_qp; + verbs_ctx->ibv_create_flow = mlx4_create_flow; + verbs_ctx->ibv_destroy_flow = mlx4_destroy_flow; + verbs_ctx->create_cq_ex = mlx4_create_cq_ex; + verbs_ctx->query_device_ex = mlx4_query_device_ex; + verbs_ctx->query_rt_values = mlx4_query_rt_values; + verbs_ctx->create_wq = mlx4_create_wq; + verbs_ctx->modify_wq = mlx4_modify_wq; + verbs_ctx->destroy_wq = mlx4_destroy_wq; + verbs_ctx->create_rwq_ind_table = mlx4_create_rwq_ind_table; + verbs_ctx->destroy_rwq_ind_table = mlx4_destroy_rwq_ind_table; + verbs_ctx->modify_cq = mlx4_modify_cq; return 0; diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c index 70afbd46f57b05..f1379abac482e1 100644 --- a/providers/mlx5/mlx5.c +++ b/providers/mlx5/mlx5.c @@ -999,23 +999,23 @@ static int mlx5_init_context(struct verbs_device *vdev, context->ibv_ctx.ops = mlx5_ctx_ops; - verbs_set_ctx_op(v_ctx, create_qp_ex, mlx5_create_qp_ex); - verbs_set_ctx_op(v_ctx, open_xrcd, mlx5_open_xrcd); - verbs_set_ctx_op(v_ctx, close_xrcd, mlx5_close_xrcd); - verbs_set_ctx_op(v_ctx, create_srq_ex, mlx5_create_srq_ex); - verbs_set_ctx_op(v_ctx, get_srq_num, mlx5_get_srq_num); - verbs_set_ctx_op(v_ctx, query_device_ex, mlx5_query_device_ex); - verbs_set_ctx_op(v_ctx, query_rt_values, mlx5_query_rt_values); - verbs_set_ctx_op(v_ctx, ibv_create_flow, mlx5_create_flow); - verbs_set_ctx_op(v_ctx, ibv_destroy_flow, mlx5_destroy_flow); - verbs_set_ctx_op(v_ctx, create_cq_ex, mlx5_create_cq_ex); - verbs_set_ctx_op(v_ctx, create_wq, mlx5_create_wq); - verbs_set_ctx_op(v_ctx, modify_wq, mlx5_modify_wq); - verbs_set_ctx_op(v_ctx, destroy_wq, mlx5_destroy_wq); - verbs_set_ctx_op(v_ctx, create_rwq_ind_table, mlx5_create_rwq_ind_table); - verbs_set_ctx_op(v_ctx, destroy_rwq_ind_table, mlx5_destroy_rwq_ind_table); - verbs_set_ctx_op(v_ctx, post_srq_ops, mlx5_post_srq_ops); - verbs_set_ctx_op(v_ctx, modify_cq, mlx5_modify_cq); + v_ctx->create_qp_ex = mlx5_create_qp_ex; + v_ctx->open_xrcd = mlx5_open_xrcd; + v_ctx->close_xrcd = mlx5_close_xrcd; + v_ctx->create_srq_ex = mlx5_create_srq_ex; + v_ctx->get_srq_num = mlx5_get_srq_num; + v_ctx->query_device_ex = mlx5_query_device_ex; + v_ctx->query_rt_values = mlx5_query_rt_values; + v_ctx->ibv_create_flow = mlx5_create_flow; + v_ctx->ibv_destroy_flow = mlx5_destroy_flow; + v_ctx->create_cq_ex = mlx5_create_cq_ex; + v_ctx->create_wq = mlx5_create_wq; + v_ctx->modify_wq = mlx5_modify_wq; + v_ctx->destroy_wq = mlx5_destroy_wq; + v_ctx->create_rwq_ind_table = mlx5_create_rwq_ind_table; + v_ctx->destroy_rwq_ind_table = mlx5_destroy_rwq_ind_table; + v_ctx->post_srq_ops = mlx5_post_srq_ops; + v_ctx->modify_cq = mlx5_modify_cq; memset(&device_attr, 0, sizeof(device_attr)); if (!mlx5_query_device_ex(ctx, NULL, &device_attr,