summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib
Commit message (Collapse)AuthorAgeFilesLines
* IPoIB: Fix oops with raw socketsRoland Dreier2006-03-291-1/+1
| | | | | | | | | | ipoib_hard_header() needs to handle the case that daddr is NULL. This can happen when packets are injected via a raw socket, and IPoIB shouldn't oops in this case. Reported by Anton Blanchard <anton@samba.org> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: P_Key change event handlingLeonid Arsh2006-03-244-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | This patch causes the network interface to respond to P_Key change events correctly. As a result, you'll see a child interface in the "RUNNING" state (netif_carrier_on()) only when the corresponding P_Key is configured by the SM. When SM removes a P_Key, the "RUNNING" state will be disabled for the corresponding network interface. To implement this, I added IB_EVENT_PKEY_CHANGE event handling. To prevent flushing the device before the device is open by the "delay open" mechanism, I added an additional device flag called IPOIB_FLAG_INITIALIZED. This also prevents the child network interface from trying to join to multicast groups until the PKEY is configured. We used to get error messages like: ib0.f2f2: couldn't attach QP to multicast group ff12:401b:f2f2:0:0:0:ffff:ffff in this case. To fix this, I just check IPOIB_FLAG_OPER_UP flag in ipoib_set_mcast_list(). Signed-off-by: Leonid Arsh <leonida@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Fix network interface "RUNNING" statusLeonid Arsh2006-03-241-2/+3
| | | | | | | | | | With the current IPoIB driver, the status of network interfaces stays "RUNNING" even if the link goes down (for example because a cable is unplugged). Fix this by flushing the IPoIB interface when the link goes down. Signed-off-by: Leonid Arsh <leonida@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Pass correct pointer when flushing child interfacesLeonid Arsh2006-03-241-1/+1
| | | | | | | ipoib_ib_dev_flush() should get passed cpriv->dev, not &cpriv->dev. Signed-off-by: Leonid Arsh <leonida@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds2006-03-211-15/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (235 commits) [NETFILTER]: Add H.323 conntrack/NAT helper [TG3]: Don't mark tg3_test_registers() as returning const. [IPV6]: Cleanups for net/ipv6/addrconf.c (kzalloc, early exit) v2 [IPV6]: Nearly complete kzalloc cleanup for net/ipv6 [IPV6]: Cleanup of net/ipv6/reassambly.c [BRIDGE]: Remove duplicate const from is_link_local() argument type. [DECNET]: net/decnet/dn_route.c: fix inconsequent NULL checking [TG3]: make drivers/net/tg3.c:tg3_request_irq() static [BRIDGE]: use LLC to send STP [LLC]: llc_mac_hdr_init const arguments [BRIDGE]: allow show/store of group multicast address [BRIDGE]: use llc for receiving STP packets [BRIDGE]: stp timer to jiffies cleanup [BRIDGE]: forwarding remove unneeded preempt and bh diasables [BRIDGE]: netfilter inline cleanup [BRIDGE]: netfilter VLAN macro cleanup [BRIDGE]: netfilter dont use __constant_htons [BRIDGE]: netfilter whitespace [BRIDGE]: optimize frame pass up [BRIDGE]: use kzalloc ...
| * [INFINIBAND] ipoib: Remove leftover use of neigh_ops->destructorArnaldo Carvalho de Melo2006-03-201-1/+0
| | | | | | | | | | Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * [NET]: Move destructor from neigh->ops to neigh_paramsMichael S. Tsirkin2006-03-201-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct neigh_ops currently has a destructor field, which no in-kernel drivers outside of infiniband use. The infiniband/ulp/ipoib in-tree driver stashes some info in the neighbour structure (the results of the second-stage lookup from ARP results to real link-level path), and it uses neigh->ops->destructor to get a callback so it can clean up this extra info when a neighbour is freed. We've run into problems with this: since the destructor is in an ops field that is shared between neighbours that may belong to different net devices, there's no way to set/clear it safely. The following patch moves this field to neigh_parms where it can be safely set, together with its twin neigh_setup. Two additional patches in the patch series update ipoib to use this new interface. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | IPoIB: Get rid of useless test of queue lengthRoland Dreier2006-03-201-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | In neigh_add_path(), the queue of delayed packets can never be full, because the queue is always freshly created and cannot be found by any other code path. In fact, the test of the queue length is worse than useless: if somehow the test ever triggered and path_rec_start() also failed, then dev_kfree_skb_any() will be called twice on the same skb. Fix this by deleting the useless test. Pointed out by Michael S. Tsirkin <mst@mellanox.co.il>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* | IPoIB: Move ipoib_ib_dev_flush() to ipoib workqueueJack Morgenstein2006-03-204-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move ipoib_ib_dev_flush() to ipoib's workqueue. This keeps it ordered with respect to other work scheduled by the ipoib driver. This fixes problems with races, for example: - ipoib_ib_dev_flush() has started running because of an IB event - user does ifconfig ib0 down - ipoib_mcast_stop_thread() gets called twice and waits for the same completion twice Signed-off-by: Jack Morgenstein <jackm@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* | IPoIB: Fix build now that neighbour destructor is in neigh_paramsRoland Dreier2006-03-201-1/+0
| | | | | | | | | | | | | | | | | | Fix the IPoIB build (which is broken in net-2.6.17 because of my screw-up, which left out this chunk in ipoib_multicast.c). The neighbour destructor is now in neigh_params, so we don't need to clear it in the ops structure. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* | IPoIB: Fix multicast race between canceling and completingMichael S. Tsirkin2006-03-201-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipoib_mcast_stop_thread currently tests mcast->query and if it is NULL, does not perform wait_for_completion on the mcast and frees the mcast object directly. However, since both operations are done without locking, it is possible that ipoib_mcast_join_complete is in progress on this mcast object and has set mcast->query to NULL already. Solve this by: - taking priv->lock before we change mcast->query in ipoib_mcast_join_complete, and keeping it until we no longer need the mcast object - taking priv->lock around mcast->query test in ipoib_mcast_stop_thread Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* | IPoIB: Clean up if posting receives failsEli Cohen2006-03-201-0/+1
| | | | | | | | | | | | | | | | | | | | If posting receives in ipoib_ib_dev_open() fails, call ipoib_ib_dev_stop() to move the device's QP back to the RESET state so that we can try again later. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* | IPoIB: Close race in setting mcast->ahEli Cohen2006-03-201-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipoib_mcast_send() tests mcast->ah twice. If this value is changed between these two points, we leak an skb. However, ipoib_mcast_join_finish() sets mcast->ah with no locking, so it could race against ipoib_mcast_send(). As a solution, take priv->lock around assignment to mcast->ah thus making sure ipoib_mcast_send() (which also takes priv->lock) is not in flight. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* | IPoIB: clarify to_ipoib_neigh()Michael S. Tsirkin2006-03-201-2/+8
|/ | | | | | | Cosmetic change: make alignment explicit in to_ipoib_neigh. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Yet another fix for send-only joinsRoland Dreier2006-02-111-5/+10
| | | | | | | | | | | Even after the last fix, it's still possible for a send-only join to start before the join for the broadcast group has finished. This could cause us to create a multicast group using attributes from the broadcast group that haven't been initialized yet, so we would use garbage for the Q_Key, etc. Fix this by waiting until the broadcast group's attached flag is set before starting send-only joins. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Fix another send-only join raceMichael S. Tsirkin2006-02-071-1/+1
| | | | | | | | | | | | | Further, there's an additional issue that I saw in testing: ipoib_mcast_send may get called when priv->broadcast is NULL (e.g. if the device was downed and then upped internally because of a port event). If this happends and the send-only join request gets completed before priv->broadcast is set, we get an oops. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Don't start send-only joins while multicast thread is stoppedMichael S. Tsirkin2006-02-072-0/+16
| | | | | | | | | | | | | | | | Fix the following race scenario: - Device is up. - Port event or set mcast list triggers ipoib_mcast_stop_thread, this cancels the query and waits on mcast "done" completion. - Completion is called and "done" is set. - Meanwhile, ipoib_mcast_send arrives and starts a new query, re-initializing "done". Fix this by adding a "multicast started" bit and checking it before starting a send-only join. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Lock accesses to multicast packet queuesMichael S. Tsirkin2006-01-171-3/+22
| | | | | | | | | Avoid corrupting mcast->pkt_queue by serializing access with priv->tx_lock. Also, update dropped packet statistics to count multicast packets removed from pkt_queue as dropped. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Make sure path is fully initialized before using itMichael S. Tsirkin2006-01-171-2/+2
| | | | | | | | | The SA path record query completion can initialize path->pathrec.dlid before IPoIB's callback runs and initializes path->ah, so we must test ah rather than dlid. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IB: convert from semaphores to mutexesIngo Molnar2006-01-136-40/+40
| | | | | | | | semaphore to mutex conversion by Ingo and Arjan's script. Signed-off-by: Ingo Molnar <mingo@elte.hu> [ Sanity-checked on real IB hardware ] Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Fix memory leak of multicast group structuresEli Cohen2006-01-122-65/+9
| | | | | | | | | | | The current handling of multicast groups in IPoIB ends up never freeing send-only multicast groups. It turns out the logic was much more complicated than it needed to be; we can fix this bug and completely kill ipoib_mcast_dev_down() at the same time. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Take dev->xmit_lock around mc_list accessesMichael S. Tsirkin2006-01-111-2/+5
| | | | | | | | dev->mc_list accesses must be protected by dev->xmit_lock. Found by Eli Cohen <eli@mellanox.co.il>. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Fix address handle refcounting for multicast groupsEli Cohen2006-01-101-6/+7
| | | | | | | | | | | | Multiple ipoib_neigh structures on mcast->neigh_list may point to the same ah. This means that ipoib_mcast_free() can't just make a list of ah structs to free, since this might end up trying to add the same ah to the list more than once. Handle this in ipoib_multicast.c in the same way as it is handled in ipoib_main.c for struct ipoib_path. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: Fix error path in ipoib_mcast_dev_flush()Eli Cohen2006-01-101-3/+5
| | | | | | | | | Don't leak memory on allocation failure for broadcast mcast group. Also, print a warning to match handling for other mcast groups. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [INET_SOCK]: Move struct inet_sock & helper functions to net/inet_sock.hArnaldo Carvalho de Melo2006-01-032-0/+4
| | | | | | | | | | | To help in reducing the number of include dependencies, several files were touched as they were getting needed headers indirectly for stuff they use. Thanks also to Alan Menegotto for pointing out that net/dccp/proto.c had linux/dccp.h include twice. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* IPoIB: fix error handling in ipoib_openRoland Dreier2005-11-291-1/+3
| | | | | | | If ipoib_ib_dev_up() fails after ipoib_ib_dev_open() is called, then ipoib_ib_dev_stop() needs to be called to clean up. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: protect child list in ipoib_ib_dev_flushMichael S. Tsirkin2005-11-291-0/+4
| | | | | | | race condition: ipoib_ib_dev_flush is accessing child list without locks. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: don't zero members after we allocate with kzallocRoland Dreier2005-11-291-4/+0
| | | | | | | ipoib_mcast_alloc() uses kzalloc(), so there's no need to zero out members of the mcast struct after it's allocated. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: reinitialize mcast structs' completions for every queryMichael S. Tsirkin2005-11-291-2/+4
| | | | | | | | Make sure mcast->done is initialized to uncompleted value before we submit a new query, so that it's safe to wait on. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: always set path->query to NULL when query finishesRoland Dreier2005-11-291-2/+2
| | | | | | | Always set path->query to NULL when the SA path record query completes, rather than only when we don't have an address handle. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* IPoIB: reinitialize path struct's completion for every queryRoland Dreier2005-11-281-1/+2
| | | | | | | | | | It's possible that IPoIB will issue multiple SA queries for the same path struct. Therefore the struct's completion needs to be initialized for each query rather than only once when the struct is allocated, or else we might not wait long enough for later queries to finish and free the path struct too soon. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] no need to set skb->dev right before freeing skbRoland Dreier2005-11-101-13/+4
| | | | | | | For cut-and-paste reasons, the IPoIB driver was setting skb->dev right before calling dev_kfree_skb_any(). Get rid of this. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] add path record information in debugfsRoland Dreier2005-11-105-49/+231
| | | | | | | | | | | | Add ibX_path files to debugfs that contain information about the IPoIB path cache. IPoIB ARP only gives GIDs, which the IPoIB driver must resolve to real IB paths through the ib_sa module. For debugging, when the ARP table looks OK but traffic isn't flowing, it's useful to be able to see if the resolution from GID to path worked. Also clean up the formatting of the existing _mcg debugfs files. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] don't compile debug code if debugging isn't enabledRoland Dreier2005-11-023-1/+7
| | | | | | | | | Don't build ipoib_mcast_iter_ functions if CONFIG_INFINIBAND_IPOIB_DEBUG is not enabled -- their only callers will not be built either. Also move the prototype for ipoib_open() to ipoib.h to fix a sparse warning. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] remove unneeded initializations to 0Roland Dreier2005-11-021-9/+2
| | | | | | | Shrink our source and .text a little by removing a few assignments of NULL and 0 to memory that is already cleared as part of the allocation. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IB] kzalloc() conversionsRoland Dreier2005-11-022-9/+3
| | | | | | | Replace kmalloc()+memset(,0,) with kzalloc(), for a net savings of 35 source lines and about 500 bytes of text. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] cleanups: fix comment, remove useless variablesRoland Dreier2005-10-312-9/+7
| | | | | | | | Minor cleanups: fix a misleading comment, and get rid of attr_mask variables that are only used to hold constants (just use the constants directly). Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] use spin_trylock_irqsave()Roland Dreier2005-10-291-4/+1
| | | | | | | | Use spin_trylock_irqsave() in ipoib_start_xmit() instead of reinventing it out of local_irq_save(), spin_trylock() and local_irq_restore(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] Drop RX packets when out of memoryRoland Dreier2005-10-283-60/+85
| | | | | | | | | | Change the way IPoIB handles RX packets when it can't allocate a new receive skbuff. If the allocation of a new receive skb fails, we now drop the packet we just received and repost the original receive skb. This means that the receive ring always stays full and we don't have to monkey around with trying to schedule a refill task for later. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] Improve ipoib_timeout() outputRoland Dreier2005-10-181-2/+5
| | | | | | | | Use jiffies_to_msecs() so we print a human-readable time so we don't have to worry about what HZ is configured to, and print out a few values to make post-mortem analysis easier. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] Rename ipoib_create_qp() -> ipoib_init_qp() and fix error cleanupRoland Dreier2005-10-173-7/+8
| | | | | | | | | | ipoib_create_qp() no longer creates IPoIB's QP, so it shouldn't destroy the QP on failure -- that unwinding happens elsewhere, so the current code can cause a double free. While we're at it, the function's name should match what it actually does, so rename it to ipoib_init_qp(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [IPoIB] Rename IPoIB's path_lookup() to avoid name clashesRoland Dreier2005-09-281-2/+2
| | | | | | | | | | Rename IPoIB driver's path_lookup() to ipoib_path_lookup() to avoid a clashes with the kernel global path_lookup(). We don't hit this with the current kernel source, but some external patches seem to trigger this, and it's cleaner to avoid clashing with global names anyway. Signed-off-by: Roland Dreier <rolandd@cisco.com> refs/heads/for-linus
* [PATCH] IPoIB: Don't flush workqueue from within workqueueRoland Dreier2005-09-203-6/+7
| | | | | | | | | | | ipoib_mcast_restart_task() is always called from within the single-threaded IPoIB workqueue, so flushing the workqueue from within the function can lead to a recursion overflow. But since we're running in a single-threaded workqueue, we're already synchronized against other items in the workqueue, so just get rid of the flush in ipoib_mcast_restart_task(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IPoIB: Fix SA client retransmission strategyHal Rosenstock2005-09-181-3/+3
| | | | | | | | | | We got a little mixed up with what the backoff member holds in the IPoIB multicast group structure: sometimes it was used as a number of seconds, and sometimes it was used as a number of jiffies. Fix the code so that backoff is always in seconds. Signed-off-by: Hal Rosenstock <halr@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IPoIB: fix module removal raceMichael S. Tsirkin2005-09-181-0/+2
| | | | | | | | Since ipoib uses queue_delayed_work to run flush task on port state events, it must flush scheduled work after unregistering the event handler. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IPoIB: fix memory leakMichael S. Tsirkin2005-09-071-0/+2
| | | | | | | Fix IPoIB memory leak on device removal. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IB: move include files to include/rdmaRoland Dreier2005-08-264-7/+5
| | | | | | | | Move the InfiniBand headers from drivers/infiniband/include to include/rdma. This allows InfiniBand-using code to live elsewhere, and lets us remove the ugly EXTRA_CFLAGS include path from the InfiniBand Makefiles. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IPoIB: Fix device removal raceMichael S. Tsirkin2005-08-261-1/+1
| | | | | | | | | | | | | Currently we may have work scheduled in default kernel workqueue when the device is going down. The device could get freed before this workqueue gets serviced. I am actually seeing this causing system hangs. The following patch fixes this by using ipoib_workqueue which gets flushed when the device is going down. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IPoIB: Set full membership bit in P_KeysRoland Dreier2005-08-261-0/+12
| | | | | | | | | Always make sure that the full membership bit is set in the P_Keys that IPoIB uses. This makes sure that all hosts join the correct multicast groups so that hosts that are partial partition members can talk to the rest of the network. Signed-off-by: Roland Dreier <rolandd@cisco.com>
* [PATCH] IB: Remove unnecessary includes of <linux/version.h>Olaf Hering2005-08-262-2/+0
| | | | | | | | changing CONFIG_LOCALVERSION rebuilds too much, for no appearent reason. Remove unneeded includes of <linux/version.h>. Signed-off-by: Olaf Hering <olh@suse.de> Signed-off-by: Roland Dreier <rolandd@cisco.com>
OpenPOWER on IntegriCloud