]> pilppa.com Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
17 years agomlx4_core: Fix section mismatches
Roland Dreier [Wed, 10 Oct 2007 22:43:54 +0000 (15:43 -0700)]
mlx4_core: Fix section mismatches

Commit ee49bd93 ("mlx4_core: Reset device when internal error is
detected") introduced some section mismatch problems when
CONFIG_HOTPLUG=n, because the error recovery code tears down and
reinitializes the device after everything is loaded, which ends up
calling into lots of code marked __devinit and __devexit from regular
.text.  Fix this by getting rid of these now-incorrect section
markers.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB: Allow setting policy to ignore multicast groups
Or Gerlitz [Mon, 8 Oct 2007 08:13:00 +0000 (10:13 +0200)]
IPoIB: Allow setting policy to ignore multicast groups

The kernel IB stack allows (through the RDMA CM) userspace
applications to join and use multicast groups from the IPoIB MGID
range.  This allows multicast traffic to be handled directly from
userspace QPs, without going through the kernel stack, which gives
better performance for some applications.

However, to fully interoperate with IP multicast, such userspace
applications need to participate in IGMP reports and queries, or else
routers may not forward the multicast traffic to the system where the
application is running.  The simplest way to do this is to share the
kernel IGMP implementation by using the IP_ADD_MEMBERSHIP option to
join multicast groups that are being handled directly in userspace.

However, in such cases, the actual multicast traffic should not also
be handled by the IPoIB interface, because that would burn resources
handling multicast packets that will just be discarded in the kernel.

To handle this, this patch adds lookup on the database used for IB
multicast group reference counting when IPoIB is joining multicast
groups, and if a multicast group is already handled by user space,
then the IPoIB kernel driver ignores the group.  This is controlled by
a per-interface policy flag.  When the flag is set, IPoIB will not
join and attach its QP to a multicast group which already has an entry
in the database; when the flag is cleared, IPoIB will behave as before
this change.

For each IPoIB interface, the /sys/class/net/$intf/umcast attribute
controls the policy flag.  The default value is off/0.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Mark error paths as unlikely() in post_srq_recv functions
Eli Cohen [Wed, 10 Oct 2007 15:55:37 +0000 (17:55 +0200)]
IB/mthca: Mark error paths as unlikely() in post_srq_recv functions

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Minor fix to ordering of freeing and zeroing of tid pages.
Dave Olson [Wed, 3 Oct 2007 19:47:00 +0000 (12:47 -0700)]
IB/ipath: Minor fix to ordering of freeing and zeroing of tid pages.

Fixed to be the same as everywhere else.  copy and then zero the page *
in the array first, and then pass the copy to the VM routines.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Remove redundant link state checks
Ralph Campbell [Fri, 5 Oct 2007 23:03:21 +0000 (16:03 -0700)]
IB/ipath: Remove redundant link state checks

This patch removes some redundant checks when the SMA changes the link
state since the same checks are made in the lower level function that
sets the state.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix IB_EVENT_PORT_ERR event
Ralph Campbell [Wed, 19 Sep 2007 23:47:31 +0000 (16:47 -0700)]
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>
17 years agoIB/ipath: Better handling of unexpected GPIO interrupts
Michael Albaugh [Wed, 3 Oct 2007 17:47:38 +0000 (10:47 -0700)]
IB/ipath: Better handling of unexpected GPIO interrupts

The General Purpose I/O pins can be configured to cause interrupts. At
the end of the interrupt code dealing with all known causes, a message
is output if any bits remain un-handled. Since this is a "can't happen"
scenario, it should only be triggered by bugs elsewhere. It is harmless,
and potentially beneficial, to limit the damage by masking any such
unexpected interrupts.

This patch adds disabling of interrupts from any pins that should
not have been allowed to interrupt, in addition to emitting a message.

Signed-off-by: Michael Albaugh <Michael.Albaugh@Qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Maintain active time on all chips
Michael Albaugh [Tue, 2 Oct 2007 20:26:45 +0000 (13:26 -0700)]
IB/ipath: Maintain active time on all chips

There is a count of "active hours" maintained in EEPROM, to aid
troubleshooting. The definition of "active" is based on traffic
exceeding a threshold in any given 5-second polling interval. As
originally written, the check was inadvertently bypassed for chips whose
counters were 64-bits wide, and only applied to chips with 32-bit wide
counters.

This patch moves the test for amount of traffic "out" to a more common
location, rather than depending on a side-effect of the software
emulation of 64-bit counts on chips whose hardware is only 32-bits wide.

Signed-off-by: Michael Albaugh <Michael.Albaugh@Qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Fix QHT7040 serial number check
Dave Olson [Fri, 17 Aug 2007 01:10:43 +0000 (18:10 -0700)]
IB/ipath: Fix QHT7040 serial number check

Remove all the OEM and bringup boards, and complain and fail
initialization if one is found.  QHT7040 with GPIO rework (128ywwuuuu)
is OK, older 112ywwuuuu is no longer supported). The check that had been
added was failing both the 112 and 128 series.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Indicate a couple of chip bugs to userspace
Arthur Jones [Tue, 18 Sep 2007 21:44:45 +0000 (14:44 -0700)]
IB/ipath: Indicate a couple of chip bugs to userspace

A couple of chip bugs in the iba6110 and in the iba6120 are not in more
recent chips.  This first bug swaps two of the pioavail register
locations.  In the second bug, the chip can sometimes forget to dma the
pio avail register to memory.  We indicate the presence of these bugs
with runtime flags and we indicate the presence of the flags by bumping
the SWMINOR.

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: iba6110 rev4 no longer needs recv header overrun workaround
Arthur Jones [Tue, 18 Sep 2007 21:24:23 +0000 (14:24 -0700)]
IB/ipath: iba6110 rev4 no longer needs recv header overrun workaround

iba6110 rev3 and earlier had a chip bug where the chip could overrun the
recv header queue. rev4 fixed this chip bug so userspace no longer needs
to workaround it.  Now we only set the workaround flag for older chip
versions.

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Use counters in ipath_poll and cleanup interrupts in ipath_close
Arthur Jones [Fri, 14 Sep 2007 19:22:49 +0000 (12:22 -0700)]
IB/ipath: Use counters in ipath_poll and cleanup interrupts in ipath_close

ipath_poll() suffered from a couple subtle bugs.  Under the right
conditions we could leave recv interrupts enabled on an ipath user
context on close, thereby taking potentially unwanted interrupts on the
next open -- this is fixed by unconditionally turning off recv
interrupts on close.  Also, we now use counters rather than set/clear
bits which allows us to make sure we catch all interrupts at the cost of
changing the semantics slightly (it's now give me all events since the
last time I called poll() rather than give me all events since I called
_this_ poll routine).  We also added some memory barriers which may help
ensure we get all notifications in a timely manner.

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Remove duplicate copy of LMC
Ralph Campbell [Thu, 13 Sep 2007 18:42:52 +0000 (11:42 -0700)]
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>
17 years agoIB/ipath: Add ability to set the LMC via the sysfs debugging interface
Ralph Campbell [Wed, 12 Sep 2007 22:00:58 +0000 (15:00 -0700)]
IB/ipath: Add ability to set the LMC via the sysfs debugging interface

This patch adds the ability to set the LMC via a sysfs file as if the SM
sent a SubnSet(PortInfo) MAD.  It is useful for debugging when no SM is
running.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Optimize completion queue entry insertion and polling
Ralph Campbell [Fri, 7 Sep 2007 23:54:01 +0000 (16:54 -0700)]
IB/ipath: Optimize completion queue entry insertion and polling

The code to add an entry to the completion queue stored the QPN which is
needed for the user level verbs view of the completion queue entry but
the kernel struct ib_wc contains a pointer to the QP instead of a QPN.
When the kernel polled for a completion queue entry, the QPN was lookup
up and the QP pointer recovered. This patch stores the CQE differently
based on whether the CQ is a kernel CQ or a user CQ thus avoiding the
QPN to QP lookup overhead.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Implement IB_EVENT_QP_LAST_WQE_REACHED
Ralph Campbell [Sat, 25 Aug 2007 23:45:03 +0000 (16:45 -0700)]
IB/ipath: Implement IB_EVENT_QP_LAST_WQE_REACHED

This patch implements the IB_EVENT_QP_LAST_WQE_REACHED event which is
needed by ib_ipoib to destroy the QP when used in connected mode.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Generate flush CQE when QP is in error state
Ralph Campbell [Sat, 25 Aug 2007 23:48:29 +0000 (16:48 -0700)]
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>
17 years agoIB/ipath: Remove redundant code
Ralph Campbell [Mon, 20 Aug 2007 23:52:35 +0000 (16:52 -0700)]
IB/ipath: Remove redundant code

This patch removes some redundant initialization code.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Future proof eeprom checksum code (contents reading)
Dave Olson [Fri, 17 Aug 2007 21:42:14 +0000 (14:42 -0700)]
IB/ipath: Future proof eeprom checksum code (contents reading)

In an earlier change, the amount of data read from the flash was
mistakenly limited to the size known to the current driver.  This causes
problems when the length is increased, and written with the new longer
version; the checksum would fail because not enough data was read.
Always read the full 128 byte length to prevent this.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: UC RDMA WRITE with IMMEDIATE doesn't send the immediate
Ralph Campbell [Fri, 17 Aug 2007 18:28:48 +0000 (11:28 -0700)]
IB/ipath: UC RDMA WRITE with IMMEDIATE doesn't send the immediate

This patch fixes a bug in the receive processing for UC RDMA WRITE with
immediate which caused the last packet to be dropped.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Correctly describe workaround for TID write chip bug
Dave Olson [Thu, 9 Aug 2007 22:18:48 +0000 (15:18 -0700)]
IB/ipath: Correctly describe workaround for TID write chip bug

This is a comment change, only, correcting the comment to match the
implemented workaround, rather than the original workaround, and
clarifying why it's needed.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Remove unneeded code for ipathfs
Ralph Campbell [Wed, 8 Aug 2007 01:09:34 +0000 (18:09 -0700)]
IB/ipath: Remove unneeded code for ipathfs

The ipathfs file system is used to export binary data verses ASCII data
such as through /sys. This patch removes some unneeded files since the
data is available through other /sys files.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Verify host bus bandwidth to chip will not limit performance
Dave Olson [Fri, 1 Jun 2007 20:01:47 +0000 (13:01 -0700)]
IB/ipath: Verify host bus bandwidth to chip will not limit performance

There have been a number of issues where host bandwidth via HT or PCIe
to the InfiniPath chip has been limited in some fashion (BIOS,
configuration, etc.), resulting in user confusion.  This check gives a
clear warning that something is wrong and needs to be resolved.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ipath: Change UD to queue work requests like RC & UC
Ralph Campbell [Wed, 25 Jul 2007 18:08:28 +0000 (11:08 -0700)]
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>
17 years agoIB/ipath: Performance optimization for CPU differences
Ralph Campbell [Tue, 24 Jul 2007 20:55:39 +0000 (13:55 -0700)]
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>
17 years agoIB/ipath: iba6110 rev4 GPIO counters support
Arthur Jones [Thu, 2 Aug 2007 21:46:29 +0000 (14:46 -0700)]
IB/ipath: iba6110 rev4 GPIO counters support

On iba6110 rev4, support for three more IB counters were added.  The
LocalLinkIntegrityError counter, the ExcessiveBufferOverrunErrors
counter and support for error counting of flow control packets on an
invalid VL.  These counters trigger GPIO interrupts and the sw keeps
track of the counts.  Since we also use GPIO interrupts to signal packet
reception, we need to turn off the fast interrupts, or we risk losing a
GPIO interrupt.

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Fix clipping of device limits to INT_MAX
Roland Dreier [Wed, 10 Oct 2007 02:59:18 +0000 (19:59 -0700)]
IB/ehca: Fix clipping of device limits to INT_MAX

Doing min_t(int, foo, INT_MAX) doesn't work correctly, because if foo
is bigger than INT_MAX, then when treated as a signed integer, it will
become negative and hence such an expression is just an elaborate NOP.

Fix such cases in ehca to do min_t(unsigned, foo, INT_MAX) instead.
This fixes negative reported values for max_cqe, max_pd and max_ah:

Before:

        max_cqe:                        -64
        max_pd:                         -1
        max_ah:                         -1

After:
        max_cqe:                        2147483647
        max_pd:                         2147483647
        max_ah:                         2147483647

Based on a bug report and fix from Anton Blanchard <anton@samba.org>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB/cm: Clean up initialization of QP attr in ipoib_cm_create_tx_qp()
Dotan Barak [Sun, 7 Oct 2007 07:30:48 +0000 (09:30 +0200)]
IPoIB/cm: Clean up initialization of QP attr in ipoib_cm_create_tx_qp()

Make the way QP is being created in ipoib_cm_create_tx_qp()
consistent with ipoib_cm_create_rx_qp().

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Use mmiowb() to avoid firmware commands getting jumbled up
Roland Dreier [Wed, 10 Oct 2007 02:59:18 +0000 (19:59 -0700)]
mlx4_core: Use mmiowb() to avoid firmware commands getting jumbled up

Firmware commands are sent to the HCA by writing multiple words to a
command register block.  Access to this block of registers is
serialized with a mutex.  However, on large SGI systems writes to the
register block may be reordered within the system interconnect and
reach the HCA in a different order than they were issued (even with
the mutex).  Fix this by adding an mmiowb() before dropping the mutex.

This bug was observed with real workloads with the similar FW command
code in the mthca driver, and adding the mmiowb() as in commit
66547550 ("IB/mthca: Use mmiowb() to avoid firmware commands getting
jumbled up") was confirmed to fix the problems, so we should add the
same fix to mlx4.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Use mmiowb() to avoid firmware commands getting jumbled up
Roland Dreier [Wed, 10 Oct 2007 02:59:17 +0000 (19:59 -0700)]
IB/mthca: Use mmiowb() to avoid firmware commands getting jumbled up

Firmware commands are sent to the HCA by writing multiple words to a
command register block.  Access to this block of registers is
serialized with a mutex.  However, on large SGI systems, problems were
seen with multiple CPUs issuing FW commands at the same time, because
the writes to the register block may be reordered within the system
interconnect and reach the HCA in a different order than they were
issued (even with the mutex).  Fix this by adding an mmiowb() before
dropping the mutex.

Tested-by: Arthur Kepner <akepner@sgi.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRDMA/cma: Queue IB CM MRAs to avoid unnecessary remote retries
Sean Hefty [Wed, 1 Aug 2007 21:47:16 +0000 (14:47 -0700)]
RDMA/cma: Queue IB CM MRAs to avoid unnecessary remote retries

Automatically queue MRA message to decrease the number of retries sent
by the remote side during connection establishment.  This also has the
effect of increasing the overall connection timeout without using a
longer retry time in the case of dropped packets.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/cm: Modify interface to send MRAs in response to duplicate messages
Sean Hefty [Wed, 1 Aug 2007 20:49:53 +0000 (13:49 -0700)]
IB/cm: Modify interface to send MRAs in response to duplicate messages

The IB CM provides a message received acknowledged (MRA) message that
can be sent to indicate that a REQ or REP message has been received, but
will require more time to process than the timeout specified by those
messages.  In many cases, the application may not know how long it will
take to respond to a CM message, but the majority of the time, it will
usually respond before a retry has been sent.  Rather than sending an
MRA in response to all messages just to handle the case where a longer
timeout is needed, it is more efficient to queue the MRA for sending in
case a duplicate message is received.

This avoids sending an MRA when it is not needed, but limits the number
of times that a REQ or REP will be resent.  It also provides for a
simpler implementation than generating the MRA based on a timer event.
(That is, trying to send the MRA after receiving the first REQ or REP if
a response has not been generated, so that it is received at the remote
side before a duplicate REQ or REP has been received)

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Increase max number of QPs per multicast group to 56
Roland Dreier [Wed, 10 Oct 2007 02:59:17 +0000 (19:59 -0700)]
IB/mthca: Increase max number of QPs per multicast group to 56

Increase the number of QPs allowed per multicast group from 8 to 56.
This allows for one QP per core on 16-core systems, which are now
quite common, and allows some space for future growth.

This is basically the same patch that Jack Morgenstein
<jackm@dev.mellanox.co.il> just supplied for mlx4.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Increase max number of QPs per multicast group to 56
Jack Morgenstein [Tue, 2 Oct 2007 07:40:13 +0000 (09:40 +0200)]
mlx4_core: Increase max number of QPs per multicast group to 56

Increase the number of QPs allowed per multicast group from 8 to 56.
This allows for one QP per core on 16-core systems, which are now
quite common, and allows some space for future growth.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mlx4: Implement FMRs
Jack Morgenstein [Wed, 1 Aug 2007 09:29:05 +0000 (12:29 +0300)]
IB/mlx4: Implement FMRs

Implement FMRs for mlx4.  This is an adaptation of code from mthca.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Write MTTs from CPU instead with of WRITE_MTT FW command
Jack Morgenstein [Wed, 1 Aug 2007 09:28:53 +0000 (12:28 +0300)]
mlx4_core: Write MTTs from CPU instead with of WRITE_MTT FW command

Write MTT entries directly to ICM from the driver (eliminating use of
WRITE_MTT command).  This reduces the number of FW commands needed to
register an MR by at least a factor of 2 and speeds up memory
registration significantly.  This code will also be used to implement
FMRs.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Fix meaning of dev->caps.reserved_mtts
Roland Dreier [Wed, 10 Oct 2007 02:59:16 +0000 (19:59 -0700)]
mlx4_core: Fix meaning of dev->caps.reserved_mtts

Everything that uses caps.reserved_mtts expects it to be a count of MTT
segments, not MTT entries.  So convert the value that the FW gives us to
a count of segments.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Reserve the correct number of MTT segments
Roland Dreier [Wed, 10 Oct 2007 02:59:16 +0000 (19:59 -0700)]
mlx4_core: Reserve the correct number of MTT segments

Taking ilog2(dev->caps.reserved_mtts) to find out the order to pass to
the MTT buddy allocator will do the wrong thing if reserved_mtts is ever
not a power of 2.  Be safe and use fls(dev->caps.reserved_mtts - 1).

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Support ICM tables in coherent memory
Jack Morgenstein [Wed, 1 Aug 2007 09:28:20 +0000 (12:28 +0300)]
mlx4_core: Support ICM tables in coherent memory

Enable having ICM tables in coherent memory, and use coherent memory
for the dMPT table.  This will allow writing MPT entries for MRs both
via the SW2HW_MPT command and also directly by the driver for FMR
remapping without needing to flush or worry about cacheline boundaries.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/uverbs: Make ib_uverbs_release_event_file() static
Roland Dreier [Wed, 10 Oct 2007 02:59:15 +0000 (19:59 -0700)]
IB/uverbs: Make ib_uverbs_release_event_file() static

ib_uverbs_release_event_file() is only used in uverbs_main.c, so make it
static to that file.  Also move the definition before the first use, so
a forward declaration is not needed.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/umad: Fix bit ordering and 32-on-64 problems on big endian systems
Roland Dreier [Wed, 10 Oct 2007 02:59:15 +0000 (19:59 -0700)]
IB/umad: Fix bit ordering and 32-on-64 problems on big endian systems

The declaration of struct ib_user_mad_reg_req.method_mask[] exported
to userspace was an array of __u32, but the kernel internally treated
it as a bitmap made up of longs.  This makes a difference for 64-bit
big-endian kernels, where numbering the bits in an array of__u32 gives:

    |31.....0|63....31|95....64|127...96|

while numbering the bits in an array of longs gives:

    |63..............0|127............64|

64-bit userspace can handle this by just treating method_mask[] as an
array of longs, but 32-bit userspace is really stuck: the meaning of
the bits in method_mask[] depends on whether the kernel is 32-bit or
64-bit, and there's no sane way for userspace to know that.

Fix this by updating <rdma/ib_user_mad.h> to make it clear that
method_mask[] is an array of longs, and using a compat_ioctl method to
convert to an array of 64-bit longs to handle the 32-on-64 problem.
This fixes the interface description to match existing behavior (so
working binaries continue to work) in almost all situations, and gives
consistent semantics in the case of 32-bit userspace that can run on
either a 32-bit or 64-bit kernel, so that the same binary can work for
both 32-on-32 and 32-on-64 systems.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/umad: Add P_Key index support
Roland Dreier [Wed, 10 Oct 2007 02:59:15 +0000 (19:59 -0700)]
IB/umad: Add P_Key index support

Add support for setting the P_Key index of sent MADs and getting the
P_Key index of received MADs.  This requires a change to the layout of
the ABI structure struct ib_user_mad_hdr, so to avoid breaking
compatibility, we default to the old (unchanged) ABI and add a new
ioctl IB_USER_MAD_ENABLE_PKEY that allows applications that are aware
of the new ABI to opt into using it.

We plan on switching to the new ABI by default in a year or so, and
this patch adds a warning that is printed when an application uses the
old ABI, to push people towards converting to the new ABI.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Reviewed-by: Hal Rosenstock <hal@xsigo.com>
17 years agoIB/ehca: Return srq_attr->max_sge in ehca_query_srq()
Joachim Fenkes [Fri, 28 Sep 2007 15:20:05 +0000 (17:20 +0200)]
IB/ehca: Return srq_attr->max_sge in ehca_query_srq()

Totally forgot this.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Adjust 64-bit alignment of create QP response for userspace
Hoang-Nam Nguyen [Fri, 28 Sep 2007 15:18:47 +0000 (17:18 +0200)]
IB/ehca: Adjust 64-bit alignment of create QP response for userspace

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Fix mem leak of firmware ctrlblock in ehca_create_srq()
Hoang-Nam Nguyen [Fri, 28 Sep 2007 15:16:27 +0000 (17:16 +0200)]
IB/ehca: Fix mem leak of firmware ctrlblock in ehca_create_srq()

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mlx4: Display misc device information under /sys/class/infiniband/
Jack Morgenstein [Tue, 18 Sep 2007 07:14:18 +0000 (09:14 +0200)]
IB/mlx4:  Display misc device information under /sys/class/infiniband/

display the following device information under /sys/class/infiniband/mlx4_X:
board_id, fw_ver, hw_rev, hca_type.

This patch makes this information available to userspace utilities
such as ibstat and ibv_devinfo.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/core: Fix handling of multicast response failures
Ralph Campbell [Thu, 20 Sep 2007 23:33:44 +0000 (16:33 -0700)]
IB/core: Fix handling of multicast response failures

I was looking at the code for multicast.c and noticed that
ib_sa_join_multicast() calls queue_join() which puts the
request at the front of the group->pending_list.  If this
is a second request, it seems like it would interfere with
process_join_error() since group->last_join won't point
to the member at the head of the pending_list. The sequence
would thus be:

1. ib_sa_join_multicast()
   puts member1 on head of pending_list and starts work thread
2. mcast_work_handler()
   calls send_join() which sets group->last_join to member1
3. ib_sa_join_multicast()
   puts member2 on head of pending_list
4. join operation for member1 receives failures response from SA.
5. join_handler() is called with error status
6. process_join_error() fails to process member1 since
   it doesn't match the first entry in the group->pending_list.

The impact is that the failed join request is tossed.  The second
request is processed, and after it completes, the original request ends
up being retried.

This change also results in join requests being processed in FIFO
order.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Misc cpuinit section annotations and #ifdef cleanups
Satyam Sharma [Wed, 22 Aug 2007 23:28:30 +0000 (04:58 +0530)]
IB/ehca: Misc cpuinit section annotations and #ifdef cleanups

* Replace {un}register_cpu_notifier with {un}register_hotcpu_notifier
  thereby losing a couple of #ifdef HOTPLUG_CPU pairs.
* Move comp_pool_callback_nb declaration to below that of callback
  function so that initialization of .notifier_call and .priority can
  occur at build time itself and not runtime.
* Mark the notifier_block (and callback function, and another static
  function used by it) as __cpuinit{data} for the sake of consistency
  and remove enclosing #ifdef. (This may increase size for modular
  build of this module, however, because these are no longer dropped
  unconditionally now.)

Signed-off-by: Satyam Sharma <satyam@infradead.org>
Acked-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Change capability decoding: SRC->XRC
Roland Dreier [Wed, 10 Oct 2007 02:59:13 +0000 (19:59 -0700)]
mlx4_core: Change capability decoding: SRC->XRC

The SRC ("scalable RC") transport has been renamed to XRC ("extended
RC"), to avoid having an abbreviation that is so easily confused with an
abbreviation for "source."  Update the HCA capability decoding output to
use the new name.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/iser: Remove unnecessary includes
Roland Dreier [Wed, 10 Oct 2007 02:59:13 +0000 (19:59 -0700)]
IB/iser: Remove unnecessary includes

<asm/scatterlist.h> is not needed because everyplace it appears,
<linux/scatterlist.h> also appears.  <asm/io.h> is not needed because
nothing seems to be using device IO anyway.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRDMA/cma: Use neigh_event_send() to start neighbour discovery
Steve Wise [Wed, 12 Sep 2007 10:00:25 +0000 (05:00 -0500)]
RDMA/cma: Use neigh_event_send() to start neighbour discovery

Calling arp_send() to initiate neighbour discovery (ND) doesn't do the
full ND protocol.  Namely, it doesn't handle retransmitting the arp
request if it is dropped. The function neigh_event_send() does all
this.  Without doing full ND, RDMA address resolution fails in the
presence of dropped ARP broadcast packets.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Only use MR large pages for hugetlb regions
Joachim Fenkes [Thu, 13 Sep 2007 16:16:20 +0000 (18:16 +0200)]
IB/ehca: Only use MR large pages for hugetlb regions

...because, on virtualized hardware like System p, we can't be sure
that the physical pages behind them are contiguous otherwise.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/umem: Add hugetlb flag to struct ib_umem
Joachim Fenkes [Thu, 13 Sep 2007 16:15:28 +0000 (18:15 +0200)]
IB/umem: Add hugetlb flag to struct ib_umem

During ib_umem_get(), determine whether all pages from the memory
region are hugetlb pages and report this in the "hugetlb" member.
Low-level drivers can use this information if they need it.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/srp: Add QoS support through service ID
Sean Hefty [Wed, 8 Aug 2007 22:51:18 +0000 (15:51 -0700)]
IB/srp: Add QoS support through service ID

Provide the target service ID when performing a path record query to
support optional QoS capability.  QoS requires support from the SA.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRDMA/ucma: Allow user space to set service type
Sean Hefty [Wed, 8 Aug 2007 22:51:13 +0000 (15:51 -0700)]
RDMA/ucma: Allow user space to set service type

Export the ability to set the type of service to user space.  Model
the interface after setsockopt.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRDMA/cma: Add ability to specify type of service
Sean Hefty [Wed, 8 Aug 2007 22:51:06 +0000 (15:51 -0700)]
RDMA/cma: Add ability to specify type of service

Provide support to specify a type of service for a communication
identifier.  A new function call is used when dealing with IPv4
addresses.  For IPv6 addresses, the ToS is specified through the
traffic class field in the sockaddr_in6 structure.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
[ The comments Eitan Zahavi and myself have made over the v1 post at
  <http://lists.openfabrics.org/pipermail/general/2007-August/039247.html>
  were fully addressed. ]

Reviewed-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/sa: Add new QoS fields to path record
Sean Hefty [Wed, 8 Aug 2007 22:41:28 +0000 (15:41 -0700)]
IB/sa: Add new QoS fields to path record

The QoS annex defines new fields for path records.  Add them to the
ib_sa for consumers that want to use them.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Reviewed-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB: Specify Traffic Class with path record queries for QoS support
Sean Hefty [Thu, 2 Aug 2007 19:21:31 +0000 (12:21 -0700)]
IPoIB: Specify Traffic Class with path record queries for QoS support

To support QoS within and between subnets, modify IPoIB to request
specific Traffic Class values with path record queries, using
the value associated with the IPoIB broadcast group.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
[ See some comments I made on this at v1 and v2 of the posts
  <http://lists.openfabrics.org/pipermail/general/2007-August/039275.html>
  <http://lists.openfabrics.org/pipermail/general/2007-September/040312.html> ]

Reviewed-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Fix large page HW cap defines
Hoang-Nam Nguyen [Thu, 13 Sep 2007 16:14:58 +0000 (18:14 +0200)]
IB/ehca: Fix large page HW cap defines

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Bump version number and change its format
Joachim Fenkes [Tue, 11 Sep 2007 13:35:32 +0000 (15:35 +0200)]
IB/ehca: Bump version number and change its format

Nobody needed the SVNEHCA_ prefix anyway.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Replace get_paca()->paca_index by the more portable raw_smp_processor_id()
Joachim Fenkes [Wed, 12 Sep 2007 14:44:11 +0000 (16:44 +0200)]
IB/ehca: Replace get_paca()->paca_index by the more portable raw_smp_processor_id()

We can use raw_smp_processor_id() here because the processor ID is
only used for debug output and therefore our use is preemption-unsafe.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Serialize MR alloc and MR free hvCalls
Joachim Fenkes [Tue, 11 Sep 2007 13:34:35 +0000 (15:34 +0200)]
IB/ehca: Serialize MR alloc and MR free hvCalls

Some firmware levels exhibit a race condition between H_ALLOC_RESOURCE(MR)
and H_FREE_RESOURCE(MR).  Work around this problem by locking these hvCalls
against each other.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Path migration support
Joachim Fenkes [Tue, 11 Sep 2007 13:34:04 +0000 (15:34 +0200)]
IB/ehca: Path migration support

Fix some modify_qp() issues related to path migration.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Add check for max #SGE to create_qp()
Joachim Fenkes [Tue, 11 Sep 2007 13:33:40 +0000 (15:33 +0200)]
IB/ehca: Add check for max #SGE to create_qp()

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: ehca_gen_warn() should always print
Joachim Fenkes [Tue, 11 Sep 2007 13:32:50 +0000 (15:32 +0200)]
IB/ehca: ehca_gen_warn() should always print

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Print return codes as signed decimal integers
Joachim Fenkes [Tue, 11 Sep 2007 13:32:22 +0000 (15:32 +0200)]
IB/ehca: Print return codes as signed decimal integers

...because -12 is easier to read than FFFFFFF4.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Refactor hvcall tracing
Joachim Fenkes [Tue, 11 Sep 2007 13:31:49 +0000 (15:31 +0200)]
IB/ehca: Refactor hvcall tracing

Change hvcall trace output towards better readability: reg numbers
instead of argument numbers, return code as signed decimal instead of
unsigned hex.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Use remap_4k_pfn() to map firmware contexts to user space
Hoang-Nam Nguyen [Tue, 11 Sep 2007 13:31:06 +0000 (15:31 +0200)]
IB/ehca: Use remap_4k_pfn() to map firmware contexts to user space

Use Paul's new remap_4k_pfn() function to map our 4K firmware contexts
into user space on 64K-page machines without exposing neighboring
firmware contexts. Return the context's offset within a 64K page to
user space so it can determine the proper virtual address.

For details about remap_4k_pfn(), see commit 721151d0 or
http://patchwork.ozlabs.org/linuxppc/patch?id=10281

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Support more than 4k QPs for userspace and kernelspace
Stefan Roscher [Tue, 11 Sep 2007 13:29:39 +0000 (15:29 +0200)]
IB/ehca: Support more than 4k QPs for userspace and kernelspace

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Small QP userspace support
Stefan Roscher [Tue, 11 Sep 2007 13:26:33 +0000 (15:26 +0200)]
IB/ehca: Small QP userspace support

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Use PCI-X/PCI-Express read control interfaces
Peter Oruba [Fri, 10 Aug 2007 20:54:33 +0000 (13:54 -0700)]
IB/mthca: Use PCI-X/PCI-Express read control interfaces

These driver changes incorporate the proposed PCI-X / PCI-Express read
byte count interface.  Reading and setting those values doesn't take
place "manually", instead wrapping functions are called to allow
quirks for some PCI bridges.

Signed-off by: Peter Oruba <peter.oruba@amd.com>
Based on work by Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/sa: Error handling thinko fix
Ali Ayoub [Sun, 9 Sep 2007 11:55:11 +0000 (14:55 +0300)]
IB/sa: Error handling thinko fix

ib_create_send_mad() returns an error code pointer on error, not NULL.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Export module parameters in sysfs
Anton Blanchard [Wed, 29 Aug 2007 17:43:01 +0000 (12:43 -0500)]
IB/ehca: Export module parameters in sysfs

At the moment the ehca module parameters are not exported in sysfs.
Export them with 0444 permissions.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Make output clearer by removing some debug messages
Anton Blanchard [Wed, 29 Aug 2007 16:05:35 +0000 (11:05 -0500)]
IB/ehca: Make output clearer by removing some debug messages

ehca spits out a lot of debugging information. I had to look closely to
see the "Port 1 is not active" message within all the debug:

eHCA Infiniband Device Driver (Rel.: SVNEHCA_0022)
eHCA scaling code enabled
ehca D.001.DQDXYCB-P1-C9: PU0006 EHCA_ERR:ehca_define_sqp Port 1 is not active.
ehca D.001.DQDXYCB-P1-C9: PU0006 EHCA_ERR:ehca_create_qp ehca_define_sqp() failed rc=ffffffffffffffff
ib_mad: Couldn't create ib_mad QP1
ib_mad: Couldn't open ehca0 port 1
ehca D.001.DQDXYCB-P1-C9: PU0006 EHCA_ERR:ehca_alloc_fmr unsupported fmr_attr->page_shift=9
ehca D.001.DQDXYCB-P1-C9: PU0006 EHCA_ERR:ehca_alloc_fmr rc=ffffffffffffffea pd=c000000b4b5b2420 mr_access_flags=7 fmr_attr=c0000005afd37394
fmr_create failed for FMR 0

Remove a few debug statements so that things are clearer:

eHCA Infiniband Device Driver (Rel.: SVNEHCA_0022)
eHCA scaling code enabled
ehca D.001.DQDXYCB-P1-C9: PU0006 EHCA_ERR:ehca_define_sqp Port 1 is not active.
ib_mad: Couldn't create ib_mad QP1
ib_mad: Couldn't open ehca0 port 1
ehca D.001.DQDXYCB-P1-C9: PU0006 EHCA_ERR:ehca_alloc_fmr unsupported fmr_attr->page_shift=9
fmr_create failed for FMR 0

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mlx4: Fix up SRQ limit_watermark endianness
Roland Dreier [Wed, 10 Oct 2007 02:59:06 +0000 (19:59 -0700)]
IB/mlx4: Fix up SRQ limit_watermark endianness

mlx4_srq_query() returns a big-endian 16-bit value through an int *,
which screws up sparse checking.  Fix this so that a CPU-endian value
is returned.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB: Fix error path memory leak
Eli Cohen [Tue, 21 Aug 2007 15:46:10 +0000 (18:46 +0300)]
IPoIB: Fix error path memory leak

Clean up properly if ib_query_pkey() or ib_query_gid() fail.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB: Fix typo to end statement with ';' instead of ','
Eli Cohen [Wed, 10 Oct 2007 02:59:06 +0000 (19:59 -0700)]
IPoIB: Fix typo to end statement with ';' instead of ','

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mthca: Enable MSI-X by default
Michael S. Tsirkin [Tue, 7 Aug 2007 13:10:34 +0000 (16:10 +0300)]
IB/mthca: Enable MSI-X by default

Recover from MSI-X errors by automatically falling back on regular
interrupt, instead of asking the user to do this manually.  This makes
it possible to enable MSI-X by default, and will make it possible to
get rid of the msi_x module option in the future.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Enable MSI-X by default
Michael S. Tsirkin [Tue, 7 Aug 2007 13:08:28 +0000 (16:08 +0300)]
mlx4_core: Enable MSI-X by default

Recover from MSI-X errors by automatically falling back on regular
interrupt, instead of asking the user to do this manually.  This makes
it possible to enable MSI-X by default, and will make it possible to
get rid of the msi_x module option in the future.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/fmr_pool: Clean up some error messages in fmr_pool.c
Anton Blanchard [Wed, 29 Aug 2007 13:36:22 +0000 (08:36 -0500)]
IB/fmr_pool: Clean up some error messages in fmr_pool.c

A number of printks in fmr_pool.c dont have newlines, eg:

    fmr_create failed for FMR 0<5>FS-Cache: Loaded

Fix them up.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/ehca: Include <linux/mutex.h> from ehca_classes.h
Roland Dreier [Wed, 10 Oct 2007 02:59:05 +0000 (19:59 -0700)]
IB/ehca: Include <linux/mutex.h> from ehca_classes.h

ehca_classes.h uses struct mutex, so while <linux/mutex.h> seems to be
pulled in indirectly by one of the headers it includes, the right
thing is to include <linux/mutex.h> directly.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Acked-by: Stefan Roscher <stefan.roscher@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB/mlx4: Use __set_data_seg() in mlx4_ib_post_recv()
Roland Dreier [Wed, 10 Oct 2007 02:59:05 +0000 (19:59 -0700)]
IB/mlx4: Use __set_data_seg() in mlx4_ib_post_recv()

Use a __set_data_seg() helper in mlx4_ib_post_recv() too; in addition
to making the code easier to read, this also allows gcc to generate
better code -- on x86_64:

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-8 (-8)
function                                     old     new   delta
mlx4_ib_post_recv                            359     351      -8

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Don't free special QPs in QP number bitmap
Roland Dreier [Wed, 10 Oct 2007 02:59:05 +0000 (19:59 -0700)]
mlx4_core: Don't free special QPs in QP number bitmap

Special QPs are not allocated using the regular QP number bitmap, so
when they are destroyed, their QP number should not be freed in the
bitmap.

Found by Dotan Barak of Mellanox.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agomlx4_core: Use enum value GO_BIT_TIMEOUT_MSECS
Dotan Barak [Tue, 7 Aug 2007 08:18:52 +0000 (11:18 +0300)]
mlx4_core: Use enum value GO_BIT_TIMEOUT_MSECS

Rename GO_BIT_TIMEOUT to GO_BIT_TIMEOUT_MSECS for clarity, and
actually use it as the go bit timeout (instead of having the define
but then ignoring it and using a hard-coded 10 * HZ for the actual
timeout).

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIB: find_first_zero_bit() takes unsigned pointer
Roland Dreier [Wed, 10 Oct 2007 02:59:04 +0000 (19:59 -0700)]
IB: find_first_zero_bit() takes unsigned pointer

Fix sparse warning

    drivers/infiniband/core/device.c:142:6: warning: incorrect type in argument 1 (different signedness)
    drivers/infiniband/core/device.c:142:6:    expected unsigned long const *addr
    drivers/infiniband/core/device.c:142:6:    got long *[assigned] inuse

by making the local variable inuse unsigned.  Does not affect generated
code at all.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoIPoIB: Make sure no receives are handled when stopping device
Roland Dreier [Wed, 10 Oct 2007 02:59:04 +0000 (19:59 -0700)]
IPoIB: Make sure no receives are handled when stopping device

The current IPoIB code might process receive completions from
ipoib_drain_cq() when bringing down the interface.  This could cause
packets to be passed up the stack without the device's poll method
being called.  Avoid this by setting the status of any successful
completions to IB_WC_WR_FLUSH_ERR.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoRDMA/cxgb3: Make the iw_cxgb3 module parameters writable
Steve Wise [Sun, 29 Jul 2007 20:12:26 +0000 (15:12 -0500)]
RDMA/cxgb3: Make the iw_cxgb3 module parameters writable

Allow changing parameter values without having to reload the module.
This is safe because these parameters are only looked at when a new
connection is established.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years agoLinux 2.6.23 v2.6.23
Linus Torvalds [Tue, 9 Oct 2007 20:31:38 +0000 (13:31 -0700)]
Linux 2.6.23

17 years agoMerge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Linus Torvalds [Tue, 9 Oct 2007 19:38:44 +0000 (12:38 -0700)]
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Au1000: set the PCI controller IO base
  [MIPS] Alchemy: Fix USB initialization.
  [MIPS] IP32: Fix fatal typo in address computation.

17 years agoNLM: Fix a memory leak in nlmsvc_testlock
Trond Myklebust [Tue, 9 Oct 2007 15:04:57 +0000 (11:04 -0400)]
NLM: Fix a memory leak in nlmsvc_testlock

The recent fix for a circular lock dependency unfortunately introduced a
potential memory leak in the event where the call to nlmsvc_lookup_host
fails for some reason.

Thanks to Roel Kluin for spotting this.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agosata_mv: correct S/G table limits
Jeff Garzik [Tue, 9 Oct 2007 17:51:57 +0000 (13:51 -0400)]
sata_mv: correct S/G table limits

The recent mv_fill_sg() rewrite, to fix a data corruption problem
related to IOMMU virtual merging, forgot to account for the
potentially-increased size of the scatter/gather table after its run.

Additionally, the DMA boundary is reduced from 0xffffffff to 0xffff
to more closely match the needs of mv_fill_sg().

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years ago[MIPS] Au1000: set the PCI controller IO base
Florian Fainelli [Tue, 25 Sep 2007 15:07:30 +0000 (17:07 +0200)]
[MIPS] Au1000: set the PCI controller IO base

The PCI controller IO base was not set in the au1000 pci code.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] Alchemy: Fix USB initialization.
Florian Fainelli [Tue, 25 Sep 2007 15:07:24 +0000 (17:07 +0200)]
[MIPS] Alchemy: Fix USB initialization.

This patch fixes a wrong ifdef in the board setup code, leading to the GPIO
pin not being pulled high, and thus the USB switch not being powered at all.

This finishes the rename of CONFIG_USB_OHCI to CONFIG_USB_OHCI_HCD, which
started in 2005 (before 2.6.12-rc2), then probably because things were
working anyway for most people got forgotten.

[Ralf: Paolo's original patch didn't fix the module case, Florian's patch
only fixed MTX1 etc. so this is a combined patch plus some cleanups.]

Cc: Giuseppe Patanè <giuseppe.patane@tvblob.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years ago[MIPS] IP32: Fix fatal typo in address computation.
Giuseppe Sacco [Sat, 6 Oct 2007 17:55:03 +0000 (19:55 +0200)]
[MIPS] IP32: Fix fatal typo in address computation.

Signed-off-by: Giuseppe Sacco <eppesuig@debian.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 years agoCorrect Makefile rule for generating custom keymap
Maarten Bressers [Mon, 8 Oct 2007 22:59:13 +0000 (15:59 -0700)]
Correct Makefile rule for generating custom keymap

When building a custom keymap, after setting GENERATE_KEYMAP := 1 in
drivers/char/Makefile, the kernel build fails like this:

    CC      drivers/char/vt.o
  make[2]: *** No rule to make target `drivers/char/%.map', needed by `drivers/char/defkeymap.c'.  Stop.
  make[1]: *** [drivers/char] Error 2
  make: *** [drivers] Error 2

This was caused by commit af8b128719f5248e542036ea994610a29d0642a6, which
deleted a necessary colon from the Makefile rule that generates the keymap,
since that rule contains both a target and a target-pattern.  The following
patch puts the colon back:

Signed-off-by: Maarten Bressers <mbres@gentoo.org>
Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoISDN: Fix data access out of array bounds
Karsten Keil [Mon, 8 Oct 2007 10:52:09 +0000 (12:52 +0200)]
ISDN: Fix data access out of array bounds

Fix against access random data bytes outside the dev->chanmap array.
Thanks to Oliver Neukum for pointing me to this issue.

Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 8 Oct 2007 19:59:10 +0000 (12:59 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IPv6]: Fix ICMPv6 redirect handling with target multicast address
  [PKT_SCHED] cls_u32: error code isn't been propogated properly
  [ROSE]: Fix rose.ko oops on unload
  [TCP]: Fix fastpath_cnt_hint when GSO skb is partially ACKed

17 years agoAIO: fix cleanup in io_submit_one(...)
Yan Zheng [Mon, 8 Oct 2007 19:16:20 +0000 (12:16 -0700)]
AIO: fix cleanup in io_submit_one(...)

When IOCB_FLAG_RESFD flag is set and iocb->aio_resfd is incorrect,
statement 'goto out_put_req' is executed. At label 'out_put_req',
aio_put_req(..) is called, which requires 'req->ki_filp' set.

Signed-off-by: Yan Zheng<yanzheng@21cn.com>
Cc: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agofix page release issue in filemap_fault
Yan Zheng [Mon, 8 Oct 2007 17:08:37 +0000 (10:08 -0700)]
fix page release issue in filemap_fault

find_lock_page increases page's usage count, we should decrease it
before return VM_FAULT_SIGBUS

Signed-off-by: Yan Zheng<yanzheng@21cn.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agofix VM_CAN_NONLINEAR check in sys_remap_file_pages
Yan Zheng [Mon, 8 Oct 2007 17:05:48 +0000 (10:05 -0700)]
fix VM_CAN_NONLINEAR check in sys_remap_file_pages

The test for VM_CAN_NONLINEAR always fails

Signed-off-by: Yan Zheng<yanzheng@21cn.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>