From patchwork Wed Jun 17 12:33:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Marciniszyn, Mike" X-Patchwork-Id: 6625281 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 147B7C0020 for ; Wed, 17 Jun 2015 12:33:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13A4A20364 for ; Wed, 17 Jun 2015 12:33:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D12492037C for ; Wed, 17 Jun 2015 12:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754426AbbFQMdD (ORCPT ); Wed, 17 Jun 2015 08:33:03 -0400 Received: from mga03.intel.com ([134.134.136.65]:37860 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755032AbbFQMdC (ORCPT ); Wed, 17 Jun 2015 08:33:02 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 17 Jun 2015 05:33:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,632,1427785200"; d="scan'208";a="509747961" Received: from sedona.ch.intel.com ([143.182.228.65]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jun 2015 05:33:01 -0700 Received: from phlsvsles11.ph.intel.com (phlsvsles11.ph.intel.com [10.228.195.43]) by sedona.ch.intel.com (8.13.6/8.14.3/Standard MailSET/Hub) with ESMTP id t5HCX0OF017750; Wed, 17 Jun 2015 05:33:00 -0700 Received: from phlsvslse11.ph.intel.com (localhost [127.0.0.1]) by phlsvsles11.ph.intel.com with ESMTP id t5HCX0Bg009807; Wed, 17 Jun 2015 08:33:00 -0400 Subject: [PATCH v3 49/49] IB/core: Add opa driver to kbuild To: dledford@redhat.com From: Mike Marciniszyn Cc: linux-rdma@vger.kernel.org Date: Wed, 17 Jun 2015 08:33:00 -0400 Message-ID: <20150617123259.8744.80023.stgit@phlsvslse11.ph.intel.com> In-Reply-To: <20150617122755.8744.44665.stgit@phlsvslse11.ph.intel.com> References: <20150617122755.8744.44665.stgit@phlsvslse11.ph.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 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=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: Jubin John Signed-off-by: Jubin John Signed-off-by: Mike Marciniszyn --- drivers/infiniband/Kconfig | 1 drivers/infiniband/hw/Makefile | 1 drivers/infiniband/hw/hfi1/sysfs.c | 131 ------------------------------------ 3 files changed, 3 insertions(+), 130 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index b899531..dd24c3d 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig @@ -57,6 +57,7 @@ config INFINIBAND_ADDR_TRANS source "drivers/infiniband/hw/mthca/Kconfig" source "drivers/infiniband/hw/ipath/Kconfig" source "drivers/infiniband/hw/qib/Kconfig" +source "drivers/infiniband/hw/hfi1/Kconfig" source "drivers/infiniband/hw/ehca/Kconfig" source "drivers/infiniband/hw/amso1100/Kconfig" source "drivers/infiniband/hw/cxgb3/Kconfig" diff --git a/drivers/infiniband/hw/Makefile b/drivers/infiniband/hw/Makefile index e900b03..f3f4d9d 100644 --- a/drivers/infiniband/hw/Makefile +++ b/drivers/infiniband/hw/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_INFINIBAND_MTHCA) += mthca/ obj-$(CONFIG_INFINIBAND_IPATH) += ipath/ obj-$(CONFIG_INFINIBAND_QIB) += qib/ +obj-$(CONFIG_INFINIBAND_HFI1) += hfi1/ obj-$(CONFIG_INFINIBAND_EHCA) += ehca/ obj-$(CONFIG_INFINIBAND_AMSO1100) += amso1100/ obj-$(CONFIG_INFINIBAND_CXGB3) += cxgb3/ diff --git a/drivers/infiniband/hw/hfi1/sysfs.c b/drivers/infiniband/hw/hfi1/sysfs.c index fdedb20..6fad3a6 100644 --- a/drivers/infiniband/hw/hfi1/sysfs.c +++ b/drivers/infiniband/hw/hfi1/sysfs.c @@ -619,123 +619,6 @@ static struct kobj_type hfi1_vl2mtu_ktype = { .default_attrs = vl2mtu_default_attributes }; -/* Start diag_counters */ -#define HFI1_DIAGC_NORMAL 0x0 -#define HFI1_DIAGC_PCPU 0x1 - -#define HFI1_DIAGC_ATTR(N) \ - static struct hfi1_diagc_attr diagc_attr_##N = { \ - .attr = { .name = __stringify(N), .mode = 0664 }, \ - .counter = offsetof(struct hfi1_ibport, n_##N), \ - .type = HFI1_DIAGC_NORMAL, \ - .vl = CNTR_INVALID_VL \ - } - -#define HFI1_DIAGC_ATTR_PCPU(N, V, L) \ - static struct hfi1_diagc_attr diagc_attr_##N = { \ - .attr = { .name = __stringify(N), .mode = 0664 }, \ - .counter = V, \ - .type = HFI1_DIAGC_PCPU, \ - .vl = L \ - } - -struct hfi1_diagc_attr { - struct attribute attr; - size_t counter; - int type; - int vl; -}; - -HFI1_DIAGC_ATTR(rc_resends); -HFI1_DIAGC_ATTR_PCPU(rc_acks, C_SW_CPU_RC_ACKS, CNTR_INVALID_VL); -HFI1_DIAGC_ATTR_PCPU(rc_qacks, C_SW_CPU_RC_QACKS, CNTR_INVALID_VL); -HFI1_DIAGC_ATTR_PCPU(rc_delayed_comp, C_SW_CPU_RC_DELAYED_COMP, - CNTR_INVALID_VL); -HFI1_DIAGC_ATTR(seq_naks); -HFI1_DIAGC_ATTR(rdma_seq); -HFI1_DIAGC_ATTR(rnr_naks); -HFI1_DIAGC_ATTR(other_naks); -HFI1_DIAGC_ATTR(rc_timeouts); -HFI1_DIAGC_ATTR(loop_pkts); -HFI1_DIAGC_ATTR(pkt_drops); -HFI1_DIAGC_ATTR(dmawait); -HFI1_DIAGC_ATTR(unaligned); -HFI1_DIAGC_ATTR(rc_dupreq); -HFI1_DIAGC_ATTR(rc_seqnak); - -static struct attribute *diagc_default_attributes[] = { - &diagc_attr_rc_resends.attr, - &diagc_attr_rc_acks.attr, - &diagc_attr_rc_qacks.attr, - &diagc_attr_rc_delayed_comp.attr, - &diagc_attr_seq_naks.attr, - &diagc_attr_rdma_seq.attr, - &diagc_attr_rnr_naks.attr, - &diagc_attr_other_naks.attr, - &diagc_attr_rc_timeouts.attr, - &diagc_attr_loop_pkts.attr, - &diagc_attr_pkt_drops.attr, - &diagc_attr_dmawait.attr, - &diagc_attr_unaligned.attr, - &diagc_attr_rc_dupreq.attr, - &diagc_attr_rc_seqnak.attr, - NULL -}; - -static ssize_t diagc_attr_show(struct kobject *kobj, struct attribute *attr, - char *buf) -{ - struct hfi1_diagc_attr *dattr = - container_of(attr, struct hfi1_diagc_attr, attr); - struct hfi1_pportdata *ppd = - container_of(kobj, struct hfi1_pportdata, diagc_kobj); - struct hfi1_ibport *hfip = &ppd->ibport_data; - - switch (dattr->type) { - case (HFI1_DIAGC_PCPU): - return(sprintf(buf, "%lld\n", - read_port_cntr(ppd, - dattr->counter, - dattr->vl))); - case (HFI1_DIAGC_NORMAL): - /* Fall through */ - default: - return sprintf(buf, "%u\n", - *(u32 *)((char *)hfip + dattr->counter)); - } -} - -static ssize_t diagc_attr_store(struct kobject *kobj, struct attribute *attr, - const char *buf, size_t size) -{ - struct hfi1_diagc_attr *dattr = - container_of(attr, struct hfi1_diagc_attr, attr); - struct hfi1_pportdata *ppd = - container_of(kobj, struct hfi1_pportdata, diagc_kobj); - struct hfi1_ibport *hfip = &ppd->ibport_data; - u32 val; - int ret; - - ret = kstrtou32(buf, 0, &val); - if (ret) - return ret; - *(u32 *)((char *)hfip + dattr->counter) = val; - return size; -} - -static const struct sysfs_ops hfi1_diagc_ops = { - .show = diagc_attr_show, - .store = diagc_attr_store, -}; - -static struct kobj_type diagc_ktype = { - .release = port_release, - .sysfs_ops = &hfi1_diagc_ops, - .default_attrs = diagc_default_attributes -}; - -/* End diag_counters */ - /* end of per-port file structures and support code */ /* @@ -978,23 +861,13 @@ int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num, } kobject_uevent(&ppd->vl2mtu_kobj, KOBJ_ADD); - ret = kobject_init_and_add(&ppd->diagc_kobj, &diagc_ktype, kobj, - "diag_counters"); - if (ret) { - dd_dev_err(dd, - "Skipping diag_counters sysfs info, (err %d) port %u\n", - ret, port_num); - goto bail_mtu; - } - kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD); - ret = kobject_init_and_add(&ppd->pport_cc_kobj, &port_cc_ktype, kobj, "CCMgtA"); if (ret) { dd_dev_err(dd, "Skipping Congestion Control sysfs info, (err %d) port %u\n", ret, port_num); - goto bail_diagc; + goto bail_mtu; } kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD); @@ -1027,8 +900,6 @@ bail_cc_entry_bin: sysfs_remove_bin_file(&ppd->pport_cc_kobj, &cc_setting_bin_attr); bail_cc: kobject_put(&ppd->pport_cc_kobj); -bail_diagc: - kobject_put(&ppd->diagc_kobj); bail_mtu: kobject_put(&ppd->vl2mtu_kobj); bail_sl: