Reduce the default value of the srpt_sq_size kernel module
parameter from 4096 to 256. This avoids on recent kernels
(e.g. 4.1.0) QP creation causes swiotlb to complain about a
failed allocation.
Reported-by: Curtis Maloney <curtis@tinbrain.net>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6981 d57e44dd-8a1f-0410-8b47-8ef2f437770f
If rdma_accept fails the state of the qp is modified to error and all
posted recieve buffers will be flushed and because of the flush
the isert conn teardown flow will start.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
isert_delete_conn_dev function checks if it needs to close the connection
by checking that dev conn is not NULL.
We were missing set conn to null when freeing it and that caused working
with memory that was already freed.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
read/write events may arive after the isert connection has
started the teardown flow.
This scenario may occur on login logout stress.
It may lead to NULL derefrence bugs.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6953 d57e44dd-8a1f-0410-8b47-8ef2f437770f
If there is a dead connection we don't want to wait 60 seconds for
the connection timeout error.
So when closing the portal we close now all the connections
immediately without waiting for events to arrive.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
To avoid rare cases when checking ISERT_CONNECTION_EST bit
may lead to kref leak, we now take the third refcount earlier
before calling to rdma_accept.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
1) The race can happen after unreachable event handler close isert connection
and calling to rdma_disconnect from another thread on illegal cm_id.
For example call rdma_disconnect from isert_portal_release function.
2) It is also possible to get ESTABLISHED RDMACM event while rdma_disconnect
is called from another thread.
In established event we need to check conn is not in
teardown flow by checking the connection state with a mutex.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fix a missing kref put when isert_conn_established return an error.
By removing set bit ISERT_CONNECTION_ABORTED the connection teardown
will start when recieving the flush WRs.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
We must wait for both the send and recv cqs to flush all pending work
requests.
To make sure that the drain will be the last flush we post a second
drain work request on the recv queue.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Timewait exit event handler start to close iscsi conn
before poll cq finish to handle all the good completions.
This may lead to NULL deref at poll cq context or post recv
after post drain.
This commit close iscsi conn only when start getting flush.
Flush is guaranteed if iscsi conn was created because when allocating
iscsi conn we call post recv.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6945 d57e44dd-8a1f-0410-8b47-8ef2f437770f
After post drain we are not allowed to call post_recv or post_send,
because the drain must be the last flush to let us know that we may
close the conection safely.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6943 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The ioctl events may arive after the isert connection has
started the teardown flow.
This scenario may occur on login logout stress.
It may lead to NULL derefrence bugs.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6940 d57e44dd-8a1f-0410-8b47-8ef2f437770f
On login logout stress we can start a teardown flow before connection is
fully established.
In this case we have one less refcount on isert connection.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6937 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Clean pointers not to point to invalid memory.
- While conn is released set conn_dev->conn to null as conn is invalid now.
- While conn_dev is released set priv(conn) to null as conn_dev is invalid now.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6935 d57e44dd-8a1f-0410-8b47-8ef2f437770f