IB/ipathverbs: change QLogic to Intel
truescale.cmds: initialize serdes for mezzanine cards

A number of QLogic mezzanine cards need to know which slot they are
connected to in order to set the serdes parameters correctly.
This is because there is no QSFP EEPROM to indicate the trace length
to the switch. The fix is to use dmidecode to get the blade slot number
and set the serdes accordingly.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
truescale.cmds: avoid output of grep errors

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
truescale.cmds: make the mount of /ipathfs more robust and quiet

The 'start' section of truescale.cmds isn't terribly robust against
being called multiple times or having a slightly wonky environment.
Device testers in particular were getting messages from the failing
mkdir.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: Fix invalid 'if' statement syntax

Delete leading -a.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: Fix setting SERDES Tx values on HP Mezz

If the mezz card is in the second mezz slot, both ports
are enabled. Therefore, we need to set the correct Tx
settings for the second port.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: balance IRQs for kernel contexts across CPUs

Balance the IRQs of the kernel receive contexts across the
available CPUs by assigning IRQ affinities in a round-robin
fashion.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: Add support for the BL465c blade type in truescale.cmds

Insure link comes up between BL465c and switch.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: enhance CPU assignment

truescale.cmds is enhanced to make the following changes to
CPU assignments:
- use the affinity_hint file if present, otherwise changes as below
- non-kctx interrupts are assigned to the HCA's first local CPU
- kctx interrupts are assigned from the second with a potential
  wrap back to the second

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: Add support for HP BL685 blades

Add SERDES tunning support for the HP BL685 full-height
blades which have 3 Mez slots.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
truescale.cmds: Wait for /dev/ipath* devices before changing permissions

Wait for up to 30 seconds for the /dev/ipath* devices to appear
before attempting to change their permissions. This helps with
system which boot a bit slower on which the device permissions
could be left in the wrong state.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
truescale.cmds: Ban irqbalance from re-arranging our IRQs

We've already assigned our IRQs to the proper cores and
we don't want irqbalance messing with them. Use the
IRQBALANCE_BANNED_INTERRUPTS environment variable to
stop irqbalance from re-arranging our IRQs.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
truescale.cmds: Fix error with IRQBALANCE_BANNED_INTERRUPTS

An incorrect sed expression was inserting spaces between
digits of multi-digit IRQ numbers.
This changeset also adds a check whether a QLogic HCA is
present in the system. This silences some errors resulting
from attempting to read files that are not present.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
truescale.cmds: Adjust QME724x TX tunings based on BP version

The Dell blade chassis got an updated backplane which
requires new transmitter tuning settings. With this
change the tuning script will query the driver for the
backplane version and set the TX settings according to
BP version and slot in the chassis.

Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
truescale.cmds: Fix quoting issues in truescale.cmds

Missed quotes create an issue with shell special
characters. Fix by quoting string.

Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
truescale.cmds: Add Intel copyright notice.

Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
truescale.cmds: Fix blade type discovery on new M420 Dell blades

The new type of blades have a different format for the
serial number so we need to adjust how we discover the
bay number.

Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
truescale.cmds: add override for Dell QME backplane ver

The default is 1.   The override allows use
of a different backplane version.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
truescale.cmds: bullet proofing fixes and new balance syntax

The following issues are addressed:
- Detect/Configure --banirq vs. IRQBALANCE_BANNED_INTERRUPTS
- Detect unconfigurable banning (SLES11SP2/3)
- Determine service name globally and fix issue determining
  name
- Use grep to cut out qib interrupts from banned configuration
  (This is safer for differing length irq numbers)
- Generalize affinity hint test to work on 3.0 kernels
- Make code for ipathfs more flexible and prepare for
  eventual move of ipathfs tree to debugfs
- Add shebang to allow for better external integration
- Handle running in environment where filesystems are read-only
  (early boot)

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
IB/ipathverbs: add truescale.cmds and modprobe call

This fix adds the truescale.cmds and modprobe.conf
install/remove logic to invoke that command.

The fix includes dracut install/check hooks to get those files
into boot images for systems that support dracut.

The truescale.cmds gets installed to /usr/sbin and
truescale.conf gets installed to /etc/modprobe.d.

Eventually the current scripting in openibd will be removed
in favor of this implementation.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>