From patchwork Fri Apr 28 21:47:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dasaratharaman Chandramouli X-Patchwork-Id: 9705545 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 792D7602BF for ; Fri, 28 Apr 2017 21:47:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BAE028632 for ; Fri, 28 Apr 2017 21:47:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70D0428698; Fri, 28 Apr 2017 21:47:25 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 139402863C for ; Fri, 28 Apr 2017 21:47:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035443AbdD1VrX (ORCPT ); Fri, 28 Apr 2017 17:47:23 -0400 Received: from mga09.intel.com ([134.134.136.24]:58682 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422797AbdD1VrT (ORCPT ); Fri, 28 Apr 2017 17:47:19 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 14:47:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,389,1488873600"; d="scan'208";a="1141538193" Received: from phwtpriv01.ph.intel.com ([10.228.208.76]) by fmsmga001.fm.intel.com with ESMTP; 28 Apr 2017 14:47:15 -0700 From: Dasaratharaman Chandramouli To: Doug Ledford Cc: linux-rdma Subject: [PATCH v3 rdma-next 7/8] IB/core: Move opa_class_port_info definition to header file Date: Fri, 28 Apr 2017 17:47:10 -0400 Message-Id: <1493416031-23917-8-git-send-email-dasaratharaman.chandramouli@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1493416031-23917-1-git-send-email-dasaratharaman.chandramouli@intel.com> References: <1493416031-23917-1-git-send-email-dasaratharaman.chandramouli@intel.com> 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 Both opa_vnic and the hfi driver use the same opa_classport_info definition. We will also have ib_sa capable of querying opa class port info and would need this definition. Move it to ib_mad.h for everyone to use. Signed-off-by: Dasaratharaman Chandramouli --- drivers/infiniband/hw/hfi1/mad.c | 25 ------------------------- drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c | 25 ------------------------- include/rdma/ib_mad.h | 25 +++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 50 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c index 4c6f51c..836d00b 100644 --- a/drivers/infiniband/hw/hfi1/mad.c +++ b/drivers/infiniband/hw/hfi1/mad.c @@ -1994,31 +1994,6 @@ struct opa_pma_mad { u8 data[2024]; } __packed; -struct opa_class_port_info { - u8 base_version; - u8 class_version; - __be16 cap_mask; - __be32 cap_mask2_resp_time; - - u8 redirect_gid[16]; - __be32 redirect_tc_fl; - __be32 redirect_lid; - __be32 redirect_sl_qp; - __be32 redirect_qkey; - - u8 trap_gid[16]; - __be32 trap_tc_fl; - __be32 trap_lid; - __be32 trap_hl_qp; - __be32 trap_qkey; - - __be16 trap_pkey; - __be16 redirect_pkey; - - u8 trap_sl_rsvd; - u8 reserved[3]; -} __packed; - struct opa_port_status_req { __u8 port_num; __u8 reserved[3]; diff --git a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c index 6ff7be6..cee49aa 100644 --- a/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c +++ b/drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c @@ -88,31 +88,6 @@ /* Maximum number of VNIC ports supported */ #define OPA_VNIC_MAX_NUM_VPORT 255 -struct opa_class_port_info { - u8 base_version; - u8 class_version; - __be16 cap_mask; - __be32 cap_mask2_resp_time; - - u8 redirect_gid[16]; - __be32 redirect_tc_fl; - __be32 redirect_lid; - __be32 redirect_sl_qp; - __be32 redirect_qkey; - - u8 trap_gid[16]; - __be32 trap_tc_fl; - __be32 trap_lid; - __be32 trap_hl_qp; - __be32 trap_qkey; - - __be16 trap_pkey; - __be16 redirect_pkey; - - u8 trap_sl_rsvd; - u8 reserved[3]; -} __packed; - /** * struct opa_vnic_vema_port -- VNIC VEMA port details * @cport: pointer to port diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 42814a0..3d5f5d6 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h @@ -262,6 +262,31 @@ struct ib_class_port_info { __be32 trap_qkey; }; +struct opa_class_port_info { + u8 base_version; + u8 class_version; + __be16 cap_mask; + __be32 cap_mask2_resp_time; + + u8 redirect_gid[16]; + __be32 redirect_tc_fl; + __be32 redirect_lid; + __be32 redirect_sl_qp; + __be32 redirect_qkey; + + u8 trap_gid[16]; + __be32 trap_tc_fl; + __be32 trap_lid; + __be32 trap_hl_qp; + __be32 trap_qkey; + + __be16 trap_pkey; + __be16 redirect_pkey; + + u8 trap_sl_rsvd; + u8 reserved[3]; +} __packed; + /** * ib_get_cpi_resp_time - Returns the resp_time value from * cap_mask2_resp_time in ib_class_port_info.