]> err.no Git - linux-2.6/log
linux-2.6
16 years agoIB/mlx4: Update module version and release date
Jack Morgenstein [Thu, 17 Apr 2008 04:09:35 +0000 (21:09 -0700)]
IB/mlx4: Update module version and release date

The mlx4_ib driver is stable enough for production use, so bump the
version number to 1.0 to indicate this.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB: Handle case when P_Key is deleted and re-added at same index
Roland Dreier [Thu, 17 Apr 2008 04:09:35 +0000 (21:09 -0700)]
IPoIB: Handle case when P_Key is deleted and re-added at same index

If a P_Key is deleted and then re-added at the same index, then IPoIB
gets confused because __ipoib_ib_dev_flush() only checks whether the
index is the same without checking whether the P_Key was present, so
the interface is stopped when the P_Key is deleted, but the event when
the P_Key is re-added gets ignored and the interface never gets
restarted.

Also, switch to using ib_find_pkey() instead of ib_find_cached_pkey()
everywhere in IPoIB, since none of the places that look for P_Keys are
in a fast path or in non-sleeping context, and in general we want to
kill off the whole caching infrastructure eventually.  This also fixes
consistency problems caused because some IPoIB queries were cached and
some were uncached during the window where the cache was not updated.

Thanks to Venkata Subramonyam <vsubramo@cisco.com> for debugging this
problem and testing this fix.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/iser: Release connection resources on RDMA_CM_EVENT_DEVICE_REMOVAL event
Erez Zilber [Thu, 17 Apr 2008 04:09:35 +0000 (21:09 -0700)]
IB/iser: Release connection resources on RDMA_CM_EVENT_DEVICE_REMOVAL event

When a RDMA_CM_EVENT_DEVICE_REMOVAL event is raised, iSER should
release the connection resources.

This is necessary when the IB HCA module is unloaded while open-iscsi
is still running.  Currently, iSER just BUG()s.

Signed-off-by: Erez Zilber <erezz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Fix incorrect comment
Eli Cohen [Thu, 17 Apr 2008 04:09:35 +0000 (21:09 -0700)]
IB/mlx4: Fix incorrect comment

mlx4 hardware does not support external DDR memory.  Moreover, UAR
area (BAR 2) can change depending on FW version.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Fix race when detaching a QP from a multicast group
Eli Cohen [Thu, 17 Apr 2008 04:09:35 +0000 (21:09 -0700)]
IB/mlx4: Fix race when detaching a QP from a multicast group

When detaching the last QP from an MCG entry, we need to make
sure that at any time, there will be no entry with zero number of
QPs which is linked to the list of the MCGs of the corresponding
hash index.  So don't write back the MCG entry if we are removing the
last QP; just unlink the entry.

Also, remove an unnecessary MCG read when attaching a QP requires
allocation of a new entry in the AMGM.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ehca: Support all ibv_devinfo values in query_device() and query_port()
Stefan Roscher [Thu, 17 Apr 2008 04:09:35 +0000 (21:09 -0700)]
IB/ehca: Support all ibv_devinfo values in query_device() and query_port()

Also, introduce a few inline helper functions to make the code more readable.

Signed-off-by: Stefan Roscher <stefan.roscher@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Free IRQ before killing tasklet
Roland Dreier [Thu, 17 Apr 2008 04:09:34 +0000 (21:09 -0700)]
RDMA/nes: Free IRQ before killing tasklet

Move the free_irq() call in nes_remove() to before the tasklet_kill();
otherwise there is a window after tasklet_kill() where a new interrupt
can be handled and reschedule the tasklet, leading to a use-after-free
crash.

Cc: <stable@kernel.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mthca: Update module version and release date
Jack Morgenstein [Thu, 17 Apr 2008 04:09:34 +0000 (21:09 -0700)]
IB/mthca: Update module version and release date

The ib_mthca driver has been stable for a while, so bump the version
number to 1.0 to indicate this.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Update QP state if query QP succeeds
Dotan Barak [Thu, 17 Apr 2008 04:09:34 +0000 (21:09 -0700)]
IB/mlx4: Update QP state if query QP succeeds

If the QP was moved to another state (such as SQE) by the hardware,
then after this change the user won't have to set the IBV_QP_CUR_STATE
mask in order to execute modify QP in order to recover from this state.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mthca: Update QP state if query QP succeeds
Dotan Barak [Thu, 17 Apr 2008 04:09:34 +0000 (21:09 -0700)]
IB/mthca: Update QP state if query QP succeeds

If the QP was moved to another state (such as SQE) by the hardware,
then after this change the user won't have to set the IBV_QP_CUR_STATE
mask in order to execute modify QP in order to recover from this state.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/amso1100: Add check for NULL reply_msg in c2_intr()
Tom Tucker [Thu, 17 Apr 2008 04:09:34 +0000 (21:09 -0700)]
RDMA/amso1100: Add check for NULL reply_msg in c2_intr()

Fix a place where we might dereference a NULL pointer; this fixes
Coverity CID 1392.  On inspection I also found a place where we could
attempt to kmem_cache_free() a NULL pointer, so fix this too.

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Add support for resizing CQs
Vladimir Sokolovsky [Thu, 17 Apr 2008 04:09:33 +0000 (21:09 -0700)]
IB/mlx4: Add support for resizing CQs

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Add support for modifying CQ moderation parameters
Eli Cohen [Thu, 17 Apr 2008 04:09:33 +0000 (21:09 -0700)]
IB/mlx4: Add support for modifying CQ moderation parameters

Signed-off-by: Eli Cohen <eli@mellnaox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB: Support modifying IPoIB CQ event moderation
Eli Cohen [Thu, 17 Apr 2008 04:09:33 +0000 (21:09 -0700)]
IPoIB: Support modifying IPoIB CQ event moderation

This can be used to tune at run time the parameters controlling the
event (interrupt) generation rate and thus reduce the overhead
incurred by handling interrupts resulting in better throughput.  Since
IPoIB uses a single CQ for both RX and TX, RX is chosen to dictate
configuration for both RX and TX.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/core: Add support for modify CQ
Eli Cohen [Thu, 17 Apr 2008 04:09:33 +0000 (21:09 -0700)]
IB/core: Add support for modify CQ

Add support for modifying CQ parameters for controlling event
generation moderation.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB: Add basic ethtool support
Eli Cohen [Thu, 17 Apr 2008 04:09:32 +0000 (21:09 -0700)]
IPoIB: Add basic ethtool support

Just add the infrastructure so we can add functionality later.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agomlx4_core: Increase max number of QPs to 128K
Jack Morgenstein [Thu, 17 Apr 2008 04:09:32 +0000 (21:09 -0700)]
mlx4_core: Increase max number of QPs to 128K

With the advent large clusters which utilize multicore hosts, 64K QPs
is not enough.  We should increase the default maximum for QPs to 128K.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/amso1100: Add support for "send with invalidate" work requests
Roland Dreier [Thu, 17 Apr 2008 04:09:32 +0000 (21:09 -0700)]
RDMA/amso1100: Add support for "send with invalidate" work requests

Handle IB_WR_SEND_WITH_INV work requests.

This resurrects a patch sent long ago by Mikkel Hagen <mhagen@iol.unh.edu>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/core: Add support for "send with invalidate" work requests
Roland Dreier [Thu, 17 Apr 2008 04:09:32 +0000 (21:09 -0700)]
IB/core: Add support for "send with invalidate" work requests

Add a new IB_WR_SEND_WITH_INV send opcode that can be used to mark a
"send with invalidate" work request as defined in the iWARP verbs and
the InfiniBand base memory management extensions.  Also put "imm_data"
and a new "invalidate_rkey" member in a new "ex" union in struct
ib_send_wr. The invalidate_rkey member can be used to pass in an
R_Key/STag to be invalidated.  Add this new union to struct
ib_uverbs_send_wr.  Add code to copy the invalidate_rkey field in
ib_uverbs_post_send().

Fix up low-level drivers to deal with the change to struct ib_send_wr,
and just remove the imm_data initialization from net/sunrpc/xprtrdma/,
since that code never does any send with immediate operations.

Also, move the existing IB_DEVICE_SEND_W_INV flag to a new bit, since
the iWARP drivers currently in the tree set the bit.  The amso1100
driver at least will silently fail to honor the IB_SEND_INVALIDATE bit
if passed in as part of userspace send requests (since it does not
implement kernel bypass work request queueing).  Remove the flag from
all existing drivers that set it until we know which ones are OK.

The values chosen for the new flag is not consecutive to avoid clashing
with flags defined in the XRC patches, which are not merged yet but
which are already in use and are likely to be merged soon.

This resurrects a patch sent long ago by Mikkel Hagen <mhagen@iol.unh.edu>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Update copyright dates for files changed in 2008
Ralph Campbell [Thu, 17 Apr 2008 04:09:32 +0000 (21:09 -0700)]
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>
16 years agoIB/ipath: add calls to new 7220 code and enable in build
Dave Olson [Thu, 17 Apr 2008 04:09:32 +0000 (21:09 -0700)]
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>
16 years agoIB/ipath: Misc changes to prepare for IB7220 introduction
Arthur Jones [Thu, 17 Apr 2008 04:09:31 +0000 (21:09 -0700)]
IB/ipath: Misc changes to prepare for IB7220 introduction

The patch adds a number of minor changes to support newer HCAs:
 - New send buffer control bits
 - New error condition bits
 - Locking and initialization changes
 - More send buffers

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: User mode send DMA
Arthur Jones [Thu, 17 Apr 2008 04:09:31 +0000 (21:09 -0700)]
IB/ipath: User mode send DMA

A new file which allows the IBA7220 send DMA engine to be used from
userland.  The routines here are not linked in yet, that will happen in
a follow-on patch...

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: User mode send DMA header file
Arthur Jones [Thu, 17 Apr 2008 04:09:31 +0000 (21:09 -0700)]
IB/ipath: User mode send DMA header file

A new header file which allows the IBA7220 send DMA engine to be used
from userland.  The definitions here are not used yet, that will happen
in a follow-on patch...

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Add code for IBA7220 send DMA
John Gregor [Thu, 17 Apr 2008 04:09:31 +0000 (21:09 -0700)]
IB/ipath: Add code for IBA7220 send DMA

The IBA7220 HCA has a new feature to DMA data to the on chip send
buffers instead of or in addition to the host CPU doing the data
transfer.  This patch adds code to support the send DMA queue.

Signed-off-by: John Gregor <john.gregor@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Add IBA7220-specific SERDES initialization data
Ralph Campbell [Thu, 17 Apr 2008 04:09:31 +0000 (21:09 -0700)]
IB/ipath: Add IBA7220-specific SERDES initialization data

This patch adds binary data to initialize the IB SERDES.

Signed-off-by: Michael Albaugh <Michael.Albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Support for SerDes portion of IBA7220
Michael Albaugh [Thu, 17 Apr 2008 04:09:31 +0000 (21:09 -0700)]
IB/ipath: Support for SerDes portion of IBA7220

The control and initialization of the SerDes blocks of the IBA7220 is
sufficiently complex to merit a separate file.

Signed-off-by: Michael Albaugh <Michael.Albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: HCA-specific code to support IBA7220
Ralph Campbell [Thu, 17 Apr 2008 04:09:30 +0000 (21:09 -0700)]
IB/ipath: HCA-specific code to support IBA7220

This patch adds the HCA-specific code for the IBA7220 HCA.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Isolate 7220-specific content
Michael Albaugh [Thu, 17 Apr 2008 04:09:30 +0000 (21:09 -0700)]
IB/ipath: Isolate 7220-specific content

This patch adds a new ASIC-specific header file for the HCAs using the IBA7220.

Signed-off-by: Michael Albaugh <Michael.Albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Header file changes to support IBA7220
Ralph Campbell [Thu, 17 Apr 2008 04:09:30 +0000 (21:09 -0700)]
IB/ipath: Header file changes to support IBA7220

This is part of a patch series to add support for a new HCA.  This patch
adds new fields to the header files.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix up error handling
Ralph Campbell [Thu, 17 Apr 2008 04:09:30 +0000 (21:09 -0700)]
IB/ipath: Fix up error handling

This patch makes chip reset more robust and reduces lock contention
between user and kernel TID register updates.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix check for no interrupts to reliably fallback to INTx
Dave Olson [Thu, 17 Apr 2008 04:09:30 +0000 (21:09 -0700)]
IB/ipath: Fix check for no interrupts to reliably fallback to INTx

Newer HCAs support MSI interrupts and also INTx interrupts.  Fix the
code so that INTx can be reliably enabled if MSI interrupts are not
working.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Enable reduced PIO update for HCAs that support it.
Dave Olson [Thu, 17 Apr 2008 04:09:30 +0000 (21:09 -0700)]
IB/ipath: Enable reduced PIO update for HCAs that support it.

Newer HCAs have a threshold counter to reduce the number of DMAs the
chip makes to update the PIO buffer availability status bits.  This
patch enables the feature.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Set LID filtering for HCAs that support it.
Dave Olson [Thu, 17 Apr 2008 04:09:29 +0000 (21:09 -0700)]
IB/ipath: Set LID filtering for HCAs that support it.

Whenever the LID is set, notify the HCA specific code so that the
appropriate HW registers can be updated. Also log the info on the
console at low priority.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Add support for IBTA 1.2 Heartbeat
Dave Olson [Thu, 17 Apr 2008 04:09:29 +0000 (21:09 -0700)]
IB/ipath: Add support for IBTA 1.2 Heartbeat

This patch adds code to enable/disable the IBTA 1.2 heartbeat for testing
if the HCA supports it.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Make link state transition code ignore (transient) link recovery
Dave Olson [Thu, 17 Apr 2008 04:09:29 +0000 (21:09 -0700)]
IB/ipath: Make link state transition code ignore (transient) link recovery

The hardware-based recovery doesn't need any intervention, and in a few
cases we can get a bit confused about state and skip steps such as
turning off the link state LED when we consider recovery to be "down".
So ignore this transition, and either we recover in hardware, or we
transition to down, and will handle it then.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Add support for 7220 receive queue changes
Ralph Campbell [Thu, 17 Apr 2008 04:09:29 +0000 (21:09 -0700)]
IB/ipath: Add support for 7220 receive queue changes

Newer HCAs have a HW option to write a sequence number to each receive
queue entry and avoid a separate DMA of the tail register to memory.
This patch adds support for these changes.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix some white space and code style issues
Ralph Campbell [Thu, 17 Apr 2008 04:09:29 +0000 (21:09 -0700)]
IB/ipath: Fix some white space and code style issues

This patch makes some white space changes and minor non-functional
changes to more closely match the code in OFED-1.3.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Allow old and new diagnostic packet formats
Michael Albaugh [Thu, 17 Apr 2008 04:09:28 +0000 (21:09 -0700)]
IB/ipath: Allow old and new diagnostic packet formats

This patch checks for old and new format writes to send a packet via the
diagnostic interface.

Signed-off-by: Michael Albaugh <Michael.Albaugh@Qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/core: Check optional verbs before using them
Dotan Barak [Thu, 17 Apr 2008 04:09:28 +0000 (21:09 -0700)]
IB/core: Check optional verbs before using them

Make sure that a device implements the modify_srq and reg_phys_mr
optional methods before calling them.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix time comparison to use time_after_eq()
Robert P. J. Day [Thu, 17 Apr 2008 04:09:28 +0000 (21:09 -0700)]
IB/ipath: Fix time comparison to use time_after_eq()

Raw comparison against jiffies will fail if jiffies wraps, although
since ipath currently only supports 64-bit architectures, this is rather
far-fetched.  Still, it's better to use time_after_eq().

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Micro-optimize mlx4_ib_post_send()
Roland Dreier [Thu, 17 Apr 2008 04:09:28 +0000 (21:09 -0700)]
IB/mlx4: Micro-optimize mlx4_ib_post_send()

Rather than have build_mlx_header() return a negative value on failure
and the length of the segments it builds on success, add a pointer
parameter to return the length and return 0 on success.  This matches
the calling convention used for build_lso_seg() and generates slightly
smaller code -- eg, on 64-bit x86:

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-22 (-22)
function                                     old     new   delta
mlx4_ib_post_send                           2023    2001     -22

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Add IPoIB LSO support
Eli Cohen [Thu, 17 Apr 2008 04:09:27 +0000 (21:09 -0700)]
IB/mlx4: Add IPoIB LSO support

Add TSO support to the mlx4_ib driver.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB: Add LSO support
Eli Cohen [Thu, 17 Apr 2008 04:09:27 +0000 (21:09 -0700)]
IPoIB: Add LSO support

For HCAs that support TCP segmentation offload (IB_DEVICE_UD_TSO), set
NETIF_F_TSO and use HW LSO to offload TCP segmentation.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/core: Add IPoIB UD LSO support
Eli Cohen [Thu, 17 Apr 2008 04:09:27 +0000 (21:09 -0700)]
IB/core: Add IPoIB UD LSO support

LSO (large send offload) allows the networking stack to pass SKBs with
data size larger than the MTU to the IPoIB driver and have the HCA HW
fragment the data to multiple MSS-sized packets.  Add a device
capability flag IB_DEVICE_UD_TSO for devices that can perform TCP
segmentation offload, a new send work request opcode IB_WR_LSO,
header, hlen and mss fields for the work request structure, and a new
IB_WC_LSO completion type.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/core: Add creation flags to struct ib_qp_init_attr
Eli Cohen [Thu, 17 Apr 2008 04:09:27 +0000 (21:09 -0700)]
IB/core: Add creation flags to struct ib_qp_init_attr

Add a create_flags member to struct ib_qp_init_attr that will allow a
kernel verbs consumer to create a pass special flags when creating a QP.
Add a flag value for telling low-level drivers that a QP will be used
for IPoIB UD LSO.  The create_flags member will also be useful for XRC
and ehca low-latency QP support.

Since no create_flags handling is implemented yet, add code to all
low-level drivers to return -EINVAL if create_flags is non-zero.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: EEPROM support for 7220 devices, robustness improvements, cleanup
Michael Albaugh [Thu, 17 Apr 2008 04:09:27 +0000 (21:09 -0700)]
IB/ipath: EEPROM support for 7220 devices, robustness improvements, cleanup

Add support for reading newer card's EEPROMs while continuing to support
older EEPROMs.

Also, add support for the temperature sensor if present.

Signed-off-by: Michael Albaugh <Michael.Albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Use PIO buffer for RC ACKs
Ralph Campbell [Thu, 17 Apr 2008 04:09:27 +0000 (21:09 -0700)]
IB/ipath: Use PIO buffer for RC ACKs

This reduces the latency for RC ACKs when a PIO buffer is available.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Make send buffers available for kernel if not allocated to user
Ralph Campbell [Thu, 17 Apr 2008 04:09:26 +0000 (21:09 -0700)]
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>
16 years agoIB/ipath: Prevent link-recovery code from negating admin disable
Michael Albaugh [Thu, 17 Apr 2008 04:09:26 +0000 (21:09 -0700)]
IB/ipath: Prevent link-recovery code from negating admin disable

The link can be put in LINKDOWN_DISABLE state either locally or via a
MAD.  However, the link-recovery code will take it out of that state as
a side-effect of attempts to clear SerDes/XGXS issues.

We add a flag to indicate "link is down on purpose, leave it alone."

Signed-off-by: Michael Albaugh <michael.albaugh@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Remove some useless (void) casts
Ralph Campbell [Thu, 17 Apr 2008 04:09:26 +0000 (21:09 -0700)]
IB/ipath: Remove some useless (void) casts

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Change the module author
Ralph Campbell [Thu, 17 Apr 2008 04:09:26 +0000 (21:09 -0700)]
IB/ipath: Change the module author

Update the module author to the current email address.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Use more concise list_for_each_entry()
Robert P. J. Day [Thu, 17 Apr 2008 04:09:26 +0000 (21:09 -0700)]
RDMA/nes: Use more concise list_for_each_entry()

In list iteration code, you normally wouldn't be calling
"container_of()" directly anyway, you'd be invoking "list_entry()".
But you don't even need that here, "list_for_each_entry()" is fine.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Acked-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB: Use shorter list_splice_init() for brevity
Robert P. J. Day [Thu, 17 Apr 2008 04:09:26 +0000 (21:09 -0700)]
IB: Use shorter list_splice_init() for brevity

Convert list_splice() + INIT_LIST_HEAD() to the equivalent list_splice_init()

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/iwcm: Test rdma_create_id() for IS_ERR rather than 0
Julia Lawall [Thu, 17 Apr 2008 04:09:25 +0000 (21:09 -0700)]
RDMA/iwcm: Test rdma_create_id() for IS_ERR rather than 0

The function rdma_create_id() always returns either a valid pointer or
a value made with ERR_PTR, so its result should be tested with IS_ERR,
not with a test for 0.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

//<smpl>
@a@
expression E, E1;
statement S,S1;
position p;
@@

E = rdma_create_id(...)
... when != E = E1
if@p (E) S else S1

@n@
position a.p;
expression E,E1;
statement S,S1;
@@

E = NULL
... when != E = E1
if@p (E) S else S1

@depends on !n@
expression E;
statement S,S1;
position a.p;
@@

* if@p (E)
  S else S1
//</smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Remove session_id from nes_cm stuff
Roland Dreier [Thu, 17 Apr 2008 04:09:25 +0000 (21:09 -0700)]
RDMA/nes: Remove session_id from nes_cm stuff

The session_id members of struct nes_cm_listener and struct
nes_cm_node are write-only, so remove them.  This allows the
session_id member of struct nes_cm_core to be removed as well, since
it is only used to write those other session_id values.

This removes the use of current->tgid (which will be deprecated)
pointed out by Pavel Emelyanov <xemul@openvz.org>.

Acked-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix PCI config write size used to clear linkctrl error bits
Roland Dreier [Thu, 17 Apr 2008 04:09:25 +0000 (21:09 -0700)]
IB/ipath: Fix PCI config write size used to clear linkctrl error bits

In slave_or_pri_blk(), pci_write_config_byte() is used to write a
16-bit quantity to clear linkctrl CRC error bits.  This is clearly a
bug and also causes the warning

    drivers/infiniband/hw/ipath/ipath_iba6110.c: In function 'slave_or_pri_blk':
    drivers/infiniband/hw/ipath/ipath_iba6110.c:849: warning: overflow in implicit constant conversion

Fix this by using pci_write_config_word() instead.

Acked-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix sanity checks on QP number of WRs and SGEs
Ralph Campbell [Thu, 17 Apr 2008 04:09:25 +0000 (21:09 -0700)]
IB/ipath: Fix sanity checks on QP number of WRs and SGEs

The receive queue number of WRs and SGEs shouldn't be checked if a
SRQ is specified.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Remove useless comments
Ralph Campbell [Thu, 17 Apr 2008 04:09:25 +0000 (21:09 -0700)]
IB/ipath: Remove useless comments

Remove useless comment about list removal since locks are held and
the code checks that the QP is on the list before removing it.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: HW workaround for case where chip can send but not receive
Dave Olson [Thu, 17 Apr 2008 04:09:25 +0000 (21:09 -0700)]
IB/ipath: HW workaround for case where chip can send but not receive

Workaround a QLE7140 problem that in rare cases causes flow control
problems after link recovery by forcing a link retrain after recovery.
A module parameter is provided to control the behavior in case it causes
problems.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Add code to support multiple link speeds and widths
Ralph Campbell [Thu, 17 Apr 2008 04:09:24 +0000 (21:09 -0700)]
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>
16 years agoIB/ipath: Head of Line blocking vs forward progress of user apps
John Gregor [Thu, 17 Apr 2008 04:09:24 +0000 (21:09 -0700)]
IB/ipath: Head of Line blocking vs forward progress of user apps

There's a conflict between our need to quiesce PSM-based applications
to avoid HoL blocking when the IB link goes down and the apps' desire
to remain running so that their quiescence timout mechanism can keep
running.

The compromise is to STOP the processes for a fixed period of time and
then alternate between CONT and STOP until the link is again active.

If there are poor interactions with subnet manager configuration at a
given site, the interval can be adjusted via a module paramter.

Signed-off-by: John Gregor <john.gregor@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Make debug error message match the constraint that is checked for
Ralph Campbell [Thu, 17 Apr 2008 04:09:24 +0000 (21:09 -0700)]
IB/ipath: Make debug error message match the constraint that is checked for

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Don't try to handle freeze mode HW errors if diagnostic mode
Ralph Campbell [Thu, 17 Apr 2008 04:01:14 +0000 (21:01 -0700)]
IB/ipath: Don't try to handle freeze mode HW errors if diagnostic mode

Don't try to handle freeze mode HW errors if the driver is in diagnostic
mode since some tests can cause errors that shouldn't be processed.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix link up LED display
Arthur Jones [Thu, 17 Apr 2008 04:01:13 +0000 (21:01 -0700)]
IB/ipath: Fix link up LED display

The check for link up was incorrect, thus setting the LED display
inconsistently with the link state.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix error recovery for send buffer status after chip freeze mode
Ralph Campbell [Thu, 17 Apr 2008 04:01:13 +0000 (21:01 -0700)]
IB/ipath: Fix error recovery for send buffer status after chip freeze mode

The error recovery code for updating the driver's cached status information
for which send buffers are busy or free wasn't updated for IBA7220.
It should be similar to the initialization code in enable_chip().

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix byte order of pioavail in handle_errors()
Ralph Campbell [Thu, 17 Apr 2008 04:01:13 +0000 (21:01 -0700)]
IB/ipath: Fix byte order of pioavail in handle_errors()

Fix byte order of value assigned to pioavailshadow.  This bug was
detected by sparse endianness warnings.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mthca: Avoid integer overflow when allocating huge ICM table
Roland Dreier [Thu, 17 Apr 2008 04:01:13 +0000 (21:01 -0700)]
IB/mthca: Avoid integer overflow when allocating huge ICM table

In mthca_alloc_icm_table(), the number of entries to allocate for the
table->icm array is computed by calculating obj_size * nobj and then
dividing by MTHCA_TABLE_CHUNK_SIZE.  If nobj is really large, then
obj_size * nobj may overflow and the division may get the wrong value
(even a negative value).  Fix this by calculating the number of
objects per chunk and then dividing nobj by this value instead.

This patch allows crazy configurations such as loading ib_mthca with
the module parameter num_mtt=33554432 to work properly.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mthca: Avoid integer overflow when dealing with profile size
Roland Dreier [Thu, 17 Apr 2008 04:01:13 +0000 (21:01 -0700)]
IB/mthca: Avoid integer overflow when dealing with profile size

mthca_make_profile() returns the size in bytes of the HCA context
layout it creates, or a negative value if an error occurs.  However,
the return value is declared as u64 and the memfree initialization
path casts this value to int to test if it is negative.  This makes it
think incorrectly than an error has occurred if the context size
happens to be bigger than 2GB, since this turns into a negative int.

Fix this by having mthca_make_profile() return an s64 and testing
for an error by checking whether this 64-bit value itself is negative.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ehca: Remove tgid checking
Hoang-Nam Nguyen [Thu, 17 Apr 2008 04:01:13 +0000 (21:01 -0700)]
IB/ehca: Remove tgid checking

Pavel Emelyanov <xemul@openvz.org> mentioned in <http://lkml.org/lkml/2008/3/17/131>
that the task_struct->tgid field is about to become deprecated, so the
uses in the ehca driver need to be fixed up.

However, all the uses in ehca are for some object ownership checking
that is not really needed, and anyway is implementing a policy that
should be in common code rather than a low-level driver.  So just
remove all the checks.

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/srp: Enforce protocol limit on srp_sg_tablesize
David Dillow [Thu, 17 Apr 2008 04:01:12 +0000 (21:01 -0700)]
IB/srp: Enforce protocol limit on srp_sg_tablesize

The current SRP initiator will allow unlimited s/g entries in the
indirect descriptors lists, but the entry count field in the SRP_CMD
request is 8 bits, so setting srp_sg_tablesize too large will open the
possibility of wrapping the count and generating invalid requests.

Clamp srp_sg_tablesize to the protocol limits to prevent surprises.

Reported by Martin W. Schlining III <mschlining@datadirectnet.com>.

Signed-off-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Enable 4KB MTU
Dave Olson [Thu, 17 Apr 2008 04:01:12 +0000 (21:01 -0700)]
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>
16 years agoIB/ipath: Shared context code needs to be sure device is usable
Dave Olson [Thu, 17 Apr 2008 04:01:12 +0000 (21:01 -0700)]
IB/ipath: Shared context code needs to be sure device is usable

The code was checking if units are present, but not that present units
were usable (link up, etc.)

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Provide I/O bus speeds for diagnostic purposes
Arthur Jones [Thu, 17 Apr 2008 04:01:12 +0000 (21:01 -0700)]
IB/ipath: Provide I/O bus speeds for diagnostic purposes

Modern I/O buses like PCIe and HT can be configured for multiple speeds
and widths.  When an ipath HCA seems to have lower than expected
performance, it is very useful to be able to display what the driver
thinks the bus speed is.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Make some constants chip-specific, related cleanup
Dave Olson [Thu, 17 Apr 2008 04:01:12 +0000 (21:01 -0700)]
IB/ipath: Make some constants chip-specific, related cleanup

This patch makes some constants chip-specific, and makes some related
changes to prepare for supporting another HCA.

Signed-off-by: Dave Olson <dave.olson@qlogic.com
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Misc sparse warning cleanup
Arthur Jones [Thu, 17 Apr 2008 04:01:11 +0000 (21:01 -0700)]
IB/ipath: Misc sparse warning cleanup

Recent sparse versions and kernel cleanups knock down the false positive
rate of the ipath driver code to a point where having it be sparse clean
is worthwhile. Here we fixup the sparse warnings.  Some of these warnings
(and the impetus to run sparse again) are due to work by Roland Dreier.

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mthca: Add IPoIB checksum offload support
Eli Cohen [Thu, 17 Apr 2008 04:01:11 +0000 (21:01 -0700)]
IB/mthca: Add IPoIB checksum offload support

Arbel and Sinai devices support checksum generation and verification
of TCP and UDP packets for UD IPoIB messages.  This patch checks if
the HCA supports this and sets the IB_DEVICE_UD_IP_CSUM capability
flag if it does.  It implements support for handling the IB_SEND_IP_CSUM
send flag and setting the csum_ok field in receive work completions.

Signed-off-by: Eli Cohen <eli@mellnaox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Add IPoIB checksum offload support
Eli Cohen [Thu, 17 Apr 2008 04:01:10 +0000 (21:01 -0700)]
IB/mlx4: Add IPoIB checksum offload support

ConnectX devices support checksum generation and verification of TCP
and UDP packets for UD IPoIB messages.  This patch checks if the HCA
supports this and sets the IB_DEVICE_UD_IP_CSUM capability flag if it
does.  It implements support for handling the IB_SEND_IP_CSUM send
flag and setting the csum_ok field in receive work completions.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Ali Ayub <ali@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIPoIB: Use checksum offload support if available
Eli Cohen [Thu, 17 Apr 2008 04:01:10 +0000 (21:01 -0700)]
IPoIB: Use checksum offload support if available

For HCAs that support checksum offload (ie that set IB_DEVICE_UD_IP_CSUM
in the device capabilities flags), have IPoIB set NETIF_F_IP_CSUM and
use the HCA to generate and verify IP checksums.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB: Replace remaining __FUNCTION__ occurrences with __func__
Harvey Harrison [Thu, 17 Apr 2008 04:01:10 +0000 (21:01 -0700)]
IB: Replace remaining __FUNCTION__ occurrences with __func__

__FUNCTION__ is gcc-specific, use __func__ instead.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ehca: Make symbols used only in a single source file static
Roland Dreier [Thu, 17 Apr 2008 04:01:10 +0000 (21:01 -0700)]
IB/ehca: Make symbols used only in a single source file static

Allow the compiler to optimize better and generate smaller code:

add/remove: 0/6 grow/shrink: 2/0 up/down: 1528/-1864 (-336)
function                                     old     new   delta
.ehca_set_pagebuf                           1344    2172    +828
.ehca_probe                                 2312    3012    +700
ehca_set_pagebuf_phys                         24       -     -24
ehca_set_pagebuf_fmr                          24       -     -24
ehca_init_device                              24       -     -24
.ehca_set_pagebuf_fmr                        480       -    -480
.ehca_set_pagebuf_phys                       512       -    -512
.ehca_init_device                            800       -    -800

Also this fixes warnings like:

    drivers/infiniband/hw/ehca/ehca_mrmw.c:2015:5: warning: symbol 'ehca_set_pagebuf_fmr' was not declared. Should it be static?

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Make symbols used only in a single source file static
Roland Dreier [Thu, 17 Apr 2008 04:01:09 +0000 (21:01 -0700)]
RDMA/nes: Make symbols used only in a single source file static

Avoid namespace pollution and allow the compiler to optimize better.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Use proper format and cast to print dma_addr_t
Roland Dreier [Thu, 17 Apr 2008 04:01:09 +0000 (21:01 -0700)]
RDMA/nes: Use proper format and cast to print dma_addr_t

On some platforms, eg sparc64, dma_addr_t is not the same size as a
pointer, so printing dma_addr_t values by casting to void * and using
a %p format generates warnings.  Fix this by casting to unsigned long
and using %lx instead.  This fixes the warnings:

    drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_setup_virt_qp':
    drivers/infiniband/hw/nes/nes_verbs.c:1047: warning: cast to pointer from integer of different size
    drivers/infiniband/hw/nes/nes_verbs.c:1078: warning: cast to pointer from integer of different size
    drivers/infiniband/hw/nes/nes_verbs.c:1078: warning: cast to pointer from integer of different size
    drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_reg_user_mr':
    drivers/infiniband/hw/nes/nes_verbs.c:2657: warning: cast to pointer from integer of different size

Reported by Andrew Morton <akpm@linux-foundation.org>.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Remove unused nes_netdev_exit() function
Roland Dreier [Thu, 17 Apr 2008 04:01:09 +0000 (21:01 -0700)]
RDMA/nes: Remove unused nes_netdev_exit() function

nes_netdev_exit() has no callers, so delete it.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Remove redundant NULL check in nes_unregister_ofa_device()
Roland Dreier [Thu, 17 Apr 2008 04:01:09 +0000 (21:01 -0700)]
RDMA/nes: Remove redundant NULL check in nes_unregister_ofa_device()

nes_unregister_ofa_device() dereferences the nesibdev pointer before
testing if it's NULL.  Also, the test is doubly redundant because the
only caller of nes_unregister_ofa_device() is nes_destroy_ofa_device(),
which already tests if nesibdev is NULL.  Remove the unnecessary test.

This was spotted by the Coverity checker (CID 2190).

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/uverbs: Use alloc_file() instead of get_empty_filp()
Roland Dreier [Thu, 17 Apr 2008 04:01:08 +0000 (21:01 -0700)]
IB/uverbs: Use alloc_file() instead of get_empty_filp()

Christoph Hellwig wants to unexport get_empty_filp(), which is an ugly
internal interface.  Change the modular user in ib_uverbs_alloc_event_file()
to use the better alloc_file() interface; this makes the code cleaner too.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/uverbs: Don't store struct file * for event files
Roland Dreier [Thu, 17 Apr 2008 04:01:08 +0000 (21:01 -0700)]
IB/uverbs: Don't store struct file * for event files

The file member of struct ib_uverbs_event_file was only used to keep
track of whether the file had been closed or not.  The only thing we
ever did with the value was check if it was NULL or not.  Simplify the
code and get rid of the need to keep track of the struct file * we
allocate by replacing the file member with an is_closed member.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agomlx4_core: Fix confusion between mlx4_event and mlx4_dev_event enums
Roland Dreier [Thu, 17 Apr 2008 04:01:08 +0000 (21:01 -0700)]
mlx4_core: Fix confusion between mlx4_event and mlx4_dev_event enums

The struct mlx4_interface.event() method was supposed to get an enum
mlx4_dev_event, but the driver code was actually passing in the
hardware enum mlx4_event values.  Fix up the callers of
mlx4_dispatch_event() so that they pass in the right type of value,
and fix up the event method in mlx4_ib so that it can handle the enum
mlx4_dev_event values.

This eliminates the need for the subtype parameter to the event
method, so remove it.

This also fixes the sparse warning

    drivers/net/mlx4/intf.c:127:48: warning: mixing different enum types
    drivers/net/mlx4/intf.c:127:48:     int enum mlx4_event  versus
    drivers/net/mlx4/intf.c:127:48:     int enum mlx4_dev_event

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/amso1100: Endian annotate mqsq allocator
Roland Dreier [Thu, 17 Apr 2008 04:01:08 +0000 (21:01 -0700)]
RDMA/amso1100: Endian annotate mqsq allocator

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/amso1100: Start of endianness annotation
Roland Dreier [Thu, 17 Apr 2008 04:01:08 +0000 (21:01 -0700)]
RDMA/amso1100: Start of endianness annotation

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
16 years agoRDMA/nes: Delete unused variables
Roland Dreier [Thu, 17 Apr 2008 04:01:08 +0000 (21:01 -0700)]
RDMA/nes: Delete unused variables

None of the cqp_reqs_XXX counters were ever used anywhere, and neither
was the nics_per_function variable.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/nes: Trivial endianness annotations
Roland Dreier [Thu, 17 Apr 2008 04:01:07 +0000 (21:01 -0700)]
RDMA/nes: Trivial endianness annotations

Fix a couple of htonl() that should really be ntohl().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/ucma: Endian annotation
Roland Dreier [Thu, 17 Apr 2008 04:01:07 +0000 (21:01 -0700)]
RDMA/ucma: Endian annotation

Add __force cast of node_guid to __u64, since we are sticking it into a
structure whose definition is shared with userspace.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/cm: Endianness annotations
Roland Dreier [Thu, 17 Apr 2008 04:01:07 +0000 (21:01 -0700)]
IB/cm: Endianness annotations

Mostly update the RB tree comparisons to force __be types to normal
integers, but the change to cm_format_sidr_req() is a real fix:
param->path->pkey is already __be16.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Sean Hefty <sean.hefty@intel.com>
16 years agoIB/mlx4: Endianness annotations
Roland Dreier [Thu, 17 Apr 2008 04:01:07 +0000 (21:01 -0700)]
IB/mlx4: Endianness annotations

Trivial fixes to stamp_send_wqe().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix sparse warning about shadowed symbol
Roland Dreier [Thu, 17 Apr 2008 04:01:07 +0000 (21:01 -0700)]
IB/ipath: Fix sparse warning about shadowed symbol

Fix

    drivers/infiniband/hw/ipath/ipath_init_chip.c:526:10: warning: symbol 'val' shadows an earlier one
    drivers/infiniband/hw/ipath/ipath_init_chip.c:473:6: originally declared here

by giving the second val a different name.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Arthur Jones <arthur.jones@qlogic.com>
16 years agoIB/ipath: Fix sparse warning about pointer signedness
Arthur Jones [Thu, 17 Apr 2008 04:01:06 +0000 (21:01 -0700)]
IB/ipath: Fix sparse warning about pointer signedness

There's no reason for the third parameter of ipath_count_units() to be
a u32 *, so change it to be an int * instead.  This fixes the sparse
warning:

    drivers/infiniband/hw/ipath/ipath_file_ops.c:1654:47: warning: incorrect type in argument 3 (different signedness)
    drivers/infiniband/hw/ipath/ipath_file_ops.c:1654:47:    expected unsigned int [usertype] *maxportsp
    drivers/infiniband/hw/ipath/ipath_file_ops.c:1654:47:    got int *<noident>

Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB: Make struct ib_uobject.id a signed int
Roland Dreier [Thu, 17 Apr 2008 04:01:06 +0000 (21:01 -0700)]
IB: Make struct ib_uobject.id a signed int

IDR IDs are signed, so struct ib_uobject.id should be signed.  This
avoids some sparse pointer signedness warnings.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoRDMA/cxgb3: IDR IDs are signed
Roland Dreier [Thu, 17 Apr 2008 04:01:06 +0000 (21:01 -0700)]
RDMA/cxgb3: IDR IDs are signed

Fix sparse warnings about pointer signedness by using a signed int when
calling idr_get_new_above().

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
16 years agoRDMA/amso1100: Don't use 0UL as a NULL pointer
Roland Dreier [Thu, 17 Apr 2008 04:01:06 +0000 (21:01 -0700)]
RDMA/amso1100: Don't use 0UL as a NULL pointer

Write tests for NULL pointers as

if (!ptr)

instead of

if (ptr == 0UL)

to fix sparse warnings.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>