linux-pinenote/drivers/infiniband/hw/qib
Mike Marciniszyn e67306a380 IB/qib: Defer HCA error events to tasklet
With ib_qib options:

    options ib_qib krcvqs=1 pcie_caps=0x51 rcvhdrcnt=4096 singleport=1 ibmtu=4

a run of ib_write_bw -a yields the following:

    ------------------------------------------------------------------
     #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]
     1048576   5000           2910.64            229.80
    ------------------------------------------------------------------

The top cpu use in a profile is:

    CPU: Intel Architectural Perfmon, speed 2400.15 MHz (estimated)
    Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask
    of 0x00 (No unit mask) count 1002300
    Counted LLC_MISSES events (Last level cache demand requests from this core that
    missed the LLC) with a unit mask of 0x41 (No unit mask) count 10000
    samples  %        samples  %        app name                 symbol name
    15237    29.2642  964      17.1195  ib_qib.ko                qib_7322intr
    12320    23.6618  1040     18.4692  ib_qib.ko                handle_7322_errors
    4106      7.8860  0              0  vmlinux                  vsnprintf


Analysis of the stats, profile, the code, and the annotated profile indicate:
 - All of the overflow interrupts (one per packet overflow) are
   serviced on CPU0 with no mitigation on the frequency.
 - All of the receive interrupts are being serviced by CPU0.  (That is
   the way truescale.cmds statically allocates the kctx IRQs to CPU)
 - The code is spending all of its time servicing QIB_I_C_ERROR
   RcvEgrFullErr interrupts on CPU0, starving the packet receive
   processing.
 - The decode_err routine is very inefficient, using a printf variant
   to format a "%s" and continues to loop when the errs mask has been
   cleared.
 - Both qib_7322intr and handle_7322_errors read pci registers, which
   is very inefficient.

The fix does the following:
 - Adds a tasklet to service QIB_I_C_ERROR
 - Replaces the very inefficient scnprintf() with a memcpy().  A field
   is added to qib_hwerror_msgs to save the sizeof("string") at
   compile time so that a strlen is not needed during err_decode().
 - The most frequent errors (Overflows) are serviced first to exit the
   loop as early as possible.
 - The loop now exits as soon as the errs mask is clear rather than
   fruitlessly looping through the msp array.

With this fix the performance changes to:

    ------------------------------------------------------------------
     #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]
     1048576   5000           2990.64            2941.35
    ------------------------------------------------------------------

During testing of the error handling overflow patch, it was determined
that some CPU's were slower when servicing both overflow and receive
interrupts on CPU0 with different MSI interrupt vectors.

This patch adds an option (krcvq01_no_msi) to not use a dedicated MSI
interrupt for kctx's < 2 and to service them on the default interrupt.
For some CPUs, the cost of the interrupt enter/exit is more costly
than then the additional PCI read in the default handler.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-07-22 11:56:05 -07:00
..
Kconfig RDMA: Add netlink infrastructure 2011-05-20 11:46:11 -07:00
Makefile IB/qib: Use request_firmware() to load SD7220 firmware 2010-07-08 13:27:05 -07:00
qib.h IB/qib: Defer HCA error events to tasklet 2011-07-22 11:56:05 -07:00
qib_6120_regs.h
qib_7220.h IB/qib: Use request_firmware() to load SD7220 firmware 2010-07-08 13:27:05 -07:00
qib_7220_regs.h
qib_7322_regs.h IB/qib: Mask hardware error during link reset 2010-07-06 14:13:20 -07:00
qib_common.h IB/qib: Allow PSM to select from multiple port assignment algorithms 2010-07-21 11:39:36 -07:00
qib_cq.c IB/qib: Generate completion callback on errors 2011-01-10 17:42:19 -08:00
qib_diag.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
qib_dma.c
qib_driver.c IB/qib: Issue pre-emptive NAKs on eager buffer overflow 2011-01-10 17:42:22 -08:00
qib_eeprom.c
qib_file_ops.c IB/qib: Fix potential deadlock with link down interrupt 2011-07-18 12:09:23 -07:00
qib_fs.c fs: dcache rationalise dget variants 2011-01-07 17:50:24 +11:00
qib_iba6120.c Revert wrong fixes for common misspellings 2011-04-26 23:31:11 -07:00
qib_iba7220.c IB/qib: Update active link width 2011-07-18 12:09:26 -07:00
qib_iba7322.c IB/qib: Defer HCA error events to tasklet 2011-07-22 11:56:05 -07:00
qib_init.c Fix common misspellings 2011-03-31 11:26:23 -03:00
qib_intr.c IB/qib: Ensure that LOS and DFE are being turned off 2011-06-17 11:56:59 -07:00
qib_keys.c IB/qib: Fix refcount leak in lkey/rkey validation 2011-01-10 17:42:23 -08:00
qib_mad.c IB/qib: Fix M_Key field in SubnGet and SubnGetResp MADs 2011-03-14 12:11:51 -07:00
qib_mad.h Fix common misspellings 2011-03-31 11:26:23 -03:00
qib_mmap.c
qib_mr.c IB/qib: RDMA lkey/rkey validation is inefficient for large MRs 2011-01-10 17:42:22 -08:00
qib_pcie.c IB/qib: Remove unnecessary read of PCI_CAP_ID_EXP 2011-07-18 11:57:52 -07:00
qib_pio_copy.c
qib_qp.c IB/qib: Change QPN increment 2011-01-10 17:42:22 -08:00
qib_qsfp.c RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
qib_qsfp.h IB/qib: Set default LE2 value for active cables to 0 2011-03-14 12:10:34 -07:00
qib_rc.c IB/qib: Prevent double completions after a timeout or RNR error 2011-02-17 14:04:50 -08:00
qib_ruc.c
qib_sd7220.c IB/qib: Use request_firmware() to load SD7220 firmware 2010-07-08 13:27:05 -07:00
qib_sdma.c IB/qib: Fix race between qib_error_qp() and receive packet processing 2010-08-03 13:59:47 -07:00
qib_srq.c
qib_sysfs.c IB/qib: Add sysfs interface to read free contexts 2011-07-18 12:09:19 -07:00
qib_twsi.c Fix common misspellings 2011-03-31 11:26:23 -03:00
qib_tx.c IB/qib: Avoid variable-length array 2010-07-19 13:21:24 -07:00
qib_uc.c IB/qib: Process RDMA WRITE ONLY with IMMEDIATE properly 2010-10-22 22:12:15 -07:00
qib_ud.c Fix common misspellings 2011-03-31 11:26:23 -03:00
qib_user_pages.c mm: export __get_user_pages 2011-03-17 13:08:27 -03:00
qib_user_sdma.c Fix common misspellings 2011-03-31 11:26:23 -03:00
qib_user_sdma.h
qib_verbs.c IB/qib: Fix race between qib_error_qp() and receive packet processing 2010-08-03 13:59:47 -07:00
qib_verbs.h RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
qib_verbs_mcast.c
qib_wc_ppc64.c
qib_wc_x86_64.c