]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/infiniband/hw/ipath/ipath_stats.c
Merge branch 'linus' into perfcounters/core
[mv-sheeva.git] / drivers / infiniband / hw / ipath / ipath_stats.c
index d2725cd11bdccd701150d00bfaae8be7f7c96d57..f63e143e3292130cceea8426442e6e263b797d53 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2007 QLogic Corporation. All rights reserved.
+ * Copyright (c) 2006, 2007, 2008 QLogic Corporation. All rights reserved.
  * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -112,6 +112,14 @@ u64 ipath_snap_cntr(struct ipath_devdata *dd, ipath_creg creg)
                        dd->ipath_lastrpkts = val;
                }
                val64 = dd->ipath_rpkts;
+       } else if (creg == dd->ipath_cregs->cr_ibsymbolerrcnt) {
+               if (dd->ibdeltainprog)
+                       val64 -= val64 - dd->ibsymsnap;
+               val64 -= dd->ibsymdelta;
+       } else if (creg == dd->ipath_cregs->cr_iblinkerrrecovcnt) {
+               if (dd->ibdeltainprog)
+                       val64 -= val64 - dd->iblnkerrsnap;
+               val64 -= dd->iblnkerrdelta;
        } else
                val64 = (u64) val;
 
@@ -136,6 +144,7 @@ static void ipath_qcheck(struct ipath_devdata *dd)
        struct ipath_portdata *pd = dd->ipath_pd[0];
        size_t blen = 0;
        char buf[128];
+       u32 hdrqtail;
 
        *buf = 0;
        if (pd->port_hdrqfull != dd->ipath_p0_hdrqfull) {
@@ -174,17 +183,18 @@ static void ipath_qcheck(struct ipath_devdata *dd)
        if (blen)
                ipath_dbg("%s\n", buf);
 
-       if (pd->port_head != (u32)
-           le64_to_cpu(*dd->ipath_hdrqtailptr)) {
+       hdrqtail = ipath_get_hdrqtail(pd);
+       if (pd->port_head != hdrqtail) {
                if (dd->ipath_lastport0rcv_cnt ==
                    ipath_stats.sps_port0pkts) {
                        ipath_cdbg(PKT, "missing rcv interrupts? "
-                                  "port0 hd=%llx tl=%x; port0pkts %llx\n",
-                                  (unsigned long long)
-                                  le64_to_cpu(*dd->ipath_hdrqtailptr),
-                                  pd->port_head,
+                                  "port0 hd=%x tl=%x; port0pkts %llx; write"
+                                  " hd (w/intr)\n",
+                                  pd->port_head, hdrqtail,
                                   (unsigned long long)
                                   ipath_stats.sps_port0pkts);
+                       ipath_write_ureg(dd, ur_rcvhdrhead, hdrqtail |
+                               dd->ipath_rhdrhead_intr_off, pd->port_port);
                }
                dd->ipath_lastport0rcv_cnt = ipath_stats.sps_port0pkts;
        }
@@ -290,11 +300,11 @@ void ipath_get_faststats(unsigned long opaque)
            && time_after(jiffies, dd->ipath_unmasktime)) {
                char ebuf[256];
                int iserr;
-               iserr = ipath_decode_err(ebuf, sizeof ebuf,
-                       dd->ipath_maskederrs);
+               iserr = ipath_decode_err(dd, ebuf, sizeof ebuf,
+                                        dd->ipath_maskederrs);
                if (dd->ipath_maskederrs &
-                               ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL |
-                               INFINIPATH_E_PKTERRS ))
+                   ~(INFINIPATH_E_RRCVEGRFULL | INFINIPATH_E_RRCVHDRFULL |
+                     INFINIPATH_E_PKTERRS))
                        ipath_dev_err(dd, "Re-enabling masked errors "
                                      "(%s)\n", ebuf);
                else {
@@ -306,17 +316,18 @@ void ipath_get_faststats(unsigned long opaque)
                         * level.
                         */
                        if (iserr)
-                                       ipath_dbg("Re-enabling queue full errors (%s)\n",
-                                                       ebuf);
+                               ipath_dbg(
+                                       "Re-enabling queue full errors (%s)\n",
+                                       ebuf);
                        else
                                ipath_cdbg(ERRPKT, "Re-enabling packet"
-                                               " problem interrupt (%s)\n", ebuf);
+                                       " problem interrupt (%s)\n", ebuf);
                }
 
                /* re-enable masked errors */
                dd->ipath_errormask |= dd->ipath_maskederrs;
                ipath_write_kreg(dd, dd->ipath_kregs->kr_errormask,
-                       dd->ipath_errormask);
+                                dd->ipath_errormask);
                dd->ipath_maskederrs = 0;
        }