IB/ipath: remove stale references to userspace SMA
authorBryan O'Sullivan <bos@pathscale.com>
Fri, 25 Aug 2006 18:24:34 +0000 (11:24 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 22 Sep 2006 22:22:32 +0000 (15:22 -0700)
When we first submitted a userspace subnet management agent, it was
rejected, so we left it out of the final driver submission.  This patch
removes a number of vestigial references to it.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
14 files changed:
drivers/infiniband/hw/ipath/ipath_common.h
drivers/infiniband/hw/ipath/ipath_debug.h
drivers/infiniband/hw/ipath/ipath_driver.c
drivers/infiniband/hw/ipath/ipath_file_ops.c
drivers/infiniband/hw/ipath/ipath_fs.c
drivers/infiniband/hw/ipath/ipath_init_chip.c
drivers/infiniband/hw/ipath/ipath_intr.c
drivers/infiniband/hw/ipath/ipath_kernel.h
drivers/infiniband/hw/ipath/ipath_layer.c
drivers/infiniband/hw/ipath/ipath_layer.h
drivers/infiniband/hw/ipath/ipath_qp.c
drivers/infiniband/hw/ipath/ipath_stats.c
drivers/infiniband/hw/ipath/ipath_sysfs.c
drivers/infiniband/hw/ipath/ipath_verbs.c

index 062bd392e7e55d22e8d5bf95d057e8af2eb68c78..f8df3b771c267af9128349ebcb231ca1a2713d6f 100644 (file)
@@ -106,9 +106,9 @@ struct infinipath_stats {
        __u64 sps_ether_spkts;
        /* number of "ethernet" packets received by driver */
        __u64 sps_ether_rpkts;
-       /* number of SMA packets sent by driver */
+       /* number of SMA packets sent by driver. Obsolete. */
        __u64 sps_sma_spkts;
-       /* number of SMA packets received by driver */
+       /* number of SMA packets received by driver. Obsolete. */
        __u64 sps_sma_rpkts;
        /* number of times all ports rcvhdrq was full and packet dropped */
        __u64 sps_hdrqfull;
@@ -138,7 +138,7 @@ struct infinipath_stats {
        __u64 sps_pageunlocks;
        /*
         * Number of packets dropped in kernel other than errors (ether
-        * packets if ipath not configured, sma/mad, etc.)
+        * packets if ipath not configured, etc.)
         */
        __u64 sps_krdrops;
        /* pad for future growth */
@@ -153,8 +153,6 @@ struct infinipath_stats {
 #define IPATH_STATUS_DISABLED      0x2 /* hardware disabled */
 /* Device has been disabled via admin request */
 #define IPATH_STATUS_ADMIN_DISABLED    0x4
-#define IPATH_STATUS_OIB_SMA       0x8 /* ipath_mad kernel SMA running */
-#define IPATH_STATUS_SMA          0x10 /* user SMA running */
 /* Chip has been found and initted */
 #define IPATH_STATUS_CHIP_PRESENT 0x20
 /* IB link is at ACTIVE, usable for data traffic */
@@ -465,14 +463,6 @@ struct __ipath_sendpkt {
        struct ipath_iovec sps_iov[4];
 };
 
-/* Passed into SMA special file's ->read and ->write methods. */
-struct ipath_sma_pkt
-{
-       __u32 unit;     /* unit on which to send packet */
-       __u64 data;     /* address of payload in userspace */
-       __u32 len;      /* length of payload */
-};
-
 /*
  * Data layout in I2C flash (for GUID, etc.)
  * All fields are little-endian binary unless otherwise stated
index f415beda0d32bd3e2c7809468625e10e90a3f862..df69f0d80b8bf84d22da9b688b960b09809338da 100644 (file)
@@ -60,7 +60,6 @@
 #define __IPATH_USER_SEND   0x1000     /* use user mode send */
 #define __IPATH_KERNEL_SEND 0x2000     /* use kernel mode send */
 #define __IPATH_EPKTDBG     0x4000     /* print ethernet packet data */
-#define __IPATH_SMADBG      0x8000     /* sma packet debug */
 #define __IPATH_IPATHDBG    0x10000    /* Ethernet (IPATH) gen debug */
 #define __IPATH_IPATHWARN   0x20000    /* Ethernet (IPATH) warnings */
 #define __IPATH_IPATHERR    0x40000    /* Ethernet (IPATH) errors */
@@ -84,7 +83,6 @@
 /* print mmap/nopage stuff, not using VDBG any more */
 #define __IPATH_MMDBG     0x0
 #define __IPATH_EPKTDBG   0x0  /* print ethernet packet data */
-#define __IPATH_SMADBG    0x0   /* process startup (init)/exit messages */
 #define __IPATH_IPATHDBG  0x0  /* Ethernet (IPATH) table dump on */
 #define __IPATH_IPATHWARN 0x0  /* Ethernet (IPATH) warnings on   */
 #define __IPATH_IPATHERR  0x0  /* Ethernet (IPATH) errors on   */
index e6261bb9a8a105750966c54964779fe47e6092bf..520c38f13868c015009f9e849fe3b2368ffc59c5 100644 (file)
@@ -64,7 +64,7 @@ static struct idr unit_table;
 DEFINE_SPINLOCK(ipath_devs_lock);
 LIST_HEAD(ipath_dev_list);
 
-wait_queue_head_t ipath_sma_state_wait;
+wait_queue_head_t ipath_state_wait;
 
 unsigned ipath_debug = __IPATH_INFO;
 
@@ -618,15 +618,16 @@ void ipath_disarm_piobufs(struct ipath_devdata *dd, unsigned first,
 static int ipath_wait_linkstate(struct ipath_devdata *dd, u32 state,
                                int msecs)
 {
-       dd->ipath_sma_state_wanted = state;
-       wait_event_interruptible_timeout(ipath_sma_state_wait,
+       dd->ipath_state_wanted = state;
+       wait_event_interruptible_timeout(ipath_state_wait,
                                         (dd->ipath_flags & state),
                                         msecs_to_jiffies(msecs));
-       dd->ipath_sma_state_wanted = 0;
+       dd->ipath_state_wanted = 0;
 
        if (!(dd->ipath_flags & state)) {
                u64 val;
-               ipath_cdbg(SMA, "Didn't reach linkstate %s within %u ms\n",
+               ipath_cdbg(VERBOSE, "Didn't reach linkstate %s within %u"
+                          " ms\n",
                           /* test INIT ahead of DOWN, both can be set */
                           (state & IPATH_LINKINIT) ? "INIT" :
                           ((state & IPATH_LINKDOWN) ? "DOWN" :
@@ -1155,7 +1156,7 @@ int ipath_setrcvhdrsize(struct ipath_devdata *dd, unsigned rhdrsize)
  *
  * do appropriate marking as busy, etc.
  * returns buffer number if one found (>=0), negative number is error.
- * Used by ipath_sma_send_pkt and ipath_layer_send
+ * Used by ipath_layer_send
  */
 u32 __iomem *ipath_getpiobuf(struct ipath_devdata *dd, u32 * pbufnum)
 {
@@ -1448,7 +1449,7 @@ static void ipath_set_ib_lstate(struct ipath_devdata *dd, int which)
        int linkcmd = (which >> INFINIPATH_IBCC_LINKCMD_SHIFT) &
                        INFINIPATH_IBCC_LINKCMD_MASK;
 
-       ipath_cdbg(SMA, "Trying to move unit %u to %s, current ltstate "
+       ipath_cdbg(VERBOSE, "Trying to move unit %u to %s, current ltstate "
                   "is %s\n", dd->ipath_unit,
                   what[linkcmd],
                   ipath_ibcstatus_str[
@@ -1457,7 +1458,7 @@ static void ipath_set_ib_lstate(struct ipath_devdata *dd, int which)
                            INFINIPATH_IBCS_LINKTRAININGSTATE_SHIFT) &
                           INFINIPATH_IBCS_LINKTRAININGSTATE_MASK]);
        /* flush all queued sends when going to DOWN or INIT, to be sure that
-        * they don't block SMA and other MAD packets */
+        * they don't block MAD packets */
        if (!linkcmd || linkcmd == INFINIPATH_IBCC_LINKCMD_INIT) {
                ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
                                 INFINIPATH_S_ABORT);
index f865ce89b73f1e67f5b198fc47ac5082126528de..4080fed2dcd914e19aaaf7ca1fac67ee7232b8bf 100644 (file)
@@ -1816,7 +1816,7 @@ int ipath_user_add(struct ipath_devdata *dd)
                if (ret < 0) {
                        ipath_dev_err(dd, "Could not create wildcard "
                                      "minor: error %d\n", -ret);
-                       goto bail_sma;
+                       goto bail_user;
                }
 
                atomic_set(&user_setup, 1);
@@ -1832,7 +1832,7 @@ int ipath_user_add(struct ipath_devdata *dd)
 
        goto bail;
 
-bail_sma:
+bail_user:
        user_cleanup();
 bail:
        return ret;
index 0936d8e8d7043bdc51408c5e4bdf9ba25d9bc54f..a5eb30a06a5cb0698c2f93f44202ac3bcf76a200 100644 (file)
@@ -191,8 +191,8 @@ static ssize_t atomic_port_info_read(struct file *file, char __user *buf,
        portinfo[4] = (dd->ipath_lid << 16);
 
        /*
-        * Notimpl yet SMLID (should we store this in the driver, in case
-        * SMA dies?)  CapabilityMask is 0, we don't support any of these
+        * Notimpl yet SMLID.
+        * CapabilityMask is 0, we don't support any of these
         * DiagCode is 0; we don't store any diag info for now Notimpl yet
         * M_KeyLeasePeriod (we don't support M_Key)
         */
index 75c37213670243bfade9a595497f6902705eba45..44669dc2e22d1c502ce95503a19ed8f2f0fdb8ce 100644 (file)
@@ -53,8 +53,8 @@ module_param_named(cfgports, ipath_cfgports, ushort, S_IRUGO);
 MODULE_PARM_DESC(cfgports, "Set max number of ports to use");
 
 /*
- * Number of buffers reserved for driver (layered drivers and SMA
- * send).  Reserved at end of buffer list.   Initialized based on
+ * Number of buffers reserved for driver (verbs and layered drivers.)
+ * Reserved at end of buffer list.   Initialized based on
  * number of PIO buffers if not set via module interface.
  * The problem with this is that it's global, but we'll use different
  * numbers for different chip types.  So the default value is not
@@ -80,7 +80,7 @@ MODULE_PARM_DESC(kpiobufs, "Set number of PIO buffers for driver");
  *
  * Allocate the eager TID buffers and program them into infinipath.
  * We use the network layer alloc_skb() allocator to allocate the
- * memory, and either use the buffers as is for things like SMA
+ * memory, and either use the buffers as is for things like verbs
  * packets, or pass the buffers up to the ipath layered driver and
  * thence the network layer, replacing them as we do so (see
  * ipath_rcv_layer()).
@@ -450,9 +450,9 @@ static void enable_chip(struct ipath_devdata *dd,
        u32 val;
        int i;
 
-       if (!reinit) {
-               init_waitqueue_head(&ipath_sma_state_wait);
-       }
+       if (!reinit)
+               init_waitqueue_head(&ipath_state_wait);
+
        ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
                         dd->ipath_rcvctrl);
 
index 250e2a9f01bb60f7b032c27c3809b61eb9d6a80a..49bf7bb15b04b2628f52bf10df0b0366c574a3b7 100644 (file)
@@ -201,7 +201,7 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
                                  ib_linkstate(lstate));
                }
                else
-                       ipath_cdbg(SMA, "Unit %u link state %s, last "
+                       ipath_cdbg(VERBOSE, "Unit %u link state %s, last "
                                   "was %s\n", dd->ipath_unit,
                                   ib_linkstate(lstate),
                                   ib_linkstate((unsigned)
@@ -213,7 +213,7 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
                if (lstate == IPATH_IBSTATE_INIT ||
                    lstate == IPATH_IBSTATE_ARM ||
                    lstate == IPATH_IBSTATE_ACTIVE)
-                       ipath_cdbg(SMA, "Unit %u link state down"
+                       ipath_cdbg(VERBOSE, "Unit %u link state down"
                                   " (state 0x%x), from %s\n",
                                   dd->ipath_unit,
                                   (u32)val & IPATH_IBSTATE_MASK,
@@ -269,7 +269,7 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
                             INFINIPATH_IBCS_LINKSTATE_MASK)
                            == INFINIPATH_IBCS_L_STATE_ACTIVE)
                                /* if from up to down be more vocal */
-                               ipath_cdbg(SMA,
+                               ipath_cdbg(VERBOSE,
                                           "Unit %u link now down (%s)\n",
                                           dd->ipath_unit,
                                           ipath_ibcstatus_str[ltstate]);
@@ -596,11 +596,11 @@ static int handle_errors(struct ipath_devdata *dd, ipath_err_t errs)
 
        if (!noprint && *msg)
                ipath_dev_err(dd, "%s error\n", msg);
-       if (dd->ipath_sma_state_wanted & dd->ipath_flags) {
-               ipath_cdbg(VERBOSE, "sma wanted state %x, iflags now %x, "
-                          "waking\n", dd->ipath_sma_state_wanted,
+       if (dd->ipath_state_wanted & dd->ipath_flags) {
+               ipath_cdbg(VERBOSE, "driver wanted state %x, iflags now %x, "
+                          "waking\n", dd->ipath_state_wanted,
                           dd->ipath_flags);
-               wake_up_interruptible(&ipath_sma_state_wait);
+               wake_up_interruptible(&ipath_state_wait);
        }
 
        return chkerrpkts;
index af342314b36897f7abac611c7aefb5003cd41465..a600347bba6a47df1fe339c59f0dfddd77d3cfa3 100644 (file)
@@ -245,8 +245,8 @@ struct ipath_devdata {
        u32 ipath_pioavregs;
        /* IPATH_POLL, etc. */
        u32 ipath_flags;
-       /* ipath_flags sma is waiting for */
-       u32 ipath_sma_state_wanted;
+       /* ipath_flags driver is waiting for */
+       u32 ipath_state_wanted;
        /* last buffer for user use, first buf for kernel use is this
         * index. */
        u32 ipath_lastport_piobuf;
@@ -306,10 +306,6 @@ struct ipath_devdata {
        u32 ipath_pcibar0;
        /* so we can rewrite it after a chip reset */
        u32 ipath_pcibar1;
-       /* sequential tries for SMA send and no bufs */
-       u32 ipath_nosma_bufs;
-       /* duration (seconds) ipath_nosma_bufs set */
-       u32 ipath_nosma_secs;
 
        /* HT/PCI Vendor ID (here for NodeInfo) */
        u16 ipath_vendorid;
@@ -534,7 +530,7 @@ int ipath_diag_add(struct ipath_devdata *);
 void ipath_diag_remove(struct ipath_devdata *);
 void ipath_diag_bringup_link(struct ipath_devdata *);
 
-extern wait_queue_head_t ipath_sma_state_wait;
+extern wait_queue_head_t ipath_state_wait;
 
 int ipath_user_add(struct ipath_devdata *dd);
 void ipath_user_remove(struct ipath_devdata *dd);
@@ -818,7 +814,6 @@ extern struct mutex ipath_mutex;
 #define IPATH_DRV_NAME         "ib_ipath"
 #define IPATH_MAJOR            233
 #define IPATH_USER_MINOR_BASE  0
-#define IPATH_SMA_MINOR                128
 #define IPATH_DIAG_MINOR_BASE  129
 #define IPATH_NMINORS          255
 
index 10f578e2aed6253a9babf81394d729e565655138..e46aa4ed2a7e1123898d63e86d35f5ca99a61bf9 100644 (file)
@@ -162,9 +162,6 @@ int ipath_layer_register(void *(*l_add)(int, struct ipath_devdata *),
                if (dd->ipath_layer.l_arg)
                        continue;
 
-               if (!(*dd->ipath_statusp & IPATH_STATUS_SMA))
-                       *dd->ipath_statusp |= IPATH_STATUS_OIB_SMA;
-
                spin_unlock_irqrestore(&ipath_devs_lock, flags);
                dd->ipath_layer.l_arg = l_add(dd->ipath_unit, dd);
                spin_lock_irqsave(&ipath_devs_lock, flags);
index 4a27ede49941bf86eb3d76d7ee0611586b8025b2..3854a4eae68479a75fb614d6807ffae1009946f9 100644 (file)
@@ -66,9 +66,6 @@ int ipath_layer_set_piointbufavail_int(struct ipath_devdata *dd);
 #define IPATH_LAYER_INT_SEND_CONTINUE 0x10
 #define IPATH_LAYER_INT_BCAST 0x40
 
-/* _verbs_layer.l_flags */
-#define IPATH_VERBS_KERNEL_SMA 0x1
-
 extern unsigned ipath_debug; /* debugging bit mask */
 
 #endif                         /* _IPATH_LAYER_H */
index b86858e70f2a12feca6c9e6fa05fb9981d937a0d..c0267cf8ca8ce7b7ce52a4fd71e1715d908e561a 100644 (file)
@@ -644,33 +644,6 @@ __be32 ipath_compute_aeth(struct ipath_qp *qp)
        return cpu_to_be32(aeth);
 }
 
-/**
- * set_verbs_flags - set the verbs layer flags
- * @dd: the infinipath device
- * @flags: the flags to set
- */
-static int set_verbs_flags(struct ipath_devdata *dd, unsigned flags)
-{
-       struct ipath_devdata *ss;
-       unsigned long lflags;
-
-       spin_lock_irqsave(&ipath_devs_lock, lflags);
-
-       list_for_each_entry(ss, &ipath_dev_list, ipath_list) {
-               if (!(ss->ipath_flags & IPATH_INITTED))
-                       continue;
-               if ((flags & IPATH_VERBS_KERNEL_SMA) &&
-                   !(*ss->ipath_statusp & IPATH_STATUS_SMA))
-                       *ss->ipath_statusp |= IPATH_STATUS_OIB_SMA;
-               else
-                       *ss->ipath_statusp &= ~IPATH_STATUS_OIB_SMA;
-       }
-
-       spin_unlock_irqrestore(&ipath_devs_lock, lflags);
-
-       return 0;
-}
-
 /**
  * ipath_create_qp - create a queue pair for a device
  * @ibpd: the protection domain who's device we create the queue pair for
@@ -784,10 +757,6 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
                }
                qp->ip = NULL;
                ipath_reset_qp(qp);
-
-               /* Tell the core driver that the kernel SMA is present. */
-               if (init_attr->qp_type == IB_QPT_SMI)
-                       set_verbs_flags(dev->dd, IPATH_VERBS_KERNEL_SMA);
                break;
 
        default:
@@ -862,10 +831,6 @@ int ipath_destroy_qp(struct ib_qp *ibqp)
        struct ipath_ibdev *dev = to_idev(ibqp->device);
        unsigned long flags;
 
-       /* Tell the core driver that the kernel SMA is gone. */
-       if (qp->ibqp.qp_type == IB_QPT_SMI)
-               set_verbs_flags(dev->dd, 0);
-
        spin_lock_irqsave(&qp->s_lock, flags);
        qp->state = IB_QPS_ERR;
        spin_unlock_irqrestore(&qp->s_lock, flags);
index 70351b7e35c0a8603247141c972edb47b3477ca4..30a825928fcf3e9791cb1fe17d923571331d0559 100644 (file)
@@ -271,33 +271,6 @@ void ipath_get_faststats(unsigned long opaque)
                }
        }
 
-       if (dd->ipath_nosma_bufs) {
-               dd->ipath_nosma_secs += 5;
-               if (dd->ipath_nosma_secs >= 30) {
-                       ipath_cdbg(SMA, "No SMA bufs avail %u seconds; "
-                                  "cancelling pending sends\n",
-                                  dd->ipath_nosma_secs);
-                       /*
-                        * issue an abort as well, in case we have a packet
-                        * stuck in launch fifo.  This could corrupt an
-                        * outgoing user packet in the worst case,
-                        * but this is a pretty catastrophic, anyway.
-                        */
-                       ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
-                                        INFINIPATH_S_ABORT);
-                       ipath_disarm_piobufs(dd, dd->ipath_lastport_piobuf,
-                                            dd->ipath_piobcnt2k +
-                                            dd->ipath_piobcnt4k -
-                                            dd->ipath_lastport_piobuf);
-                       /* start again, if necessary */
-                       dd->ipath_nosma_secs = 0;
-               } else
-                       ipath_cdbg(SMA, "No SMA bufs avail %u tries, "
-                                  "after %u seconds\n",
-                                  dd->ipath_nosma_bufs,
-                                  dd->ipath_nosma_secs);
-       }
-
 done:
        mod_timer(&dd->ipath_stats_timer, jiffies + HZ * 5);
 }
index 56f12202ff49b73f2552fbcc3385118937d03f3b..8476dd3c7af4448907415c2621532950859557b7 100644 (file)
@@ -107,8 +107,8 @@ static const char *ipath_status_str[] = {
        "Initted",
        "Disabled",
        "Admin_Disabled",
-       "OIB_SMA",
-       "SMA",
+       "", /* This used to be the old "OIB_SMA" status. */
+       "", /* This used to be the old "SMA" status. */
        "Present",
        "IB_link_up",
        "IB_configured",
index 1776330914e599ce3812464488fbb4e3baefdc00..ab0006288b41efe5e4a693711598276a91119e8e 100644 (file)
@@ -1573,7 +1573,7 @@ int ipath_register_ib_device(struct ipath_devdata *dd)
        dev->mmap = ipath_mmap;
 
        snprintf(dev->node_desc, sizeof(dev->node_desc),
-                IPATH_IDSTR " %s kernel_SMA", system_utsname.nodename);
+                IPATH_IDSTR " %s", system_utsname.nodename);
 
        ret = ib_register_device(dev);
        if (ret)