Commit Graph

661 Commits

Author SHA1 Message Date
Bart Van Assche
f589744f58 ib_srpt: Remove a superfluous assignment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5427 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-16 09:14:31 +00:00
Bart Van Assche
4acf8e249f ib_srpt: Cache P_Key lookups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5426 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-16 08:23:11 +00:00
Bart Van Assche
5b7e52b654 ib_srpt: Clean up the code that prints the dgid during login
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5425 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-16 08:08:50 +00:00
Bart Van Assche
8c8c9534ee ib_srpt: Constify two arguments of srpt_get_nexus()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5424 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-16 08:01:58 +00:00
Bart Van Assche
3f59c15917 ib_srpt: Disable RDMA access by the initiator
With the SRP protocol all RDMA operations are initiated by the target.
Since no RDMA operations are initiated by the initiator, do not grant
the initiator permission to submit RDMA reads or writes to the target.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5423 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-16 07:30:34 +00:00
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
3c5a901bf0 srpt/Makefile: Avoid that the build process depends on source control tools
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5361 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-21 16:29:26 +00:00
Bart Van Assche
46b583a918 srpt/session-management.txt: Document how sessions are managed by the ib_srpt driver
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5358 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:26:48 +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
ecc0a4a25d ib_srpt/Makefile: Add kerneldoc target
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5347 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:16:27 +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
bcc5cefce8 srpt: Minor buid process terminology change
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5338 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-16 13:38:50 +00:00
Bart Van Assche
69d5b979eb Makefiles: 'uninstall' target fixes
Some components don't have 'uninstall' targets although the top-level
Makefile references them. Some others don't remove the proper file.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-18 08:41:30 +00:00
Bart Van Assche
7d89372c53 Makefiles: respect DESTDIR when specified
Not all SCST components handle DESTDIR properly, or at all.

In particular:
* INSTALL_MOD_PATH should account for DESTDIR when 'make modules_install'
  is invoked, so the kernel make infrastructure deploys the modules
  and runs depmod against the proper directory tree.
* depmods must include a '-b' option to reference the proper directory tree.
* Drop special ISCSI_DESTDIR.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5289 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-18 08:40:36 +00:00
Bart Van Assche
79b8ce942e Makefiles: calculate KVER properly
When deriving the kernel version (KVER) from KDIR, the file
$(KDIR)/include/config/kernel.release should be preferred over
'make kernelversion'.

For example, the Ubuntu 3.2.0-23-generic kernel has a kernel.release
file containing '3.2.0-23-generic', but 'make kernelversion' returns
3.2.14. Since the modules are stored under /lib/modules/3.2.0-23-generic,
the value in kernel.release is the correct one to use.
    
Also:
- Evaluate KVER only once
- All depmod commands must include KVER
    
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
[bvanassche: Split long lines / removed trailing whitespace]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5286 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-14 15:52:10 +00:00
Bart Van Assche
c33cf3f81b Makefiles: Convert from "install" to "make modules_install"
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5284 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-14 13:48:54 +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
Bart Van Assche
7f1c22cbee nightly build: Add kernel 3.13 build infrastructure
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5251 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 09:16:27 +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
3fe1a7f5d4 ib_srpt, README: Document how to detect excessive packet loss
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5185 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-07 14:13:49 +00:00
Bart Van Assche
f5a8248cb7 nightly build: Add kernel 3.12 build infrastructure
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5164 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-19 08:07:15 +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