From patchwork Mon May 4 06:14:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 6323281 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 1E2F89F52C for ; Mon, 4 May 2015 06:15:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DD7E202F0 for ; Mon, 4 May 2015 06:15:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A110202EB for ; Mon, 4 May 2015 06:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbbEDGPK (ORCPT ); Mon, 4 May 2015 02:15:10 -0400 Received: from mga11.intel.com ([192.55.52.93]:6210 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbbEDGPJ (ORCPT ); Mon, 4 May 2015 02:15:09 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 03 May 2015 23:15:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,364,1427785200"; d="scan'208";a="488919919" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by FMSMGA003.fm.intel.com with ESMTP; 03 May 2015 23:15:08 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id t446F7oc000405; Mon, 4 May 2015 02:15:07 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t446F7f4000402; Mon, 4 May 2015 02:15:07 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: iweiny set sender to ira.weiny@intel.com using -f From: ira.weiny@intel.com To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Ira Weiny Subject: [RFC PATCH 3/5] IB/core: Convert cap_ib_mad to core_cap_flags bit mask Date: Mon, 4 May 2015 02:14:57 -0400 Message-Id: <1430720099-32512-4-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1430720099-32512-1-git-send-email-ira.weiny@intel.com> References: <1430720099-32512-1-git-send-email-ira.weiny@intel.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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: Ira Weiny Use the new Core Capability bits instead of inferring this support from the protocol. Signed-off-by: Ira Weiny --- drivers/infiniband/hw/ehca/ehca_hca.c | 2 +- drivers/infiniband/hw/ipath/ipath_verbs.c | 2 +- drivers/infiniband/hw/mlx4/main.c | 4 ++-- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- drivers/infiniband/hw/qib/qib_verbs.c | 2 +- include/rdma/ib_verbs.h | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c index 75f5353..a06eadd 100644 --- a/drivers/infiniband/hw/ehca/ehca_hca.c +++ b/drivers/infiniband/hw/ehca/ehca_hca.c @@ -236,7 +236,7 @@ int ehca_query_port(struct ib_device *ibdev, props->active_speed = IB_SPEED_SDR; } - props->core_cap_flags = RDMA_CORE_CAP_PROT_IB; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_IB_MAD; query_port1: ehca_free_fw_ctrlblock(rblock); diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index 94a03eb..bb66aa7 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c @@ -1634,7 +1634,7 @@ static int ipath_query_port(struct ib_device *ibdev, } props->active_mtu = mtu; props->subnet_timeout = dev->subnet_timeout; - props->core_cap_flags = RDMA_CORE_CAP_PROT_IB; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_IB_MAD; return 0; } diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index fa4e45c..9db5fdc 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -330,7 +330,7 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port, if (props->state == IB_PORT_DOWN) props->active_speed = IB_SPEED_SDR; - props->core_cap_flags = RDMA_CORE_CAP_PROT_IB; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_IB_MAD; out: kfree(in_mad); @@ -392,7 +392,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port, props->state = (netif_running(ndev) && netif_carrier_ok(ndev)) ? IB_PORT_ACTIVE : IB_PORT_DOWN; props->phys_state = state_to_phys_state(props->state); - props->core_cap_flags = RDMA_CORE_CAP_PROT_IBOE; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IBOE | RDMA_CORE_CAP_IB_MAD; out_unlock: spin_unlock_bh(&iboe->lock); if (is_bonded) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index e3cdc17..4b8ef01 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -255,7 +255,7 @@ int mlx5_ib_query_port(struct ib_device *ibdev, u8 port, } } - props->core_cap_flags = RDMA_CORE_CAP_PROT_IB; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_IB_MAD; out: kfree(in_mad); diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index e49aece..60fcc02 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -172,7 +172,7 @@ static int mthca_query_port(struct ib_device *ibdev, props->subnet_timeout = out_mad->data[51] & 0x1f; props->max_vl_num = out_mad->data[37] >> 4; props->init_type_reply = out_mad->data[41] >> 4; - props->core_cap_flags = RDMA_CORE_CAP_PROT_IB; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_IB_MAD; out: kfree(in_mad); diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 6e52946..6975528 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c @@ -1646,7 +1646,7 @@ static int qib_query_port(struct ib_device *ibdev, u8 port, } props->active_mtu = mtu; props->subnet_timeout = ibp->subnet_timeout; - props->core_cap_flags = RDMA_CORE_CAP_PROT_IB; + props->core_cap_flags = RDMA_CORE_CAP_PROT_IB | RDMA_CORE_CAP_IB_MAD; return 0; } diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index dcaee4f..6c2b0e5 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1807,7 +1807,7 @@ static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num) */ static inline int cap_ib_mad(struct ib_device *device, u8 port_num) { - return rdma_ib_or_iboe(device, port_num); + return !!(device->core_cap_flags[port_num] & RDMA_CORE_CAP_IB_MAD); } /**