aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-08-25 14:24:33 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-22 18:22:31 -0400
commitb55f4f06c834a67f949a5219c5f97ffafa240989 (patch)
treef7fb3095a8e7e09370036ad9d669925897d5f0c4 /drivers/infiniband/hw
parent34b2aafea38efdf02cd8107a6e1057e2a297c447 (diff)
IB/ipath: simplify debugging code after ipath_core and ib_ipath merger
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c4
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h4
-rw-r--r--drivers/infiniband/hw/ipath/ipath_keys.c3
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c10
-rw-r--r--drivers/infiniband/hw/ipath/ipath_sysfs.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.c19
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.h1
-rw-r--r--drivers/infiniband/hw/ipath/verbs_debug.h108
8 files changed, 17 insertions, 134 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 958cc9b33c8f..e6261bb9a8a1 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -58,7 +58,7 @@ const char *ipath_get_unit_name(int unit)
58 * The size has to be longer than this string, so we can append 58 * The size has to be longer than this string, so we can append
59 * board/chip information to it in the init code. 59 * board/chip information to it in the init code.
60 */ 60 */
61const char ipath_core_version[] = IPATH_IDSTR "\n"; 61const char ib_ipath_version[] = IPATH_IDSTR "\n";
62 62
63static struct idr unit_table; 63static struct idr unit_table;
64DEFINE_SPINLOCK(ipath_devs_lock); 64DEFINE_SPINLOCK(ipath_devs_lock);
@@ -1847,7 +1847,7 @@ static int __init infinipath_init(void)
1847{ 1847{
1848 int ret; 1848 int ret;
1849 1849
1850 ipath_dbg(KERN_INFO DRIVER_LOAD_MSG "%s", ipath_core_version); 1850 ipath_dbg(KERN_INFO DRIVER_LOAD_MSG "%s", ib_ipath_version);
1851 1851
1852 /* 1852 /*
1853 * These must be called before the driver is registered with 1853 * These must be called before the driver is registered with
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 999249b7f27f..af342314b368 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -785,7 +785,7 @@ static inline u32 ipath_read_creg32(const struct ipath_devdata *dd,
785 785
786struct device_driver; 786struct device_driver;
787 787
788extern const char ipath_core_version[]; 788extern const char ib_ipath_version[];
789 789
790int ipath_driver_create_group(struct device_driver *); 790int ipath_driver_create_group(struct device_driver *);
791void ipath_driver_remove_group(struct device_driver *); 791void ipath_driver_remove_group(struct device_driver *);
@@ -815,7 +815,7 @@ const char *ipath_get_unit_name(int unit);
815 815
816extern struct mutex ipath_mutex; 816extern struct mutex ipath_mutex;
817 817
818#define IPATH_DRV_NAME "ipath_core" 818#define IPATH_DRV_NAME "ib_ipath"
819#define IPATH_MAJOR 233 819#define IPATH_MAJOR 233
820#define IPATH_USER_MINOR_BASE 0 820#define IPATH_USER_MINOR_BASE 0
821#define IPATH_SMA_MINOR 128 821#define IPATH_SMA_MINOR 128
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c
index a5ca279370aa..ba1b93226caa 100644
--- a/drivers/infiniband/hw/ipath/ipath_keys.c
+++ b/drivers/infiniband/hw/ipath/ipath_keys.c
@@ -34,6 +34,7 @@
34#include <asm/io.h> 34#include <asm/io.h>
35 35
36#include "ipath_verbs.h" 36#include "ipath_verbs.h"
37#include "ipath_kernel.h"
37 38
38/** 39/**
39 * ipath_alloc_lkey - allocate an lkey 40 * ipath_alloc_lkey - allocate an lkey
@@ -60,7 +61,7 @@ int ipath_alloc_lkey(struct ipath_lkey_table *rkt, struct ipath_mregion *mr)
60 r = (r + 1) & (rkt->max - 1); 61 r = (r + 1) & (rkt->max - 1);
61 if (r == n) { 62 if (r == n) {
62 spin_unlock_irqrestore(&rkt->lock, flags); 63 spin_unlock_irqrestore(&rkt->lock, flags);
63 _VERBS_INFO("LKEY table full\n"); 64 ipath_dbg(KERN_INFO "LKEY table full\n");
64 ret = 0; 65 ret = 0;
65 goto bail; 66 goto bail;
66 } 67 }
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 9228d59b59d4..b86858e70f2a 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -274,7 +274,7 @@ void ipath_free_all_qps(struct ipath_qp_table *qpt)
274 free_qpn(qpt, qp->ibqp.qp_num); 274 free_qpn(qpt, qp->ibqp.qp_num);
275 if (!atomic_dec_and_test(&qp->refcount) || 275 if (!atomic_dec_and_test(&qp->refcount) ||
276 !ipath_destroy_qp(&qp->ibqp)) 276 !ipath_destroy_qp(&qp->ibqp))
277 _VERBS_INFO("QP memory leak!\n"); 277 ipath_dbg(KERN_INFO "QP memory leak!\n");
278 qp = nqp; 278 qp = nqp;
279 } 279 }
280 } 280 }
@@ -362,8 +362,8 @@ void ipath_error_qp(struct ipath_qp *qp)
362 struct ipath_ibdev *dev = to_idev(qp->ibqp.device); 362 struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
363 struct ib_wc wc; 363 struct ib_wc wc;
364 364
365 _VERBS_INFO("QP%d/%d in error state\n", 365 ipath_dbg(KERN_INFO "QP%d/%d in error state\n",
366 qp->ibqp.qp_num, qp->remote_qpn); 366 qp->ibqp.qp_num, qp->remote_qpn);
367 367
368 spin_lock(&dev->pending_lock); 368 spin_lock(&dev->pending_lock);
369 /* XXX What if its already removed by the timeout code? */ 369 /* XXX What if its already removed by the timeout code? */
@@ -945,8 +945,8 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
945 struct ipath_ibdev *dev = to_idev(qp->ibqp.device); 945 struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
946 struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last); 946 struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);
947 947
948 _VERBS_INFO("Send queue error on QP%d/%d: err: %d\n", 948 ipath_dbg(KERN_INFO "Send queue error on QP%d/%d: err: %d\n",
949 qp->ibqp.qp_num, qp->remote_qpn, wc->status); 949 qp->ibqp.qp_num, qp->remote_qpn, wc->status);
950 950
951 spin_lock(&dev->pending_lock); 951 spin_lock(&dev->pending_lock);
952 /* XXX What if its already removed by the timeout code? */ 952 /* XXX What if its already removed by the timeout code? */
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index 7396a63840db..56f12202ff49 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -75,7 +75,7 @@ bail:
75static ssize_t show_version(struct device_driver *dev, char *buf) 75static ssize_t show_version(struct device_driver *dev, char *buf)
76{ 76{
77 /* The string printed here is already newline-terminated. */ 77 /* The string printed here is already newline-terminated. */
78 return scnprintf(buf, PAGE_SIZE, "%s", ipath_core_version); 78 return scnprintf(buf, PAGE_SIZE, "%s", ib_ipath_version);
79} 79}
80 80
81static ssize_t show_num_units(struct device_driver *dev, char *buf) 81static ssize_t show_num_units(struct device_driver *dev, char *buf)
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 3c47620e9887..1776330914e5 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -50,10 +50,6 @@ module_param_named(lkey_table_size, ib_ipath_lkey_table_size, uint,
50MODULE_PARM_DESC(lkey_table_size, 50MODULE_PARM_DESC(lkey_table_size,
51 "LKEY table size in bits (2^n, 1 <= n <= 23)"); 51 "LKEY table size in bits (2^n, 1 <= n <= 23)");
52 52
53unsigned int ib_ipath_debug; /* debug mask */
54module_param_named(debug, ib_ipath_debug, uint, S_IWUSR | S_IRUGO);
55MODULE_PARM_DESC(debug, "Verbs debug mask");
56
57static unsigned int ib_ipath_max_pds = 0xFFFF; 53static unsigned int ib_ipath_max_pds = 0xFFFF;
58module_param_named(max_pds, ib_ipath_max_pds, uint, S_IWUSR | S_IRUGO); 54module_param_named(max_pds, ib_ipath_max_pds, uint, S_IWUSR | S_IRUGO);
59MODULE_PARM_DESC(max_pds, 55MODULE_PARM_DESC(max_pds,
@@ -1598,8 +1594,7 @@ err_lk:
1598 kfree(idev->qp_table.table); 1594 kfree(idev->qp_table.table);
1599err_qp: 1595err_qp:
1600 ib_dealloc_device(dev); 1596 ib_dealloc_device(dev);
1601 _VERBS_ERROR("ib_ipath%d cannot register verbs (%d)!\n", 1597 ipath_dev_err(dd, "cannot register verbs: %d!\n", -ret);
1602 dd->ipath_unit, -ret);
1603 idev = NULL; 1598 idev = NULL;
1604 1599
1605bail: 1600bail:
@@ -1618,17 +1613,13 @@ void ipath_unregister_ib_device(struct ipath_ibdev *dev)
1618 if (!list_empty(&dev->pending[0]) || 1613 if (!list_empty(&dev->pending[0]) ||
1619 !list_empty(&dev->pending[1]) || 1614 !list_empty(&dev->pending[1]) ||
1620 !list_empty(&dev->pending[2])) 1615 !list_empty(&dev->pending[2]))
1621 _VERBS_ERROR("ipath%d pending list not empty!\n", 1616 ipath_dev_err(dev->dd, "pending list not empty!\n");
1622 dev->ib_unit);
1623 if (!list_empty(&dev->piowait)) 1617 if (!list_empty(&dev->piowait))
1624 _VERBS_ERROR("ipath%d piowait list not empty!\n", 1618 ipath_dev_err(dev->dd, "piowait list not empty!\n");
1625 dev->ib_unit);
1626 if (!list_empty(&dev->rnrwait)) 1619 if (!list_empty(&dev->rnrwait))
1627 _VERBS_ERROR("ipath%d rnrwait list not empty!\n", 1620 ipath_dev_err(dev->dd, "rnrwait list not empty!\n");
1628 dev->ib_unit);
1629 if (!ipath_mcast_tree_empty()) 1621 if (!ipath_mcast_tree_empty())
1630 _VERBS_ERROR("ipath%d multicast table memory leak!\n", 1622 ipath_dev_err(dev->dd, "multicast table memory leak!\n");
1631 dev->ib_unit);
1632 /* 1623 /*
1633 * Note that ipath_unregister_ib_device() can be called before all 1624 * Note that ipath_unregister_ib_device() can be called before all
1634 * the QPs are destroyed! 1625 * the QPs are destroyed!
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.h b/drivers/infiniband/hw/ipath/ipath_verbs.h
index 00f4cecc258e..9cc0dbfe8602 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.h
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.h
@@ -42,7 +42,6 @@
42#include <rdma/ib_pack.h> 42#include <rdma/ib_pack.h>
43 43
44#include "ipath_layer.h" 44#include "ipath_layer.h"
45#include "verbs_debug.h"
46 45
47#define QPN_MAX (1 << 24) 46#define QPN_MAX (1 << 24)
48#define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE) 47#define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE)
diff --git a/drivers/infiniband/hw/ipath/verbs_debug.h b/drivers/infiniband/hw/ipath/verbs_debug.h
deleted file mode 100644
index 6186676f2a16..000000000000
--- a/drivers/infiniband/hw/ipath/verbs_debug.h
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 * Copyright (c) 2006 QLogic, Inc. All rights reserved.
3 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
4 *
5 * This software is available to you under a choice of one of two
6 * licenses. You may choose to be licensed under the terms of the GNU
7 * General Public License (GPL) Version 2, available from the file
8 * COPYING in the main directory of this source tree, or the
9 * OpenIB.org BSD license below:
10 *
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
13 * conditions are met:
14 *
15 * - Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
17 * disclaimer.
18 *
19 * - Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE.
32 */
33
34#ifndef _VERBS_DEBUG_H
35#define _VERBS_DEBUG_H
36
37/*
38 * This file contains tracing code for the ib_ipath kernel module.
39 */
40#ifndef _VERBS_DEBUGGING /* tracing enabled or not */
41#define _VERBS_DEBUGGING 1
42#endif
43
44extern unsigned ib_ipath_debug;
45
46#define _VERBS_ERROR(fmt,...) \
47 do { \
48 printk(KERN_ERR "%s: " fmt, "ib_ipath", ##__VA_ARGS__); \
49 } while(0)
50
51#define _VERBS_UNIT_ERROR(unit,fmt,...) \
52 do { \
53 printk(KERN_ERR "%s: " fmt, "ib_ipath", ##__VA_ARGS__); \
54 } while(0)
55
56#if _VERBS_DEBUGGING
57
58/*
59 * Mask values for debugging. The scheme allows us to compile out any
60 * of the debug tracing stuff, and if compiled in, to enable or
61 * disable dynamically.
62 * This can be set at modprobe time also:
63 * modprobe ib_path ib_ipath_debug=3
64 */
65
66#define __VERBS_INFO 0x1 /* generic low verbosity stuff */
67#define __VERBS_DBG 0x2 /* generic debug */
68#define __VERBS_VDBG 0x4 /* verbose debug */
69#define __VERBS_SMADBG 0x8000 /* sma packet debug */
70
71#define _VERBS_INFO(fmt,...) \
72 do { \
73 if (unlikely(ib_ipath_debug&__VERBS_INFO)) \
74 printk(KERN_INFO "%s: " fmt,"ib_ipath", \
75 ##__VA_ARGS__); \
76 } while(0)
77
78#define _VERBS_DBG(fmt,...) \
79 do { \
80 if (unlikely(ib_ipath_debug&__VERBS_DBG)) \
81 printk(KERN_DEBUG "%s: " fmt, __func__, \
82 ##__VA_ARGS__); \
83 } while(0)
84
85#define _VERBS_VDBG(fmt,...) \
86 do { \
87 if (unlikely(ib_ipath_debug&__VERBS_VDBG)) \
88 printk(KERN_DEBUG "%s: " fmt, __func__, \
89 ##__VA_ARGS__); \
90 } while(0)
91
92#define _VERBS_SMADBG(fmt,...) \
93 do { \
94 if (unlikely(ib_ipath_debug&__VERBS_SMADBG)) \
95 printk(KERN_DEBUG "%s: " fmt, __func__, \
96 ##__VA_ARGS__); \
97 } while(0)
98
99#else /* ! _VERBS_DEBUGGING */
100
101#define _VERBS_INFO(fmt,...)
102#define _VERBS_DBG(fmt,...)
103#define _VERBS_VDBG(fmt,...)
104#define _VERBS_SMADBG(fmt,...)
105
106#endif /* _VERBS_DEBUGGING */
107
108#endif /* _VERBS_DEBUG_H */