]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agosdp: fixed SrcAvail memory leak
Eldad Zinger [Sun, 15 Aug 2010 07:05:40 +0000 (10:05 +0300)]
sdp: fixed SrcAvail memory leak

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: removed unnecessary variable 'vm_wait'
Eldad Zinger [Mon, 9 Aug 2010 14:11:35 +0000 (17:11 +0300)]
sdp: removed unnecessary variable 'vm_wait'

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: stability improvements for ZCopy
Eldad Zinger [Mon, 9 Aug 2010 14:05:44 +0000 (17:05 +0300)]
sdp: stability improvements for ZCopy

- beter handling of ZCopy errors and SrcAvailCancel requests
- fixed SrcAvailCancel sequence number handling

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: properly kill nagle_timer on socket reset
Eldad Zinger [Thu, 5 Aug 2010 07:16:58 +0000 (10:16 +0300)]
sdp: properly kill nagle_timer on socket reset

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG2092 - ib_device field in sdp_sock is reset not in user-context
Eldad Zinger [Thu, 5 Aug 2010 06:31:27 +0000 (09:31 +0300)]
sdp: BUG2092 - ib_device field in sdp_sock is reset not in user-context

ib_device field of sdp_sock is NULL after either cases:
- cma handler resetting the socket
- device removal
Both cases are not in user-context.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix for stopping tx timer/tasklet when socket state is TCP_CLOSE
Eldad Zinger [Thu, 5 Aug 2010 05:39:58 +0000 (08:39 +0300)]
sdp: fix for stopping tx timer/tasklet when socket state is TCP_CLOSE

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG1403 - last sk_refcnt is called while cma handler is invoked
Eldad Zinger [Tue, 3 Aug 2010 16:14:59 +0000 (19:14 +0300)]
sdp: BUG1403 - last sk_refcnt is called while cma handler is invoked

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: bug fix for a case of no memory to allocate for rx_sa
Eldad Zinger [Sun, 1 Aug 2010 11:19:26 +0000 (14:19 +0300)]
sdp: bug fix for a case of no memory to allocate for rx_sa

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: rx_irq should use tasklet instead of timer due to latency issue
Eldad Zinger [Mon, 2 Aug 2010 12:05:12 +0000 (15:05 +0300)]
sdp: rx_irq should use tasklet instead of timer due to latency issue

mod_timer(..., 0) measured to add 4ms delay.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: better handling of page-allocation-failure
Eldad Zinger [Sun, 1 Aug 2010 16:16:20 +0000 (19:16 +0300)]
sdp: better handling of page-allocation-failure

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: reduce size of sdp_buf to what is really being used
Eldad Zinger [Sun, 1 Aug 2010 15:46:49 +0000 (18:46 +0300)]
sdp: reduce size of sdp_buf to what is really being used

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: remove the relation between qp_active and sdp_free_fmr()
Eldad Zinger [Sun, 1 Aug 2010 15:08:11 +0000 (18:08 +0300)]
sdp: remove the relation between qp_active and sdp_free_fmr()

This will fix the warning message from ib_destroy_fmr_pool().

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: small fix to support device removal during traffic
Eldad Zinger [Sun, 1 Aug 2010 15:00:11 +0000 (18:00 +0300)]
sdp: small fix to support device removal during traffic

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: bug fix for a case of no memory to allocate for tx_sa
Eldad Zinger [Sun, 1 Aug 2010 11:30:54 +0000 (14:30 +0300)]
sdp: bug fix for a case of no memory to allocate for tx_sa

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix behavior when a skb allocation fails
Eldad Zinger [Mon, 26 Jul 2010 07:24:05 +0000 (10:24 +0300)]
sdp: fix behavior when a skb allocation fails

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: some small non-behavioral changes in sdp_dreq_wait_timeout_work()
Eldad Zinger [Thu, 22 Jul 2010 09:08:52 +0000 (12:08 +0300)]
sdp: some small non-behavioral changes in sdp_dreq_wait_timeout_work()

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: rewrite orphan count logic
Eldad Zinger [Thu, 22 Jul 2010 05:03:49 +0000 (08:03 +0300)]
sdp: rewrite orphan count logic

orphan count is increased on every call to sdp_common_release and decreased on
every call to sdp_destruct (just before the socket is freed).

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: change socket reference semantics: keepalive != alive
Eldad Zinger [Wed, 21 Jul 2010 14:40:45 +0000 (17:40 +0300)]
sdp: change socket reference semantics: keepalive != alive

keepalive timer manages a socket reference count regardless to the initial
socket reference (SOCK_REF_ALIVE).

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: remove unnecessary argument from sdp_connected_handler.
Eldad Zinger [Wed, 21 Jul 2010 14:05:33 +0000 (17:05 +0300)]
sdp: remove unnecessary argument from sdp_connected_handler.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: removed extra debug message and comment.
Eldad Zinger [Tue, 20 Jul 2010 11:43:26 +0000 (14:43 +0300)]
sdp: removed extra debug message and comment.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix for socket refcnt when error is marked while in TCP_TIME_WAIT state
Eldad Zinger [Tue, 20 Jul 2010 11:32:44 +0000 (14:32 +0300)]
sdp: fix for socket refcnt when error is marked while in TCP_TIME_WAIT state

When socket is in TCP_TIME_WAIT state, the next sdp_destroy_work() call will
put the cma_refcnt, so we should not change the socket state even if there is
an error.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: enable support for ib devices that do not support fmr
Eldad Zinger [Tue, 20 Jul 2010 09:45:02 +0000 (12:45 +0300)]
sdp: enable support for ib devices that do not support fmr

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: before activating rx_ring timer, need to check that qp is still active.
Eldad Zinger [Wed, 14 Jul 2010 08:20:19 +0000 (11:20 +0300)]
sdp: before activating rx_ring timer, need to check that qp is still active.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix compilation warnings
Eldad Zinger [Wed, 14 Jul 2010 07:14:14 +0000 (10:14 +0300)]
sdp: fix compilation warnings

use %z for size_t in printk's

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: define SDP_MAX_PAYLOAD as ulong instead of int, to comply with PAGE_SIZE
Eldad Zinger [Wed, 14 Jul 2010 04:50:43 +0000 (07:50 +0300)]
sdp: define SDP_MAX_PAYLOAD as ulong instead of int, to comply with PAGE_SIZE

SDP_MAX_PAYLOAD is compared a lot to PAGE_SIZE by min(), and on some kernels a
compilation warning of "comparison of distinct pointer types lacks a cast"
appears.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: some small non-functional changes.
Eldad Zinger [Mon, 12 Jul 2010 13:18:07 +0000 (16:18 +0300)]
sdp: some small non-functional changes.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: enable rx_cq arming when no one polls.
Eldad Zinger [Mon, 12 Jul 2010 12:59:57 +0000 (15:59 +0300)]
sdp: enable rx_cq arming when no one polls.

No need to explicitly arm the cq, posts_handler_put will arm it.

9 years agosdp: before arming cq, need to check if cq was not destroyed already.
Eldad Zinger [Sun, 11 Jul 2010 09:14:20 +0000 (12:14 +0300)]
sdp: before arming cq, need to check if cq was not destroyed already.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: When purging tx_ring, rdma_inflight accountings should be disregarded, so the...
Eldad Zinger [Thu, 8 Jul 2010 13:37:24 +0000 (16:37 +0300)]
sdp: When purging tx_ring, rdma_inflight accountings should be disregarded, so the number of skbs to free is just (posted=head-tail).

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: tx_ring timer should not be scheduled if the qp is not active anymore.
Eldad Zinger [Thu, 8 Jul 2010 13:27:20 +0000 (16:27 +0300)]
sdp: tx_ring timer should not be scheduled if the qp is not active anymore.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: if can't recv or send, and the qp is not active, return -EPIPE instead of 0
Eldad Zinger [Wed, 7 Jul 2010 15:48:27 +0000 (18:48 +0300)]
sdp: if can't recv or send, and the qp is not active, return -EPIPE instead of 0

This fixes an endles loop problem where userspace programs are looping on recv
or send until all required bytes processed or until an error returned.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: rx completions workqueue should be flushed after qp destruction and before the...
Eldad Zinger [Wed, 7 Jul 2010 13:03:11 +0000 (16:03 +0300)]
sdp: rx completions workqueue should be flushed after qp destruction and before the socket is freed.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: rx/tx tasklets should be properly killed when destroying qp.
Eldad Zinger [Mon, 5 Jul 2010 11:46:04 +0000 (14:46 +0300)]
sdp: rx/tx tasklets should be properly killed when destroying qp.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: some annoying whitespaces removed.
Eldad Zinger [Mon, 5 Jul 2010 08:38:11 +0000 (11:38 +0300)]
sdp: some annoying whitespaces removed.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: remove white spaces in the end of some lines.
Eldad Zinger [Sun, 4 Jul 2010 14:15:43 +0000 (17:15 +0300)]
sdp: remove white spaces in the end of some lines.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: device_removal_lock should not be a spinlock because module removal takes a...
Eldad Zinger [Sun, 4 Jul 2010 13:30:43 +0000 (16:30 +0300)]
sdp: device_removal_lock should not be a spinlock because module removal takes a long time.

In order to prevent a situation that many CPUs are stack with read-spinlock
waiting for remove-device write-lock to be freed, I replaced the rw-spinlock
with rw-semaphore. That way the blocked processes goes to sleep and are not
blocking other processes.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: error value for sdp_set_error() should be negative.
Eldad Zinger [Wed, 30 Jun 2010 14:38:33 +0000 (17:38 +0300)]
sdp: error value for sdp_set_error() should be negative.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: Fix for deadlock between sdp_connect and sdp_destroy_work.
Eldad Zinger [Thu, 24 Jun 2010 15:27:46 +0000 (18:27 +0300)]
sdp: Fix for deadlock between sdp_connect and sdp_destroy_work.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: cleanup ssk->rx_sa when aborting incoming SrcAvail
Amir Vadai [Wed, 23 Jun 2010 10:43:55 +0000 (13:43 +0300)]
sdp: cleanup ssk->rx_sa when aborting incoming SrcAvail

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix compilation warnings in RH
Amir Vadai [Wed, 23 Jun 2010 10:42:39 +0000 (13:42 +0300)]
sdp: fix compilation warnings in RH

use %z for size_t in printf's

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: sdp_destroy_qp should be protected in destroy work
Amir Vadai [Wed, 23 Jun 2010 08:07:36 +0000 (11:07 +0300)]
sdp: sdp_destroy_qp should be protected in destroy work

sdp_destroy_work didn't take a lock before destorying QP

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: don't double free fmr
Amir Vadai [Tue, 22 Jun 2010 11:29:31 +0000 (14:29 +0300)]
sdp: don't double free fmr

There are flows that try to free ssk->fmr twice.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Limit FMR resources
Amir Vadai [Tue, 22 Jun 2010 07:45:58 +0000 (10:45 +0300)]
sdp: Limit FMR resources

- Make FMR pool size a module parameter and set default value to a
  smaller value (20 FMR's)
- Fallback to SendSM silently when  can't allocate FMR

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix for hangs/crashes in rare cases
Amir Vadai [Tue, 22 Jun 2010 07:40:54 +0000 (10:40 +0300)]
sdp: Fix for hangs/crashes in rare cases

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix for warning message when receiving with MSG_PEEK flag, and free skb that...
Eldad Zinger [Thu, 17 Jun 2010 06:57:57 +0000 (09:57 +0300)]
sdp: Fix for warning message when receiving with MSG_PEEK flag, and free skb that is not needed any more after all data was read from it.

'rx_sa->used', unlike 'offset', was not updated when MSG_PEEK flag was up and
that lead to the behavior that bytes considered to be available to copy while
the sequence offset showed that the bytes already consumed.
The solution is to discard any use of 'rx_sa->used' and use 'offset' instead.

An skb of SDP_MID_SRCAVAIL is not needed anymore when all its inline data was
consumed and the RDMA operation was canceled (due to MSG_PEEK flag).
This fix eliminates the warning message: "Trying to read beyond SKB".

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: On MSG_PEEK, no rdma_rd_complete should be sent.
Eldad Zinger [Thu, 17 Jun 2010 07:44:42 +0000 (10:44 +0300)]
sdp: On MSG_PEEK, no rdma_rd_complete should be sent.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: update for sdp_cma_handler() events debug messages.
Eldad Zinger [Mon, 14 Jun 2010 12:49:19 +0000 (15:49 +0300)]
sdp: update for sdp_cma_handler() events debug messages.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix for handling multi iov's in ZCOPY.
Eldad Zinger [Tue, 15 Jun 2010 05:08:22 +0000 (08:08 +0300)]
sdp: fix for handling multi iov's in ZCOPY.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: Fix iperf multistream hanging
Amir Vadai [Wed, 16 Jun 2010 08:54:11 +0000 (11:54 +0300)]
sdp: Fix iperf multistream hanging

When trying to send and no credits available. Sometime coulnd't get
credit update, because interrupts are turned off by default.
Added poll RX CQ to fix in this case.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix wrong use of ssk->sdp_disconnect
Amir Vadai [Wed, 16 Jun 2010 08:46:56 +0000 (11:46 +0300)]
sdp: Fix wrong use of ssk->sdp_disconnect

Due to miss-use of sdp_disconnect rx cq is not armed after disconnect is
sent

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: protect sdp_auto_moderation from device removal
Amir Vadai [Tue, 15 Jun 2010 13:00:15 +0000 (16:00 +0300)]
sdp: protect sdp_auto_moderation from device removal

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: sdp_recvmsg() shouldn't handle SDP_MID_DISCONN when MSG_PEEK flag is up.
Eldad Zinger [Mon, 14 Jun 2010 10:03:16 +0000 (13:03 +0300)]
sdp: sdp_recvmsg() shouldn't handle SDP_MID_DISCONN when MSG_PEEK flag is up.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: added lock_sock() to sdp_poll()
Eldad Zinger [Mon, 14 Jun 2010 09:01:31 +0000 (12:01 +0300)]
sdp: added lock_sock() to sdp_poll()

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: Cleanedup some commented lines
Amir Vadai [Sun, 13 Jun 2010 13:10:29 +0000 (16:10 +0300)]
sdp: Cleanedup some commented lines

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix bad handling of small rcvbuf size in zcopy
Amir Vadai [Thu, 10 Jun 2010 08:32:50 +0000 (11:32 +0300)]
sdp: Fix bad handling of small rcvbuf size in zcopy

- Do not send RdmaRdComp when no buffers
- Same for SendSm
- post at least 3 buffers in RX to have the minimal number of credits
- make purge_tx_ring ignore WR used by RDMA
- fixed a typo, to reschedule tx_cq_poll timer according to tx queue and
  not to rx queue (!)
- Allow credit updates when less than half RX Q is filled

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix issues in orphan count
Amir Vadai [Mon, 14 Jun 2010 10:08:36 +0000 (13:08 +0300)]
sdp: fix issues in orphan count

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: protect rx_ring access with a lock
Amir Vadai [Sun, 13 Jun 2010 12:51:01 +0000 (15:51 +0300)]
sdp: protect rx_ring access with a lock

because sdp_poll_rx_cq() is accessed both from interrupt and from user
context, need to protect it with a lock.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: cleanup skb allocations
Amir Vadai [Wed, 9 Jun 2010 09:40:23 +0000 (12:40 +0300)]
sdp: cleanup skb allocations

- Bad sizing of inline data on send sockets had implications on the
  performance.
- All sent data is placed on the skb itself (unless accumulated by nagle)
- Do not count sdp header twice when allocating skb
  added some likely/unlikely

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Reuse buffers in rx ring
Amir Vadai [Mon, 7 Jun 2010 15:17:59 +0000 (18:17 +0300)]
sdp: Reuse buffers in rx ring

To improve latency in small packets - reuse already pinned and allocated
pages that wasn't used.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: cpu affinity in sdpstats
Amir Vadai [Sun, 6 Jun 2010 09:23:55 +0000 (12:23 +0300)]
sdp: cpu affinity in sdpstats

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: use polling in rx
Amir Vadai [Tue, 1 Jun 2010 14:04:59 +0000 (17:04 +0300)]
sdp: use polling in rx

poll on RX whenever possible, use interrupts only before sleeping,
during graceful close or in zcopy.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix for a bug of lost refcnt in TCP_TIME_WAIT state.
Eldad Zinger [Sun, 6 Jun 2010 10:48:32 +0000 (13:48 +0300)]
sdp: fix for a bug of lost refcnt in TCP_TIME_WAIT state.

OFED addons break semantics of cancel_delayed_work_sync(), like in SLES 10.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG2038 - transmission goal size won't exceed SDP_MAX_PAYLOAD
Eldad Zinger [Sun, 6 Jun 2010 09:07:59 +0000 (12:07 +0300)]
sdp: BUG2038 - transmission goal size won't exceed SDP_MAX_PAYLOAD

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: SDP_WARN_ON defined to be used instead of WARN_ON, for better compatibility
Eldad Zinger [Tue, 1 Jun 2010 08:42:35 +0000 (11:42 +0300)]
sdp: SDP_WARN_ON defined to be used instead of WARN_ON, for better compatibility

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: new debug function added, minor debug message change.
Eldad Zinger [Sun, 23 May 2010 08:40:02 +0000 (11:40 +0300)]
sdp: new debug function added, minor debug message change.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: device removal rewritten for a stability improvement.
Eldad Zinger [Sun, 30 May 2010 11:03:43 +0000 (14:03 +0300)]
sdp: device removal rewritten for a stability improvement.

main changes:
1. device_removal_lock is better used.
2. sdp_dev is marked NULL in order to prevent new sockets born to the removed
   device.
3. new timeout functionality used when a reference count was taken for the CMA
   to return, but the CMA won't be invoked because rdma_id was destroyed.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: unnecessary local variable removed, 'const' declarations added
Eldad Zinger [Tue, 18 May 2010 10:35:56 +0000 (13:35 +0300)]
sdp: unnecessary local variable removed, 'const' declarations added

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: tx timer is deleted when sockets goes to TCP_CLOSE
Eldad Zinger [Tue, 18 May 2010 10:32:27 +0000 (13:32 +0300)]
sdp: tx timer is deleted when sockets goes to TCP_CLOSE

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: canceled a call to sdp_desroy_work() on send completion with error
Eldad Zinger [Tue, 18 May 2010 08:48:54 +0000 (11:48 +0300)]
sdp: canceled a call to sdp_desroy_work() on send completion with error

No need to destroy resources after send completion with error.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: unnecessary wait-queue removed from sdp_sock structure.
Eldad Zinger [Tue, 18 May 2010 08:34:28 +0000 (11:34 +0300)]
sdp: unnecessary wait-queue removed from sdp_sock structure.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: unnecessary local variable removed.
Eldad Zinger [Tue, 4 May 2010 09:11:04 +0000 (12:11 +0300)]
sdp: unnecessary local variable removed.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: debug message for reference count changed from CM_TW to CMA
Eldad Zinger [Tue, 4 May 2010 09:05:56 +0000 (12:05 +0300)]
sdp: debug message for reference count changed from CM_TW to CMA

This debug message marks that the sdp_cma_handler() is expected to be invoked.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG2031 - sdp_cma_handler() won't be invoked after last ref count removed
Eldad Zinger [Tue, 4 May 2010 08:43:29 +0000 (11:43 +0300)]
sdp: BUG2031 - sdp_cma_handler() won't be invoked after last ref count removed

rdma_id will be destructed in cases where the sdp_cma_handler() is not required any more.
This will disable asynchronous-events handling after the last reference count removed.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix a leak when ib_post_xxx fail + small fixes
Amir Vadai [Mon, 26 Apr 2010 11:53:23 +0000 (14:53 +0300)]
sdp: fix a leak when ib_post_xxx fail + small fixes

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: on device removal, ref count taken so that socket won't be destructed
Eldad Zinger [Mon, 26 Apr 2010 07:48:48 +0000 (10:48 +0300)]
sdp: on device removal, ref count taken so that socket won't be destructed

On device removal, socket resources that are based on device are destroyed,
but the socket itself will be destroyed later, upon user request.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: use max number of SGE from HW capabilities
Amir Vadai [Thu, 22 Apr 2010 08:26:57 +0000 (11:26 +0300)]
sdp: use max number of SGE from HW capabilities

Instead of using hard coded max number of SGE's take
it from device capabilities.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix a hang when ib_post_recv is failed
Amir Vadai [Sun, 25 Apr 2010 08:55:29 +0000 (11:55 +0300)]
sdp: Fix a hang when ib_post_recv is failed

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix compilation warning on debug prints
Amir Vadai [Sun, 25 Apr 2010 08:50:44 +0000 (11:50 +0300)]
sdp: fix compilation warning on debug prints

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: sdp_bzcopy_thresh module parameter removal
Eldad Zinger [Thu, 22 Apr 2010 07:34:59 +0000 (10:34 +0300)]
sdp: sdp_bzcopy_thresh module parameter removal

Field [bzcopy_thresh] inside 'struct sdp_sock' changed to [zcopy_thresh] and
the ability to disable zcopy per-socket was added.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG2017 - better initialization implementation for ssk->nagle_timer
Eldad Zinger [Sun, 18 Apr 2010 13:56:03 +0000 (16:56 +0300)]
sdp: BUG2017 - better initialization implementation for ssk->nagle_timer

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: fix for brutal device removing
Eldad Zinger [Sun, 18 Apr 2010 11:34:33 +0000 (14:34 +0300)]
sdp: fix for brutal device removing

Kernel always crashed in the following test case:
user program: socket+bind+listen+accept. socket accpted.
shell: rmmod mlx4_ib
user program: close <<< CRASH
The fix closes any socket that its ib_device is the device being removed.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: Don't try to allocate FMR larger than RLIMIT_MEMLOCK
Amir Vadai [Thu, 15 Apr 2010 08:57:11 +0000 (11:57 +0300)]
sdp: Don't try to allocate FMR larger than RLIMIT_MEMLOCK

During ZCopy. If don't have CAP_IPC_LOCK capability and current
max number of locked pages is smaller than the buffer size, split
the send into small fragments.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Don't count sdp header twice when calculating size_goal
Amir Vadai [Thu, 15 Apr 2010 08:52:19 +0000 (11:52 +0300)]
sdp: Don't count sdp header twice when calculating size_goal

sizeof(struct sdp_bsdh) is included inside skb->len. Ignore it
when calculating maximum payload of the skb.
This mistake caused every BCopy send of 32K (and its multiples) to
be split and thus got bad performance.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: timeout for abortive close updated
Eldad Zinger [Tue, 13 Apr 2010 10:39:41 +0000 (13:39 +0300)]
sdp: timeout for abortive close updated

SDP_FIN_WAIT_TIMEOUT updated from 10[sec] to 60[sec] to comply with TCP
TCP_FIN_TIMEOUT.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: module parameter to disable SDP over ROCEE
Amir Vadai [Mon, 12 Apr 2010 12:42:32 +0000 (15:42 +0300)]
sdp: module parameter to disable SDP over ROCEE

Since ROCEE added, SDP always try to connect, even
if link layer of type Ethernet. This make 'both' mode
in libsdp useless.

Added a module paramter to disable it by default

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: added differentiation between bind failures of sdp.
Eldad Zinger [Thu, 8 Apr 2010 07:09:37 +0000 (10:09 +0300)]
sdp: added differentiation between bind failures of sdp.

When bind()ing in mode 'BOTH', bind(sdp_sock) might fail if:
1. the IP&port is already bounded.
2. the IP is not part of IB network.
previous implementation returned errno=EADDRINUSE either way.

Only the first case should fail the bind(), the second is legitimate
because the TCP socket will hanle the connection.
This fix corresponds to a fix in libsdp.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG1727 - there is no point of using zcopy when credits are not available.
Eldad Zinger [Thu, 18 Mar 2010 08:53:56 +0000 (10:53 +0200)]
sdp: BUG1727 - there is no point of using zcopy when credits are not available.

if credits are not available, data won't be transferred anyway,
so it would be better to use bcopy.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG1992 - enable transmission of credits update when tx_credits == 1
Eldad Zinger [Wed, 31 Mar 2010 13:02:03 +0000 (16:02 +0300)]
sdp: BUG1992 - enable transmission of credits update when tx_credits == 1

According to spec, if one credit is available, we can only send messages that
provide additional credits and also do not contain data payload.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: unnecessary 'if' statement canceled.
Eldad Zinger [Wed, 31 Mar 2010 12:27:38 +0000 (15:27 +0300)]
sdp: unnecessary 'if' statement canceled.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG1727 - fixed select(2) behavior on a new nonblocking socket.
Eldad Zinger [Thu, 18 Mar 2010 11:31:08 +0000 (13:31 +0200)]
sdp: BUG1727 - fixed select(2) behavior on a new nonblocking socket.

when calling for select(2) after socket(2) on a nonblocking socket,
select(2) should return 'writable'.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: BUG1727 - sdp_destroy_work() and sdp_connect() interfere with each other.
Eldad Zinger [Wed, 17 Mar 2010 13:24:28 +0000 (15:24 +0200)]
sdp: BUG1727 - sdp_destroy_work() and sdp_connect() interfere with each other.

This fix was done in order to make sure that sdp_destroy_work() is done
before sdp_connect() is active.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
9 years agosdp: support iovlen > 1 in zcopy
Amir Vadai [Sun, 14 Mar 2010 14:36:32 +0000 (16:36 +0200)]
sdp: support iovlen > 1 in zcopy

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: make sdp_socket.h available to user applications
Amir Vadai [Sun, 14 Mar 2010 14:35:38 +0000 (16:35 +0200)]
sdp: make sdp_socket.h available to user applications

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: enable FMR pool cache
Amir Vadai [Thu, 1 Apr 2010 07:28:37 +0000 (10:28 +0300)]
sdp: enable FMR pool cache

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Stop SA Cancel timeout when getting SendSM/RdmaRdCompl
Amir Vadai [Thu, 25 Feb 2010 22:50:29 +0000 (00:50 +0200)]
sdp: Stop SA Cancel timeout when getting SendSM/RdmaRdCompl

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: SendSM wasn't sent sometimes after getting SrcAvailCancel
Amir Vadai [Thu, 25 Feb 2010 09:43:03 +0000 (11:43 +0200)]
sdp: SendSM wasn't sent sometimes after getting SrcAvailCancel

* skb was freed if rx_sa is aborted - preventing SendSM
  to be sent.
* Didn't update rx_sa->used in case of SrcAvailCancel
  and therefore not sending RdmaRdCompl.
  This also caused the next read to fail because offset
  wasn't updated

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Send SendSM from recvmsg context and not from interrupt
Amir Vadai [Wed, 24 Feb 2010 11:58:35 +0000 (13:58 +0200)]
sdp: Send SendSM from recvmsg context and not from interrupt

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix bug in crossing SrcAvail
Amir Vadai [Wed, 24 Feb 2010 08:59:31 +0000 (10:59 +0200)]
sdp: Fix bug in crossing SrcAvail

* Handle RdmaRdCompl in interrupt, before splitted to two Q's
  This way the handling is sequencial, and no race could occure
  between RdmaRdCompl and SrcAvailCancel
* Fixed an error when checking that RdmaRdCompl is not for
  old SrcAvail

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Add detailed ZCopy aborted send statistics
Amir Vadai [Wed, 24 Feb 2010 08:39:54 +0000 (10:39 +0200)]
sdp: Add detailed ZCopy aborted send statistics

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Prevent kernel crash if device init fails (plus bonus fix)
Amir Vadai [Tue, 23 Feb 2010 08:02:59 +0000 (10:02 +0200)]
sdp: Prevent kernel crash if device init fails (plus bonus fix)

If sdp_add_device() fails, there is no client data stored in the IB device,
leading to a kernel crash when a connection is being established. Fix this
by rejecting connections when the device is not initialized.

Also, fix a bad goto target in an error case early in sdp_init_qp().

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>