Commit Graph

544 Commits

Author SHA1 Message Date
Bart Van Assche
d8da2ff95d ib_srpt: Speed up kernel driver unloading after a cable pull (merge r5727 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5921 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-05 10:57:03 +00:00
Bart Van Assche
941e51b727 ib_srpt: Version 3.0.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5768 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-04 12:45:59 +00:00
Bart Van Assche
d15786cd33 ib_srpt: Kernel 3.17 build fix (merge r5725 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5749 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-03 09:19:07 +00:00
Bart Van Assche
1c4fb8e1e6 ib_srpt: Set SCSI residual fields in SRP_CMD reply (merge r5622 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5635 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-29 05:24:11 +00:00
Bart Van Assche
37ef0a30ee ib_srpt: Merge from trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5599 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 06:59:13 +00:00
Bart Van Assche
68489e57f9 ib_srpt: Merge build and login fixes from trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5580 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 14:33:30 +00:00
Vladislav Bolkhovitin
f7bd8e034b Merged revisions 5543,5545 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk

........
  r5543 | bvassche | 2014-05-23 00:33:53 -0700 (Fri, 23 May 2014) | 1 line
  
  RHEL 7 build fixes
........
  r5545 | bvassche | 2014-05-23 01:36:36 -0700 (Fri, 23 May 2014) | 1 line
  
  scripts/rebuild-rhel-kernel-rpm: Add RHEL 7 RC support
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-04 03:12:05 +00:00
Bart Van Assche
909abff111 ib_srpt: Source code comment spelling fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-12 15:56:45 +00:00
Bart Van Assche
d3d094d160 ib_srpt: Fix two recently introduced checkpatch complaints about whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-30 05:30:45 +00:00
Bart Van Assche
424b231e96 ib_srpt: Make LUN masking work again
This patch fixes a regression that was introduced in r5493.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5495 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-29 12:39:50 +00:00
Bart Van Assche
6cbe580d89 ib_srpt: Unload properly with RDMA/CM disabled
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5474 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-24 18:43:41 +00:00
Bart Van Assche
eae0318512 ib_srpt: Make srpt_disconnect_ch() close sessions properly that have not yet reached the connected state
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-24 11:11:26 +00:00
Bart Van Assche
a4a01d6675 ib_srpt: OFED 3.12 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5470 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-24 10:37:58 +00:00
Bart Van Assche
54a84dff08 ib_srpt: Clean up the CM event handling messages (part 3)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5462 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-23 13:38:54 +00:00
Bart Van Assche
4181477639 ib_srpt: RHEL 5.9 build fix (part 2)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5461 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-23 09:20:52 +00:00
Bart Van Assche
3f76f4e792 ib_srpt, RDMA/CM: Avoid hanging sessions due to a cable pull
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5460 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-23 09:04:15 +00:00
Bart Van Assche
05c8c1548c ib_srpt: Clean up the CM event handling code (part 2)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5459 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-23 09:02:29 +00:00
Bart Van Assche
8fd1252268 ib_srpt: Clean up the CM event handling code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5458 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-23 08:59:18 +00:00
Bart Van Assche
dafaa63ea0 ib_srpt: RHEL 5.9 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5457 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-23 08:57:17 +00:00
Bart Van Assche
c0d9aee18e ib_srpt: RHEL 6.5 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5447 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:44:48 +00:00
Bart Van Assche
fc18736ce4 ib_srpt: Build fix for kernel versions < 3.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5446 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:38:39 +00:00
Bart Van Assche
fa58faf95b ib_srpt: Add RDMA/CM support
Or in other words, add RoCE and iWARP support.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5445 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:22:30 +00:00
Bart Van Assche
c29fd6f34d ib_srpt: Move the code for checking the QP timeout
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5444 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:11:18 +00:00
Bart Van Assche
f234b9db8a ib_srpt: Use a mutex instead of a spinlock to protect the channel list
This is allowed because all CM callback functions are invoked from thread
context.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5443 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:10:47 +00:00
Bart Van Assche
97241d4e29 ib_srpt: Prepare RDMA/CM support
Move IB/CM members into a new struct. Report channel pointer instead of CM ID
pointer in diagnostic messages.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5442 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:09:33 +00:00
Bart Van Assche
ffb6115cb9 ib_srpt: Remove a superfluous check from the REQ handler
ib_send_cm_rep() checks the connection state before sending a response.
Hence checking ch->state before calling ib_send_cm_rep() is superfluous,
so remove that check and also the locking that is no longer needed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5441 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:08:00 +00:00
Bart Van Assche
4377509628 ib_srpt: Move IB/CM knowledge out of srpt_cm_req_recv()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5440 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 12:04:05 +00:00
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
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