summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* IB/core: Add creation flags to struct ib_qp_init_attrEli Cohen2008-04-167-0/+21
| | | | | | | | | | | | | | 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>
* IB/ipath: EEPROM support for 7220 devices, robustness improvements, cleanupMichael Albaugh2008-04-163-67/+439
| | | | | | | | | | 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>
* IB/ipath: Use PIO buffer for RC ACKsRalph Campbell2008-04-161-18/+39
| | | | | | | 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>
* IB/ipath: Make send buffers available for kernel if not allocated to userRalph Campbell2008-04-168-145/+225
| | | | | | | | | | | | 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>
* IB/ipath: Prevent link-recovery code from negating admin disableMichael Albaugh2008-04-166-29/+55
| | | | | | | | | | | 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>
* IB/ipath: Remove some useless (void) castsRalph Campbell2008-04-162-9/+9
| | | | | Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IB/ipath: Change the module authorRalph Campbell2008-04-161-1/+1
| | | | | | | 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>
* RDMA/nes: Use more concise list_for_each_entry()Robert P. J. Day2008-04-161-6/+2
| | | | | | | | | | 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>
* IB: Use shorter list_splice_init() for brevityRobert P. J. Day2008-04-162-4/+2
| | | | | | | 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>
* RDMA/iwcm: Test rdma_create_id() for IS_ERR rather than 0Julia Lawall2008-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* RDMA/nes: Remove session_id from nes_cm stuffRoland Dreier2008-04-162-9/+0
| | | | | | | | | | | | | 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>
* IB/ipath: Fix PCI config write size used to clear linkctrl error bitsRoland Dreier2008-04-161-1/+1
| | | | | | | | | | | | | | 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>
* IB/ipath: Fix sanity checks on QP number of WRs and SGEsRalph Campbell2008-04-161-10/+16
| | | | | | | | 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>
* IB/ipath: Remove useless commentsRalph Campbell2008-04-161-2/+0
| | | | | | | | 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>
* IB/ipath: HW workaround for case where chip can send but not receiveDave Olson2008-04-163-0/+24
| | | | | | | | | | 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>
* IB/ipath: Add code to support multiple link speeds and widthsRalph Campbell2008-04-163-33/+69
| | | | | | | | 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>
* IB/ipath: Head of Line blocking vs forward progress of user appsJohn Gregor2008-04-167-182/+310
| | | | | | | | | | | | | | | | 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>
* IB/ipath: Make debug error message match the constraint that is checked forRalph Campbell2008-04-161-1/+1
| | | | | Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IB/ipath: Don't try to handle freeze mode HW errors if diagnostic modeRalph Campbell2008-04-161-1/+1
| | | | | | | | 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>
* IB/ipath: Fix link up LED displayArthur Jones2008-04-161-1/+1
| | | | | | | | 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>
* IB/ipath: Fix error recovery for send buffer status after chip freeze modeRalph Campbell2008-04-161-1/+2
| | | | | | | | | 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>
* IB/ipath: Fix byte order of pioavail in handle_errors()Ralph Campbell2008-04-161-3/+3
| | | | | | | | 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>
* IB/mthca: Avoid integer overflow when allocating huge ICM tableRoland Dreier2008-04-161-1/+3
| | | | | | | | | | | | | | 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>
* IB/mthca: Avoid integer overflow when dealing with profile sizeRoland Dreier2008-04-163-7/+10
| | | | | | | | | | | | | | 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>
* IB/ehca: Remove tgid checkingHoang-Nam Nguyen2008-04-167-162/+0
| | | | | | | | | | | | | | 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>
* IB/srp: Enforce protocol limit on srp_sg_tablesizeDavid Dillow2008-04-161-1/+6
| | | | | | | | | | | | | | 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>
* IB/ipath: Enable 4KB MTUDave Olson2008-04-168-65/+45
| | | | | | | | | | | 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>
* IB/ipath: Shared context code needs to be sure device is usableDave Olson2008-04-161-1/+1
| | | | | | | | 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>
* IB/ipath: Provide I/O bus speeds for diagnostic purposesArthur Jones2008-04-164-23/+85
| | | | | | | | | | 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>
* IB/ipath: Make some constants chip-specific, related cleanupDave Olson2008-04-163-30/+35
| | | | | | | | 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>
* IB/ipath: Misc sparse warning cleanupArthur Jones2008-04-162-4/+7
| | | | | | | | | | 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>
* IB/mthca: Add IPoIB checksum offload supportEli Cohen2008-04-166-13/+30
| | | | | | | | | | | 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>
* IB/mlx4: Add IPoIB checksum offload supportEli Cohen2008-04-164-0/+25
| | | | | | | | | | | | 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>
* IPoIB: Use checksum offload support if availableEli Cohen2008-04-164-1/+41
| | | | | | | | | 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>
* IB: Replace remaining __FUNCTION__ occurrences with __func__Harvey Harrison2008-04-1626-302/+302
| | | | | | | | __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>
* IB/ehca: Make symbols used only in a single source file staticRoland Dreier2008-04-163-16/+15
| | | | | | | | | | | | | | | | | | | | | 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>
* RDMA/nes: Make symbols used only in a single source file staticRoland Dreier2008-04-167-97/+88
| | | | | | Avoid namespace pollution and allow the compiler to optimize better. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* RDMA/nes: Use proper format and cast to print dma_addr_tRoland Dreier2008-04-161-8/+8
| | | | | | | | | | | | | | | | | | 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>
* RDMA/nes: Remove unused nes_netdev_exit() functionRoland Dreier2008-04-162-23/+0
| | | | | | nes_netdev_exit() has no callers, so delete it. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* RDMA/nes: Remove redundant NULL check in nes_unregister_ofa_device()Roland Dreier2008-04-161-3/+0
| | | | | | | | | | | 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>
* IB/uverbs: Use alloc_file() instead of get_empty_filp()Roland Dreier2008-04-161-12/+7
| | | | | | | | 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>
* IB/uverbs: Don't store struct file * for event filesRoland Dreier2008-04-162-7/+6
| | | | | | | | | | 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>
* mlx4_core: Fix confusion between mlx4_event and mlx4_dev_event enumsRoland Dreier2008-04-165-16/+17
| | | | | | | | | | | | | | | | | | | | 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>
* RDMA/amso1100: Endian annotate mqsq allocatorRoland Dreier2008-04-162-8/+8
| | | | Signed-off-by: Roland Dreier <rolandd@cisco.com>
* RDMA/amso1100: Start of endianness annotationRoland Dreier2008-04-168-160/+166
| | | | | Signed-off-by: Roland Dreier <rolandd@cisco.com> Acked-by: Steve Wise <swise@opengridcomputing.com>
* RDMA/nes: Delete unused variablesRoland Dreier2008-04-162-16/+0
| | | | | | | 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>
* RDMA/nes: Trivial endianness annotationsRoland Dreier2008-04-161-2/+2
| | | | | | Fix a couple of htonl() that should really be ntohl(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
* RDMA/ucma: Endian annotationRoland Dreier2008-04-161-1/+1
| | | | | | | 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>
* IB/cm: Endianness annotationsRoland Dreier2008-04-161-19/+44
| | | | | | | | | 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>
* IB/mlx4: Endianness annotationsRoland Dreier2008-04-161-2/+2
| | | | | | Trivial fixes to stamp_send_wqe(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
OpenPOWER on IntegriCloud