aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/nes/nes_cm.c
AgeCommit message (Collapse)Author
2009-03-12RDMA/nes: Don't allow userspace QPs to use STag zeroFaisal Latif
STag zero is a special STag that allows consumers to access any bus address without registering memory. The nes driver unfortunately allows STag zero to be used even with QPs created by unprivileged userspace consumers, which means that any process with direct verbs access to the nes device can read and write any memory accessible to the underlying PCI device (usually any memory in the system). Such access is usually given for cluster software such as MPI to use, so this is a local privilege escalation bug on most systems running this driver. The driver was using STag zero to receive the last streaming mode data; to allow STag zero to be disabled for unprivileged QPs, the driver now registers a special MR for this data. Cc: <stable@kernel.org> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-13Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/iser: Add dependency on INFINIBAND_ADDR_TRANS IPoIB: Do not join broadcast group if interface is brought down RDMA/nes: Fix for NIPQUAD removal IPoIB: Fix loss of connectivity after bonding failover on both sides IB/mlx4: Don't register IB device for adapters with no IB ports mlx4_core: Fix warning from min() IB/ehca: spin_lock_irqsave() takes an unsigned long
2009-01-10RDMA/nes: Fix for NIPQUAD removalHarvey Harrison
Commit 63779436 ("drivers: replace NIPQUAD()") accidentally replaced some HIPQUAD()s, causing IP addresses to be printed in reverse order. Add temporary local vars until the byteswapping can be pushed further up the stack. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-01-08fix similar typos to successfullColy Li
When I review ocfs2 code, find there are 2 typos to "successfull". After doing grep "successfull " in kernel tree, 22 typos found totally -- great minds always think alike :) This patch fixes all the similar typos. Thanks for Randy's ack and comments. Signed-off-by: Coly Li <coyli@suse.de> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Roland Dreier <rolandd@cisco.com> Cc: Jeremy Kerr <jk@ozlabs.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Vlad Yasevich <vladislav.yasevich@hp.com> Cc: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-28Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits) net: Allow dependancies of FDDI & Tokenring to be modular. igb: Fix build warning when DCA is disabled. net: Fix warning fallout from recent NAPI interface changes. gro: Fix potential use after free sfc: If AN is enabled, always read speed/duplex from the AN advertising bits sfc: When disabling the NIC, close the device rather than unregistering it sfc: SFT9001: Add cable diagnostics sfc: Add support for multiple PHY self-tests sfc: Merge top-level functions for self-tests sfc: Clean up PHY mode management in loopback self-test sfc: Fix unreliable link detection in some loopback modes sfc: Generate unique names for per-NIC workqueues 802.3ad: use standard ethhdr instead of ad_header 802.3ad: generalize out mac address initializer 802.3ad: initialize ports LACPDU from const initializer 802.3ad: remove typedef around ad_system 802.3ad: turn ports is_individual into a bool 802.3ad: turn ports is_enabled into a bool 802.3ad: make ntt bool ixgbe: Fix set_ringparam in ixgbe to use the same memory pools. ... Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due to the conversion to %pI (in this networking merge) and the addition of doing IPv6 addresses (from the earlier merge of CIFS).
2008-12-24RDMA/nes: Remove tx_free_listFaisal Latif
There is no lock protecting tx_free_list thus causing a system crash when skb_dequeue() is called and the list is empty. Since it did not give any performance boost under heavy load, remove it to simplify the code. Replace get_free_pkt() with dev_alloc_skb() to allocate MAX_CM_BUFFER skb for connection establishment/teardown as well as MPA request/response. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Cleanup warningsChien Tung
Wrap NES_DEBUG and assert macros with do while (0) to avoid ambiguous else. No one is using sk_buff * returned from form_cm_frame(), so drop the return. drop_packet() should not be incrementing reset counter on receiving a FIN. Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Add loopback check to make_cm_node()Chien Tung
Check for loopback connection in make_cm_node(). Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Fix TCP compliance test failuresFaisal Latif
ANVL testing showed we are not handling all cm_node states during connection establishment. Add missing state handlers and fix sequence number send reset in handle_tcp_options(). Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Forward packets for a new connection with stale APBVT entryFaisal Latif
Under heavy traffic, there is a small windows when an APBVT entry is not yet removed and a new connection is established. Packets for the new connection are dropped until APBVT entry is removed. This patch will forward the packets instead of dropping them. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Avoid race between MPA request and reset event to rdma_cmFaisal Latif
In passive open, after indicating MPA request to rdma_cm, an incoming RST would fire a reset event to rdma_cm causing it to crash, since the current state is not connected. The solution is to wait for nes_accept() or nes_reject() before firing the reset event. If nes_accept() or nes_reject() is already done, then the reset event will be fired when RST is processed. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Lock down connected_nodes list while processing itFaisal Latif
While processing connected_nodes list, we would release the lock when we need to send reset to remote partner. That created a window where the list can be modified. Change this into a two step process: place nodes that need processing on a local list then process the local list. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-12-05RDMA/nes: Cleanup cqp_request list usageFaisal Latif
Use nes_free_cqp_request() instead of open coding. Change some continue to break in nes_cm_timer_tick, because send_entry used to be a list processed in a loop (so continue went to the next item). Now it is a single item, so using break is correct. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-10-31drivers: replace NIPQUAD()Harvey Harrison
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-27net: convert print_mac to %pMJohannes Berg
This converts pretty much everything to print_mac. There were a few things that had conflicts which I have just dropped for now, no harm done. I've built an allyesconfig with this and looked at the files that weren't built very carefully, but it's a huge patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-09RDMA/nes: Fix slab corruptionChien Tung
Referencing cm_node after it is freed via rem_ref_cm_node() causes a slab corruption. There is no need to set cm_node->cm_id to NULL in mini_cm_close(). Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-10-03RDMA/nes: Fix routed RDMA connectionsBob Sharp
Fix routed RDMA connections to destinations where the next hop is not the final destination. Use neigh_*() to properly locate neighbor. Signed-off-by: Bob Sharp <bsharp@neteffect.com> Signed-off-by: Sweta Bhatt <sweta.bhatt@einfochips.com> Signed-off-by: Chien Tung <ctung@neteffect.com>
2008-09-30RDMA/nes: Make mini_cm_connect() staticFaisal Latif
Signed-off-by: Faisal Latif <flatif@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-09-16RDMA/nes: Fix client side QP destroyFaisal Latif
Fix QP not being destroyed properly on the client, which leads to userspace programs hanging on exit. This is a missing chunk from the connection management rewrite in commit 6492cdf3 ("RDMA/nes: CM connection setup/teardown rework"). Signed-off-by: Faisal Latif <flatif@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-07-24RDMA/nes: CM connection setup/teardown reworkFaisal Latif
Major rework of CM connection setup/teardown. We had a number of issues with MPI applications not starting/terminating properly over time. With these changes we were able to run longer on larger clusters. * Remove memory allocation from nes_connect() and nes_cm_connect(). * Fix mini_cm_dec_refcnt_listen() when destroying listener. * Remove unnecessary code from schedule_nes_timer() and nes_cm_timer_tick(). * Functionalize mini_cm_recv_pkt() and process_packet(). * Clean up cm_node->ref_count usage. * Reuse skbs if available. Signed-off-by: Faisal Latif <flatif@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-07-14RDMA/nes: Remove unnecessary memset()Christophe Jaillet
Remove an explicit memset(..., 0, ...) of a 'listener' structure allocated with kzalloc(). Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> Acked-by: Faisal Latif <faisal@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-29RDMA/nes: Formatting cleanupGlenn Streiff
Various cleanups: - Change // to /* .. */ - Place whitespace around binary operators. - Trim down a few long lines. - Some minor alignment formatting for better readability. - Remove some silly tabs. Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-23RDMA/nes: Fix adapter reset after PXE bootChien Tung
After PXE boot, the iw_nes driver does a full reset to ensure the card is in a clean state. However, it doesn't wait for firmware to complete its work before issuing a port reset to enable the ports, which leads to problems bringing up the ports. The solution is to wait for firmware to complete its work before proceeding with port reset. This bug was flagged by Roland Dreier <rolandd@cisco.com>. Cc: <stable@kernel.org> Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-23RDMA/nes: Print IPv4 addresses in a readable formatRoland Dreier
Use NIPQUAD_FMT instead of printing raw 32-bit hex quantities in debugging output. Acked-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-23RDMA/nes: Use print_mac() to format ethernet addresses for printingRoland Dreier
Removing open-coded MAC formats shrinks the source and the generated code too, eg on x86-64: add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-103 (-103) function old new delta make_cm_node 932 912 -20 nes_netdev_set_mac_address 427 406 -21 nes_netdev_set_multicast_list 1148 1124 -24 nes_probe 2349 2311 -38 Acked-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-16RDMA/nes: Use more concise list_for_each_entry()Robert P. J. Day
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>
2008-04-16RDMA/nes: Remove session_id from nes_cm stuffRoland Dreier
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>
2008-04-16IB: Replace remaining __FUNCTION__ occurrences with __func__Harvey Harrison
__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>
2008-04-16RDMA/nes: Make symbols used only in a single source file staticRoland Dreier
Avoid namespace pollution and allow the compiler to optimize better. Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-04-16RDMA/nes: Trivial endianness annotationsRoland Dreier
Fix a couple of htonl() that should really be ntohl(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-03-21RDMA/nes: Fix MSS calculation on RDMA pathChien Tung
Fix the calculation of the MSS for RDMA connections: we need to allow space in frames for a VLAN tag too. Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-02-26RDMA/nes: Fix CRC endianness for RDMA connection establishment on big-endianFaisal Latif
With commit ef19454b ("[LIB] crc32c: Keep intermediate crc state in cpu order"), the behavior of crc32c changes on big-endian platforms. Our algorithm expects the previous behavior; otherwise we have RDMA connection establishment failure on big-endian platforms like powerpc. Apply cpu_to_le32() to value returned by crc32c() to get the previous behavior. Signed-off-by: Faisal Latif <flatif@neteffect.com> Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-02-26RDMA/nes: Fix use-after-free in mini_cm_dec_refcnt_listen()Faisal Latif
Fix use-after-free spotted by Coverity checker flagged by Adrian Bunk. Signed-off-by: Faisal Latif <flatif@neteffect.com> Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-02-26RDMA/nes: Fix a memory leak in schedule_nes_timer()Adrian Bunk
Fix a memory leak spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-02-04RDMA/nes: Add a driver for NetEffect RNICsGlenn Streiff
Add a standard NIC and RDMA/iWARP driver for NetEffect 1/10Gb ethernet adapters. Signed-off-by: Glenn Streiff <gstreiff@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>