History log of /drivers/infiniband/hw/ipath/ipath_verbs.c
Revision Date Author Comments
e4dd23d753c3cb0d8533d353069e8b2e8a666360 27-May-2011 Paul Gortmaker <paul.gortmaker@windriver.com> infiniband: Fix up module files that need to include module.h

They had been getting it implicitly via device.h but we can't
rely on that for the future, due to a pending cleanup so fix
it now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
9a6edb60ec10d86b1025a0cdad68fd89f1ddaf02 07-May-2010 Ralph Campbell <ralph.campbell@qlogic.com> IB/core: Allow device-specific per-port sysfs files

Add a new parameter to ib_register_device() so that low-level device
drivers can pass in a pointer to a callback function that will be
called for each port that is registered in sysfs. This allows
low-level device drivers to create files in

/sys/class/infiniband/<hca>/ports/<N>/

without having to poke through the internals of the RDMA sysfs handling.

There is no need for an unregister function since the kobject
reference will go to zero when ib_unregister_device() is called.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
9c3da0991754d480328eeaa2b90cb231a1cea9b6 18-Jan-2009 Harvey Harrison <harvey.harrison@gmail.com> IB: Remove __constant_{endian} uses

The base versions handle constant folding just fine, use them
directly. The replacements are OK in the include/ files as they are
not exported to userspace so we don't need the __ prefixed versions.

This patch does not affect code generation at all.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
3d0890985ac4dff781b7feba19fedda547314749 05-Dec-2008 Dave Olson <dave.olson@qlogic.com> IB/ipath: Add locking for interrupt use of ipath_pd contexts vs free

Fixes timing race resulting in panic. Not a performance sensitive path.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
e441d6342890838bfc6d64ca2f0964aca08ae2a2 30-Sep-2008 Yannick Cote <yannick.cote@qlogic.com> IB/ipath: Fix hang on module unload

Handle the case where posting a send is requested when the link is
down. This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1117>.

Signed-off-by: Yannick Cote <yannick.cote@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
52fd8ca6ad4124c15952ded35cfcf6adbd7ae8d4 30-Jul-2008 Vegard Nossum <vegard.nossum@gmail.com> IB/ipath: Use unsigned long for irq flags

A few functions in the ipath driver incorrectly use unsigned int to
hold irq flags for spin_lock_irqsave().

This patch was generated using the Coccinelle framework with the
following semantic patch:

The semantic patch I used was this:

@@
expression lock;
identifier flags;
expression subclass;
@@

- unsigned int flags;
+ unsigned long flags;

...

<+...

(
spin_lock_irqsave(lock, flags)
|
_spin_lock_irqsave(lock)
|
spin_unlock_irqrestore(lock, flags)
|
_spin_unlock_irqrestore(lock, flags)
|
read_lock_irqsave(lock, flags)
|
_read_lock_irqsave(lock)
|
read_unlock_irqrestore(lock, flags)
|
_read_unlock_irqrestore(lock, flags)
|
write_lock_irqsave(lock, flags)
|
_write_lock_irqsave(lock)
|
write_unlock_irqrestore(lock, flags)
|
_write_unlock_irqrestore(lock, flags)
|
spin_lock_irqsave_nested(lock, flags, subclass)
|
_spin_lock_irqsave_nested(lock, subclass)
|
spin_unlock_irqrestore(lock, flags)
|
_spin_unlock_irqrestore(lock, flags)
|
_raw_spin_lock_flags(lock, flags)
|
__raw_spin_lock_flags(lock, flags)
)

...+>

Cc: Ralph Campbell <ralph.campbell@qlogic.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
df8666198dd058b9498ebdbc52c61957206d30a5 15-Jul-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Use IEEE OUI for vendor_id reported by ibv_query_device()

The IB spe. for SubnGet(NodeInfo) and query HCA says that the vendor
ID field should be the IEEE OUI assigned to the vendor. The ipath
driver was returning the PCI vendor ID instead. This will affect
applications which call ibv_query_device(). The old value was
0x001fc1 or 0x001077, the new value is 0x001175.

The vendor ID doesn't appear to be exported via /sys so that should
reduce possible compatibility issues. I'm only aware of Open MPI as a
major application which depends on this change, and they have made
necessary adjustments.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
03031f71c7e64aada1add057ccc4a8bc6a79924c 27-May-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Fix device capability flags

The driver supports a few features (RNR NAK, port active event, SRQ
resize) that were not reported in the device capability flags. This
patch fixes that.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
82524746c27fa418c250a56dd7606b9d3fc79826 12-May-2008 Franck Bui-Huu <fbuihuu@gmail.com> rcu: split list.h and move rcu-protected lists into rculist.h

Move rcu-protected lists from list.h into a new header file rculist.h.

This is done because list are a very used primitive structure all over the
kernel and it's currently impossible to include other header files in this
list.h without creating some circular dependencies.

For example, list.h implements rcu-protected list and uses rcu_dereference()
without including rcupdate.h. It actually compiles because users of
rcu_dereference() are macros. Others RCU functions could be used too but
aren't probably because of this.

Therefore this patch creates rculist.h which includes rcupdates without to
many changes/troubles.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Josh Triplett <josh@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
e509be898d8937634437caa474b57ac12795e5bc 13-May-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Fix many locking issues when switching to error state

The send DMA hardware queue voided a number of prior assumptions about
when a send is complete which led to completions being generated out of
order. There were also a number of locking issues when switching the QP
to the error or reset states, and we implement the IB_QPS_SQD state.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
53dc1ca194c062aa9771e194047f27ec1ca592df 13-May-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Fix RC and UC error handling

When errors are detected in RC, the QP should transition to the
IB_QPS_ERR state, not the IB_QPS_SQE state. Also, when the error is on
the responder side, the receive work completion error was incorrect
(remote vs. local).

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
6e87d1500713767866db0668bbcec75719576f3c 07-May-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Only increment SSN if WQE is put on send queue

If a send work request has immediate errors and is not put on the
send queue, we shouldn't update any of the QP state.

The increment of the SSN wasn't obeying this.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
88a8317bcd2258e84a41c155590837036d6b80a8 22-Apr-2008 Roland Dreier <rolandd@cisco.com> IB/ipath: Remove reference to dev->class_dev

Commit 124b4dcb ("IB/ipath: add calls to new 7220 code and enable in
build") inadvertently added core to set dev->class_dev.dev back into
ib_ipath. This is completely redundant since commit 1912ffbb ("IB: Set
class_dev->dev in core for nice device symlink"), which removed
class_dev setting from low-level drivers, and also will break the build
when class_dev is removed completely from struct ib_device.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
9862874d2138135dad9e78f61dbe415a4364945b 22-Apr-2008 Paul Bolle <pebolle@tiscali.nl> IB/ipath: Fix module parameter description for disable_sma

Describe disable_sma parameter with its name rather than the internal
ib_ipath_disable_sma variable name, so that the description shows up
properly in modinfo.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2848077044a5fdeb942bd1342c550da4c452d66a 22-Apr-2008 Stephen Rothwell <sfr@canb.auug.org.au> infiniband: class_device fallout

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
f4e91eb4a81559da87a3843758a641b5cc590b65 22-Feb-2008 Tony Jones <tonyj@suse.de> IB: convert struct class_device to struct device

This converts the main ib_device to use struct device instead of struct
class_device as class_device is going away.

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
e7eacd36865ae0707f5efae8e4dda421ffcd1b66 17-Apr-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Update copyright dates for files changed in 2008

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
124b4dcb1dd3a6fb80051f1785117a732d785f70 17-Apr-2008 Dave Olson <dave.olson@qlogic.com> IB/ipath: add calls to new 7220 code and enable in build

This patch adds the initialization calls into the new 7220 HCA files,
changes the Makefile to compile and link the new files, and code to
handle send DMA.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
c4b4d16e090e1b68d1d4d20a28757070982b9725 17-Apr-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Make send buffers available for kernel if not allocated to user

A fixed partitioning of send buffers is determined at driver load time
for user processes and kernel use. Since send buffers are a scarce
resource, it makes sense to allow the kernel to use the buffers if they
are not in use by a user process.

Also, eliminate code duplication for ipath_force_pio_avail_update().

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
a51a2513a8cb201f02d83c37e106909938d2f761 17-Apr-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Add code to support multiple link speeds and widths

This patch adds code to get/set portinfo to support multiple link speeds
and widths.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
826d801009fb3c82832f2d92149446cce354bf61 17-Apr-2008 Dave Olson <dave.olson@qlogic.com> IB/ipath: Enable 4KB MTU

Enable use of 4KB MTU. Since the driver uses more pinned memory for
receive buffers when the 4KB MTU is enabled, whether or not the fabric
supports that MTU, add a "mtu4096" module parameter that can be used to
limit the MTU to 2KB when it is known that 4KB MTUs can't be used
anyway.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
3d68ea32611095c7e09409ac1b2a56da22fd5eb7 10-Jan-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Add mappings from HW register to PortInfo port physical state

Add new mappings from port physical state (a HW register value) to the
IB SubnGet(PortInfo) port physical state.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
9e2ef36b5a83b3c8ec1153382559dff410cc4341 07-Jan-2008 Dave Olson <dave.olson@qlogic.com> IB/ipath: Clean up some comments

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
6c719cae0b91f577738dfb4007baee28f03e48a5 07-Jan-2008 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: MAD performance sampling registers support

Add support for QLogic HCAs which have hardware performance sampling
registers for PortSamplesControl and PortSamplesResult MADs.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
4187b915a0f7eaa69707715e80d9fc253ff6167a 14-Nov-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Normalize error return codes for posting work requests

The error codes for ib_post_send(), ib_post_recv(), and ib_post_srq_recv()
were inconsistent. Use EINVAL for too many SGEs and ENOMEM for too many
WRs.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
49739b3e24a10d819d3167a1c5b319d0b1186245 20-Sep-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Fix IB_EVENT_PORT_ERR event

The link state event calls were being generated when the SM told the SMA
to change link states. This works for IB_EVENT_PORT_ACTIVE but not if
the link goes down and stays down. The fix is to generate event calls
from the interrupt handler when the HW link state changes.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
542869a17eee2edf389273f40f757aa4e662b3da 13-Sep-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Remove duplicate copy of LMC

The LMC value was being saved by the SMA in two places. This patch
cleans it up so only one copy is kept.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
c9cf7db2bca9180f5888eebc23dc607666a9685b 26-Aug-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Generate flush CQE when QP is in error state

Follow the IB spec. (C10-96) for post send which states that a flushed
completion event should be generated for work requests posted when a QP
is in the error state.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
4ee97180ac76deb5a715ac45b7d7516e6ee82ae7 25-Jul-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Change UD to queue work requests like RC & UC

The code to post UD sends tried to process work requests at the time
ib_post_send() is called without using a WQE queue. This was fine as
long as HW resources were available for sending a packet. This patch
changes UD to be handled more like RC and UC and shares more code.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
210d6ca3db058cd1d6e6fd235ee3e25d6ac221cd 24-Jul-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Performance optimization for CPU differences

Different processors have different ordering restrictions for write
combining. By taking advantage of this, we can eliminate some write
barriers when writing to the send buffers.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
da9aec7b627c0369b955f82e855508c6711929ac 18-Jul-2007 Roland Dreier <rolandd@cisco.com> IB/ipath: Make a few functions static

Make some functions that are only used in a single .c file static. In
addition to being a cleanup, this shrinks the generated code. On x86_64:

add/remove: 1/3 grow/shrink: 2/1 up/down: 4777/-4956 (-179)
function old new delta
handle_errors - 3994 +3994
__verbs_timer 42 710 +668
ipath_do_ruc_send 2131 2246 +115
ipath_no_bufs_available 136 - -136
ipath_disarm_senderrbufs 639 - -639
ipath_ib_timer 658 - -658
ipath_intr 5878 2355 -3523

Signed-off-by: Roland Dreier <rolandd@cisco.com>
9ca48655667214be6ebd191628a3c4b5b529a87e 06-Jul-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Remove support for preproduction HTX InfiniPath cards

Clean up some code by removing support for some older pre-production
HTX InfiniPath cards.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
4fc570bcbe77f823aae183dd824869f79e74cc97 06-Jul-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Add barrier before updating WC head in shared memory

Add a barrier to make sure the CPU doesn't reorder writes to memory,
since user programs can be polling on the head index update and the
entry should be written before that.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
87427da55bc03dbce7906a5b09ed50279d654d28 11-Jun-2007 John Gregor <john.gregor@qlogic.com> IB/ipath: Update copyright dates

Now that it's June, it's about time to update
the copyright notices of files that have changed.

Signed-off-by: John Gregor <john.gregor@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
30d149ab58cc3ed8e4bc9c4dc45bebbed0e84b6e 18-Jun-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Fix possible data corruption if multiple SGEs used for receive

The code to copy data from the receive queue buffers to the IB SGEs
doesn't check the SGE length, only the memory region/page length when
copying data. This could overwrite parts of the user's memory that
were not intended to be written. It can only happen if multiple SGEs
are used to describe a receive buffer which almost never happens in
practice.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
db5518cd09c21f0fa70af0a4ca38badd90622c9e 18-Jun-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Wait for PIO available interrupt

The send function is called when posting new send work requests.
There is no point in trying to send a packet if the QP is already
waiting for a HW send buffer so don't clear the busy bit until the
buffer available interrupt happens.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
fdc7215fbd7b7652b052d1fb7893afe324dba7aa 18-Jun-2007 Robert Walsh <robert.walsh@qlogic.com> IB/ipath: Fill in some missing FMR-related fields in query_device

In ipath_query_device(), some of the struct ib_device_attr fields were
not being initialized.

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
e7340f04426416a6655ffaead4651bfb9e1b0848 18-Jun-2007 Robert Walsh <robert.walsh@qlogic.com> IB/ipath: Fix maximum MTU reporting

Although our chip supports 4K MTUs, our driver doesn't yet support
this feature, so limit the maximum MTU to 2K until we get support for
4K MTUs implemented.

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
8f140b407f3be04e7202be9aa0cfef3006d14c9f 10-May-2007 Arthur Jones <arthur.jones@qlogic.com> IB/ipath: Shadow the gpio_mask register

Once upon a time, GPIO interrupts were rare. But then a chip bug in
the waldo series forced the use of a GPIO interrupt to signal packet
reception. This greatly increased the frequency of GPIO interrupts
which have the gpio_mask bits set on the waldo chips. Other bits in
the gpio_status register are used for I2C clock and data lines, these
bits are usually on. An "unlikely" annotation leftover from the old
days was improperly applied to these bits, and an unnecessary chip
mmio read was being accessed in the interrupt fast path on waldo.

Remove the stagnant unlikely annotation in the interrupt handler and
keep a shadow copy of the gpio_mask register to avoid the slow mmio
read when testing for interruptable GPIO bits.

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
f4fd0b224d60044d2da5ca02f8f2b5150c1d8731 03-May-2007 Michael S. Tsirkin <mst@dev.mellanox.co.il> IB: Add CQ comp_vector support

Add a num_comp_vectors member to struct ib_device and extend
ib_create_cq() to pass in a comp_vector parameter -- this parallels
the userspace libibverbs API. Update all hardware drivers to set
num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector
value. Pass the value of num_comp_vectors to userspace rather than
hard-coding a value of 1.

We want multiple CQ event vector support (via MSI-X or similar for
adapters that can generate multiple interrupts), but it's not clear
how many vectors we want, or how we want to deal with policy issues
such as how to decide which vector to use or how to set up interrupt
affinity. This patch is useful for experimenting, since no core
changes will be necessary when updating a driver to support multiple
vectors, and we know that we want to make at least these changes
anyway.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
6b66b2da1e821181a001c00b04a807724ad803cd 28-Apr-2007 Robert Walsh <rjwalsh@pathscale.com> IB/ipath: Don't corrupt pending mmap list when unmapped objects are freed

Fix the pending mmap code so it doesn't corrupt the list of pending
mmaps and crash the machine when pending mmaps are destroyed without
first being mapped. Also, remove an unused variable, and use standard
kernel lists instead of our own homebrewed linked list implementation
to keep the pending mmap list.

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
1912ffbb88efe872eb8fa8113dfb3cb0b7238764 23-Apr-2007 Joachim Fenkes <fenkes@de.ibm.com> IB: Set class_dev->dev in core for nice device symlink

All RDMA drivers except ehca set class_dev->dev to their dma_device
value (ehca leaves this unset). dma_device is the only value that
makes any sense, so move this assignment to core/sysfs.c. This reduce
the duplicated code in the rest of the drivers and gives ehca a nice
/sys/class/infiniband/ehcaX/device symlink.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
5a7d4eea9185c20275307fcd1077d6f9dfdab48a 15-Mar-2007 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: Discard multicast packets without a GRH

This patch fixes a bug where multicast packets without a GRH were not
being dropped as per the IB spec.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
3859e39d75b72f35f7d38c618fbbacb39a440c22 15-Mar-2007 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Support larger IB_QP_MAX_DEST_RD_ATOMIC and IB_QP_MAX_QP_RD_ATOMIC

This patch adds support for multiple RDMA reads and atomics to be sent
before an ACK is required to be seen by the requester.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
f2cbb660ed37294e3eeb98c045de6890079ccb01 12-Dec-2006 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Implement new verbs DMA mapping functions

This patch implements the interposing DMA mapping functions to allow
support for IOMMUs and remove the dependence on phys_to_virt() and
bus_to_virt().

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
53533e16b1d94ff71cb013497938976906d9d504 30-Nov-2006 Roland Dreier <rolandd@cisco.com> IB/ipath: Fix typo in pma_counter_select subscript

The array has only 5 entries, so [5] should have been [4].

Signed-off-by: Roland Dreier <rolandd@cisco.com>
96b644bdec977b97a45133e5b4466ba47a7a5e65 02-Oct-2006 Serge E. Hallyn <serue@us.ibm.com> [PATCH] namespaces: utsname: use init_utsname when appropriate

In some places, particularly drivers and __init code, the init utsns is the
appropriate one to use. This patch replaces those with a the init_utsname
helper.

Changes: Removed several uses of init_utsname(). Hope I picked all the
right ones in net/ipv4/ipconfig.c. These are now changed to
utsname() (the per-process namespace utsname) in the previous
patch (2/7)

[akpm@osdl.org: CIFS fix]
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Kirill Korotaev <dev@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Andrey Savochkin <saw@sw.ru>
Cc: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
3d27b00457167103fb9f7e23fc2454c801a6b8f0 28-Sep-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: Fix lockdep error upon "ifconfig ibN down"

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2c9446a1d63f1ca570e92f89422595732efedf44 28-Sep-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: Support revision 2 InfiniPath PCIE devices

This also entailed a little GPIO-interrupt general cleanup.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
6022943eb4cb3cb9e43f27f1faeaba38e162d966 28-Sep-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: Limit # of packets sent without an ACK received

The sender requests an ACK every 1/2 MB to avoid retransmit timeouts that
were causing MVAPICH mod_bw to fail after a predictable number of sends.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
07ebafbaaa72aa6a35472879008f5a1d1d469a0c 03-Aug-2006 Tom Tucker <tom@opengridcomputing.com> RDMA: iWARP Core Changes.

Modifications to the existing rdma header files, core files, drivers,
and ulp files to support iWARP, including:
- Hook iWARP CM into the build system and use it in rdma_cm.
- Convert enum ib_node_type to enum rdma_node_type, which includes
the possibility of RDMA_NODE_RNIC, and update everything for this.

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
d821f02a6ebed97e35e0bc7575452cfc6f9073cb 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: allow SMA to be disabled

This is useful for testing purposes.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
0b81e4f79af8322c7142701982f40d1431dedf19 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: put a limit on the number of QPs that can be created

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
0fd41363e0785247b7c19127318abc8b5eacc86b 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: remove stale references to userspace SMA

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>
b55f4f06c834a67f949a5219c5f97ffafa240989 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> 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>
34b2aafea38efdf02cd8107a6e1057e2a297c447 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: simplify layering code

A lot of ipath layer code was only called in one place. Now that the
ipath_core and ib_ipath drivers are merged, it's more sensible to simply
inline the simple stuff that the layer code was doing.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
b1c1b6a30eac88665a35a207cc5e6233090b9d65 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: merge ipath_core and ib_ipath drivers

There is little point in keeping the two drivers separate, so we are
merging them.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
c27fef26271d352b5546c33239edeb0dcb4fc0cc 25-Aug-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: lock resource limit counters correctly

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
373d9915803aebbbf7fd3841efd9dac31c32e148 23-Sep-2006 Ralph Campbell <ralph.campbell@qlogic.com> IB/ipath: Performance improvements via mmap of queues

Improve performance of userspace post receive, post SRQ receive, and
poll CQ operations for ipath by allowing userspace to directly mmap()
receive queues and completion queues. This eliminates the copying
between userspace and the kernel in the data path.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16c59419a09f0140a07a1828d6a45656265e07c7 18-Jul-2006 Ralph Campbell <ralphc@pathscale.com> IB/ipath: ipath_skip_sge() can break if num_sge > 1

ipath_skip_sge() doesn't exactly duplicate the side effects of
ipath_copy_sge() if num_sge > 1 since it doesn't decrement ss->num_sge.
This could result in the sg_list being accessed out of bounds.
Since ipath_skip_sge() is almost always called with num_sge == 1,
the original "optimization" is almost never used.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
c9f79bdc21da9c8d466b6ba7c8bbd6b8e0110ce2 18-Jul-2006 Ralph Campbell <ralphc@pathscale.com> IB/ipath: Fix ib_ipath driver to work with SRP

I am still working on a proposal to remove the phys_to_virt() calls
in the ib_ipath driver. In the mean time, this patch allows SRP
to work by fixing the R_Key check and conversion from IB address
to kernel virtual address. It also returns the correct page size
for FMRs.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
27b678dd04a636f2c351816f4b3042c8815d4e9d 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: namespace cleanup: replace ips with ipath

Remove ips namespace from infinipath drivers. This renames ips_common.h to
ipath_common.h. Definitions, data structures, etc. that were not used by
kernel modules have moved to user-only headers. All names including ips have
been renamed to ipath. Some names have had an ipath prefix added.

Signed-off-by: Christian Bell <christian.bell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fba75200ad92892bf32d8d6f1443c6f1e4f48676 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: fixes to performance get counters for IB compliance

This patch fixes some problems uncovered during IB compliance testing to
return the right values for error counters returned by the Performance Get
Counters packet.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
c100f622fd9e529e0f4e4324b93f66d105dde61d 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: don't confuse the max message size with the MTU

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fe62546a6afa141c4ab9aef65f5978a1b36cb523 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: enforce device resource limits

These limits are somewhat artificial in that we don't actually have any
device limits. However, the verbs layer expects that such limits exist
and are enforced, so we make up arbitrary (but sensible) limits.

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
e8a88f09f21c55a7e7f570290ecde570e2c37771 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: report correct device identification information in /sys

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
4a45b7d4ece0e6dc425e9f66fa8b501b72d846db 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: don't allow resources to be created with illegal values

Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ddd4bb22108417fdc5c35324bd13a3265581ae76 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: share more common code between RC and UC protocols

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
759d57686dab8169ca68bbf938ce8e965d1e107a 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: update copyrights and other strings to reflect new company name

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
443a64abbcb130caa315eb1110d7146365846235 01-Jul-2006 Bryan O'Sullivan <bos@pathscale.com> [PATCH] IB/ipath: name zero counter offsets so it's clear they aren't counters

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
41c75a19bf4a0102f49763a686fb7e39780349f3 23-May-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: register as IB device owner

This fixes an oops.

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
94b8d9f98d7f535037eb9845b81396f667b4f727 23-May-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: replace uses of LIST_POISON

Per Andrew's request.

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
9b2017f1e1c95625b2ca2a1ec5317097117d7078 24-Apr-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: simplify IB timer usage

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
5494c22ba293a37534591d793f73e445a66196b5 19-Apr-2006 Roland Dreier <rolandd@cisco.com> IB/ipath: Fix whitespace

Signed-off-by: Roland Dreier <rolandd@cisco.com>
ac2ae4c9770de9450a8e881082a54bbb6f09534e 19-Apr-2006 Roland Dreier <rolandd@cisco.com> IB/ipath: Make more names static

Make symbols that are only used in a single source file static.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
6522108f19a998a5ded4d0c4d0f9eb9736398e31 30-Mar-2006 Bryan O'Sullivan <bos@pathscale.com> IB/ipath: infiniband verbs support

The ipath_verbs.c file implements the driver-specific components of the
kernel's Infiniband verbs layer.

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>