Commit Graph

512 Commits

Author SHA1 Message Date
Bart Van Assche
679d1c637e ib_srpt: Fix a sparse warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5413 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-15 06:03:59 +00:00
Bart Van Assche
b668ab5a6e ib_srpt: RHEL 6.5 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5403 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-03 15:58:16 +00:00
Bart Van Assche
c196d7bbcd ib_srpt: Make srpt_abort_cmd() state checks more strict
Complain if srpt_abort_cmd() is called for an I/O context that is
being processed by SCST and not by the HCA.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5393 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 12:00:43 +00:00
Bart Van Assche
6944885268 ib_srpt: Suppress superfluous error messages
Only complain about a missing completion for I/O contexts that are
in a state where the ib_srpt driver is waiting for the HCA.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5392 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 11:59:37 +00:00
Bart Van Assche
fa5aab6390 ib_srpt: Clean up srpt_handle_rdma_err_comp()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5391 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 11:58:25 +00:00
Bart Van Assche
047e51173a ib_srpt: Clean up srpt_handle_send_err_comp()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5390 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 11:56:59 +00:00
Bart Van Assche
464b182c2b ib_srpt: Clean up srpt_handle_rdma_comp()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5389 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 11:56:13 +00:00
Bart Van Assche
e72f83a05a ib_srpt: Avoid waiting for missing error completions
Apparently with mlx4 firmware up to and including 2.30.8000 it is not
guaranteed that for a QP associated with an SRQ error completions are
generated for all pending work requests. Avoid triggering
srpt_pending_cmd_timeout() for missing error completions.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5370 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:07:43 +00:00
Bart Van Assche
b95b1f4d6c ib_srpt: Add a kernel warning
Invoking srpt_zerolength_write() before the queue pair has reached
the error state is a bug, so complain loudly if that happens.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:04:44 +00:00
Bart Van Assche
ada7c26a2e ib_srpt: Fix a kernel warning
Avoid that the following (very rare) kernel warning is reported
when an ib_srpt target port is disabled while I/O is ongoing:

WARNING: CPU: 3 PID: 12259 at srpt/src/ib_srpt.c:3334 srpt_xmit_response+0x165/0x300 [ib_srpt]()
Unexpected command state 6
Call Trace:
 [<ffffffff814a15dc>] dump_stack+0x4e/0x7a
 [<ffffffff8104bc5d>] warn_slowpath_common+0x7d/0xa0
 [<ffffffff8104bccc>] warn_slowpath_fmt+0x4c/0x50
 [<ffffffffa0771525>] srpt_xmit_response+0x165/0x300 [ib_srpt]
 [<ffffffffa082aacc>] scst_xmit_response+0xbc/0x560 [scst]
 [<ffffffffa083123d>] scst_process_active_cmd+0x29d/0x7b0 [scst]
 [<ffffffffa0832bd9>] scst_do_job_active+0x89/0x1a0 [scst]
 [<ffffffffa0832e4f>] scst_cmd_thread+0x15f/0x350 [scst]
 [<ffffffff810766cd>] kthread+0xed/0x110
 [<ffffffff814b312c>] ret_from_fork+0x7c/0xb0
---[ end trace 591f7af7d006fc0e ]---


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5368 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:03:09 +00:00
Bart Van Assche
de3ed1e6ec ib_srpt: Micro-optimize srpt_adjust_srq_wr_avail()
The overhead of atomic_add_return() is lower than that of a
spin_lock() / spin_unlock() pair, hence switch to the former.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:01:07 +00:00
Bart Van Assche
a0cd399507 ib_srpt: Clean up srpt_destroy_ch_ib()
All callers guarantee that the completion queue is empty so it is
not necessary to invoke ib_poll_cq() from inside this function.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5366 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:59:27 +00:00
Bart Van Assche
a4cf36ba4e ib_srpt: Change the severity level of a log message
Make sure that target port state changes get logged even with
debugging disabled.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5365 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:57:39 +00:00
Bart Van Assche
b40f69db8b ib_srpt: Add newline at the end of kernel warning statements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5364 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:55:56 +00:00
Bart Van Assche
d1e1e480ed ib_srpt: Clarify a kernel-doc comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5363 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:53:00 +00:00
Bart Van Assche
fe6ad820db ib_srpt: Rework waiting for last WQE
After having changed the queue pair state into "error", queue an additional
work request instead of waiting for the last WQE event.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5357 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:25:34 +00:00
Bart Van Assche
46aa72be44 ib_srpt: Defer destroying the QP until the TimeWait state has been left
This is necessary to avoid that a login gets rejected due to reusing a
queue pair number that has not yet been freed by the target side.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5356 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:24:18 +00:00
Bart Van Assche
7efb024a7d ib_srpt: Simplify channel state management code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:23:16 +00:00
Bart Van Assche
0433a5c965 ib_srpt: Rework multi-channel support
Store initiator and target port ID's once per nexus instead of in each
channel data structure.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5354 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:22:19 +00:00
Bart Van Assche
ef2deeadae ib_srpt: Micro-optimize polling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5353 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:20:55 +00:00
Bart Van Assche
d7e06bba9f ib_srpt: Introduce a temporary variable in srpt_handle_new_iu()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5352 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:19:34 +00:00
Bart Van Assche
e61e0beae6 ib_srpt: Sync information unit memory only once
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5351 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:19:05 +00:00
Bart Van Assche
bfae911b39 ib_srpt: Micro-optimize SRP_CMD parsing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:18:38 +00:00
Bart Van Assche
91358f846c ib_srpt: Avoid that cmd_wait_list processing triggers command reordering
Although harmless for SCSI commands with SIMPLE ordering, avoid that commands
received before RTU can get reordered.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5349 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:18:06 +00:00
Bart Van Assche
f44bd8a7fa ib_srpt: Fix an error reported by the kerneldoc tool
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5348 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:17:04 +00:00
Bart Van Assche
aa726929fa ib_srpt: Handle GID change events properly
The mlx4_core driver generates a GID change event after a port has been
changed from IB into Ethernet mode. Avoid that this causes the following
error message to appear in the system log:
    
ib_srpt: ***ERROR***: received unrecognized IB event 18


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5346 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:15:54 +00:00
Bart Van Assche
f213e944cf ib_srpt: Micro-optimize I/O context state manipulation
All ioctx->state manipulations are serialized per command so it is
not necessary to use locking to protect these manipulations.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5345 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:14:45 +00:00
Bart Van Assche
e16e4beb3b ib_srpt: Simplify srpt_handle_cmd()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:13:50 +00:00
Bart Van Assche
c43bf7e435 ib_srpt: Avoid that session logout hangs sporadically
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5339 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-18 15:35:13 +00:00
Bart Van Assche
59f48c1f33 ib_srpt: Avoid that disabling a target triggers a race condition
Avoid that disabling a target triggers a race condition with
SRP relogin. At least in theory this race condition could result
in a kernel crash.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5268 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-06 14:17:49 +00:00
Vladislav Bolkhovitin
00851a7501 Merge of adding iSER web page and copyright updates from the iSER branch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Bart Van Assche
08623d3115 ib_srpt: Clarify a log message
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5225 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-27 19:01:24 +00:00
Bart Van Assche
a0bc415649 ib_srpt, ib_srpt.h: Fix kernel-doc warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5186 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-07 14:26:25 +00:00
Bart Van Assche
f239f4d071 ib_srpt: procfs build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5123 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-19 08:14:08 +00:00
Bart Van Assche
5475aa9a47 ib_srpt: Correct context passed to scst_rx_mgmt_fn_*()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5120 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-18 14:55:48 +00:00
Bart Van Assche
6d2efd72fd ib_srpt: Add per-target "device" attribute
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5119 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-18 13:06:55 +00:00
Bart Van Assche
107b228f15 ib_srpt: Move the srpt_close_session() source code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5116 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-18 12:53:02 +00:00
Bart Van Assche
47c7997c11 ib_srpt: Log an info message instead of an error message if a target is not enabled
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5115 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-18 12:41:33 +00:00
Bart Van Assche
08f3caecaa ib_srpt: Log an info message instead of an error message if a target is not enabled
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5114 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-18 12:40:59 +00:00
Bart Van Assche
cdf784a6ad ib_srpt: Simplify the code for waking up the srpt thread after login
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5054 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 12:53:59 +00:00
Bart Van Assche
858d02e558 [PATCH] ib_srpt: Always set RSPVALID flag in task management replies
The SRP spec requires not only to set the RSPVALID flag and the RSP_CODE
field if a task management function failed but also if it succeeded. This
patch avoids that the SRP initiator interprets task managment functions
that succeeded as failed.

Reported-by: Jack Wang <jinpu.wang@profitbricks.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5002 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-27 13:40:58 +00:00
Bart Van Assche
47c84d3ec8 ib_srpt: Build fix for r4984
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4992 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-09 05:46:22 +00:00
Bart Van Assche
08bfd4c19a ib_srpt: Rework r4984 (skip Ethernet ports)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4991 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-08 10:20:54 +00:00
Bart Van Assche
523e2b3e59 ib_srpt: Skip Ethernet ports
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4984 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-02 07:31:12 +00:00
Bart Van Assche
85e9255f37 ib_srpt: Add P_Key support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4980 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-27 06:39:45 +00:00
Bart Van Assche
9642081700 ib_srpt: Clean up srpt_handle_send_comp()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4979 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-27 06:36:52 +00:00
Bart Van Assche
70017e3883 ib_srpt: Remove two statements that became superfluous from srpt_abort_cmd()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4978 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-27 06:35:39 +00:00
Bart Van Assche
8b0230b152 ib_srpt: Introduce srpt_init_tgt()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4925 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-29 07:08:14 +00:00
Vladislav Bolkhovitin
6e31fd8306 Relax and cleanup HARDWARE ERROR sense usage
HARDWARE ERROR sense is very strong considered be "internal failure", so
might lead to serios initiator side issues up to disconnect from device. In
many cases WRITE or READ ERROR sense can be used instead. All remaining
usages must be logged.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4911 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-04 02:46:49 +00:00
Vladislav Bolkhovitin
2093dd7561 Make it possible to forcibly close SRP and FC sessions via sysfs
That patch contains the following changes:
* Move the code for creating a "close_sess" sysfs attribute from iscsi-scst to
  the SCST core such that it becomes available for other target drivers. This
  does not change the functionality of iscsi-scst.
* Add code in ib_srpt and qla2x00t to allow a session to be forcibly closed from
  user space.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>




git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-18 00:52:46 +00:00