Commit Graph

633 Commits

Author SHA1 Message Date
Bart Van Assche
e7603fc7a7 ib_srpt: Start with comp_vector 0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6901 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-06-09 22:18:10 +00:00
Bart Van Assche
da83a4a9a4 ib_srpt: Serialize sport->port_id accesses
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6900 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-06-09 21:39:45 +00:00
Bart Van Assche
0d3c65105a ib_srpt: Remove a duplicate comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6899 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-06-09 21:39:15 +00:00
Bart Van Assche
a6f0551eef ib_srpt: Introduce srpt_init_sport()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6898 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-06-09 21:14:29 +00:00
Bart Van Assche
1b8ba2f3cb ib_srpt: Add link_layer and port_id sysfs attributes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6897 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-06-09 21:03:34 +00:00
Bart Van Assche
0556c29fdd ib_srpt: Port to Linux kernel v4.7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6896 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-06-08 21:19:24 +00:00
Bart Van Assche
b109098efe ib_srpt: Fix checkpatch complaints about missing spaces
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6842 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-27 15:52:41 +00:00
Bart Van Assche
8695583ee9 ib_srpt: Reduce CPU load caused by stopping a large number of sessions
Avoid that stopping a large number of SRPT sessions causes a high
context switch frequency and hence a high CPU load.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6840 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-24 17:15:23 +00:00
Bart Van Assche
63768c8715 ib_srpt: Fix a debug message
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6839 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-24 17:14:49 +00:00
Bart Van Assche
af8f462071 ib_srpt: Revert r6822
Revision 6822 triggers a race condition, hence revert it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6831 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-18 17:00:39 +00:00
Bart Van Assche
69471744d8 ib_srpt: Reduce command processing latency
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6822 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-03-02 19:56:41 +00:00
Bart Van Assche
337b7e372e ib_srpt: Port to Linux kernel v4.5
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6797 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-02-16 19:35:02 +00:00
Vladislav Bolkhovitin
fa2f54ac9e Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6787 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-22 04:04:43 +00:00
Bart Van Assche
76b1344cd3 ib_srpt: Fix in-tree build for kernel v4.4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6780 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-19 18:08:36 +00:00
Bart Van Assche
53a9829a45 ib_srpt: Fix a runtime warning
Avoid that the following warning is reported:
    
WARNING: CPU: 7 PID: 32692 at kernel/sched/core.c:7533 __might_sleep+0x82/0x90()
do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffa08f5f0b>]
 srpt_compl_thread+0xab/0x1c0 [ib_srpt]
Call Trace:
 [<ffffffff81251afb>] dump_stack+0x4f/0x74
 [<ffffffff810574cb>] warn_slowpath_common+0x8b/0xd0
 [<ffffffff810575b1>] warn_slowpath_fmt+0x41/0x70
 [<ffffffff810804c2>] __might_sleep+0x82/0x90
 [<ffffffff81113f74>] mempool_alloc+0x94/0x180
 [<ffffffffa04ff80c>] scst_alloc_mgmt_cmd+0x4c/0x120 [scst]
 [<ffffffffa04dc1e4>] scst_pre_rx_mgmt_cmd+0x84/0x1e0 [scst]
 [<ffffffffa04dc6ea>] scst_rx_mgmt_fn+0x8a/0x3e0 [scst]
 [<ffffffffa08f53fe>] scst_rx_mgmt_fn_lun+0x6e/0x90 [ib_srpt]
 [<ffffffffa08f55e1>] srpt_handle_tsk_mgmt+0x1c1/0x2f0 [ib_srpt]
 [<ffffffffa08f58d0>] srpt_handle_new_iu+0x1c0/0x230 [ib_srpt]
 [<ffffffffa08f5cd9>] srpt_process_rcv_completion+0x89/0xd0 [ib_srpt]
 [<ffffffffa08f5d74>] srpt_process_one_compl+0x54/0x70 [ib_srpt]
 [<ffffffffa08f5df9>] srpt_poll+0x69/0x90 [ib_srpt]
 [<ffffffffa08f5e3e>] srpt_process_completion+0x1e/0x40 [ib_srpt]
 [<ffffffffa08f5f3c>] srpt_compl_thread+0xdc/0x1c0 [ib_srpt]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6727 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-12-11 01:40:41 +00:00
Bart Van Assche
8aae2413b3 ib_srpt: Convert srpt_ch_list_empty() to RCU
This patch avoids that the following warning is reported when
unloading the ib_srpt kernel module:
    
WARNING: CPU: 9 PID: 33739 at kernel/sched/core.c:7533 __might_sleep+0x82/0x90()
do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff81098b73>] prepare_to_wait_event+0x63/0x110
Call Trace:
 [<ffffffff81251afb>] dump_stack+0x4f/0x74
 [<ffffffff810574cb>] warn_slowpath_common+0x8b/0xd0
 [<ffffffff810575b1>] warn_slowpath_fmt+0x41/0x70
 [<ffffffff810804c2>] __might_sleep+0x82/0x90
 [<ffffffff815186e3>] mutex_lock_nested+0x33/0x380
 [<ffffffffa08eeb7b>] srpt_ch_list_empty+0x2b/0x80 [ib_srpt]
 [<ffffffffa08f000c>] srpt_release_sport+0xcc/0x2a0 [ib_srpt]
 [<ffffffffa08f0215>] srpt_release+0x35/0x80 [ib_srpt]
 [<ffffffffa04d8650>] scst_unregister_target+0x70/0x380 [scst]
 [<ffffffffa08f26c1>] srpt_remove_one+0xb1/0x150 [ib_srpt]
 [<ffffffffa0145a35>] ib_unregister_client+0xe5/0x190 [ib_core]
 [<ffffffffa08f6485>] srpt_cleanup_module+0x21/0x2f [ib_srpt]
 [<ffffffff810dfbfb>] SyS_delete_module+0x17b/0x1c0
 [<ffffffff8151b517>] entry_SYSCALL_64_fastpath+0x12/0x6f


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6726 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-12-11 01:39:46 +00:00
Bart Van Assche
098f6bd1c5 ib_srpt: Kernel v4.4 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6698 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-18 22:10:54 +00:00
Bart Van Assche
948482551c ib_srpt: Follow-up for r6628
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6646 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-10 01:55:23 +00:00
Bart Van Assche
37c4911d4f ib_srpt: Use kmalloc_array() instead of kmalloc() with multiply
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6634 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-09 20:08:07 +00:00
Bart Van Assche
6a491c8cda ib_srpt: Avoid that checkpatch complains about using ENOSYS
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6628 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-09 19:09:44 +00:00
Bart Van Assche
8ac8060d69 ib_srpt: Place constants at the right-hand-side in comparisons
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-06 18:55:17 +00:00
Vladislav Bolkhovitin
5f7ac7f4bf Version updated to 3.2.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6593 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-06 06:17:17 +00:00
Bart Van Assche
711e3c54a5 ib_srpt: Remove one_target_per_port parameter completely
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-02 22:44:48 +00:00
Bart Van Assche
0acf6c0ec2 ib_srpt: Increase maximum sg-list length from 128 to 65536
This avoids that the following message appears in the target system
kernel log for SRP commands with a scatterlist with e.g. 256 elements:

Unable to complete command due to SG IO count limitation


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6546 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-15 22:08:47 +00:00
Bart Van Assche
4d9c05f1ee ib_srpt: Increase maximum sg-list length from 128 to 65536
This avoids that the following message appears in the target system
kernel log:
    
Unable to complete command due to SG IO count limitation


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6545 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-14 22:22:19 +00:00
Bart Van Assche
166c12eb49 ib_srpt: Account RDMA writes into sq_wr_avail
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6544 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-14 22:21:47 +00:00
Bart Van Assche
fd6e33756c ib_srpt: Fix error handling in srpt_xmit_response()
This patch fixes a regression introduced in patch "ib_srpt: Convert
srpt_xfer_data() return value" (trunk r6103).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-14 22:21:26 +00:00
Bart Van Assche
b7f49e8afc ib_srpt: Fix a diagnostic message
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6542 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-14 22:19:12 +00:00
Bart Van Assche
cd346f8c64 ib_srpt: Remove dead code
This is a follow-up for patch "ib_srpt: Micro-optimize SCSI command
processing" (trunk r4784).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6541 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-14 22:18:47 +00:00
Bart Van Assche
3438e73474 ib_srpt: Fix grammar in a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6540 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-10-14 22:15:27 +00:00
Bart Van Assche
17f1770fab ib_srpt: Port to Linux kernel v4.3.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-09-29 00:06:08 +00:00
Bart Van Assche
cba8f3ab7e ib_srpt: Build fix for the nightly build against kernel v4.2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6507 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-09-16 16:43:32 +00:00
Bart Van Assche
ed07ec49a8 ib_srpt: Avoid that relogin triggers a large number of FLUSH ERR messages
Reported-by: Grant Albitz <Grant@schultztechnology.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-09-10 16:31:31 +00:00
Bart Van Assche
68ce2d0ce4 ib_srpt: Port to MOFED 3.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6497 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-09-08 16:18:27 +00:00
Bart Van Assche
0651bc1e4e ib_srpt: Linux kernel v4.2 ib_create_cq() build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6426 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-14 23:49:48 +00:00
Bart Van Assche
5f95edc612 ib_srpt: Test whether ib_create_send_mad() needs a base_version argument
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6424 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-14 23:24:26 +00:00
Bart Van Assche
87b6fde56d ib_srpt: Linux kernel v4.2 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6423 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-14 22:50:25 +00:00
Bart Van Assche
44542c9752 ib_srpt: Follow-up for r6410
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6411 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-09 19:11:04 +00:00
Bart Van Assche
b448c6edf4 ib_srpt: Add support for systems with more than 64 CPU's
Avoid that the following warning is reported on systems with more
than 64 CPU's:

WARNING: CPU: 0 PID: 4762 at drivers/scst/srpt/ib_srpt.c:4179 init_module+0x1d8f42/0x1db887 [ib_srpt]()
Call Trace:
 [<ffffffff8154f2ed>] dump_stack+0x46/0x58
 [<ffffffff8104b4ec>] warn_slowpath_common+0x8c/0xc0
 [<ffffffff8104b53a>] warn_slowpath_null+0x1a/0x20
 [<ffffffffa0236f42>] init_module+0x1d8f42/0x1db887 [ib_srpt]
 [<ffffffffa0233000>] ? 0xffffffffa0233000
 [<ffffffffa005e000>] ? 0xffffffffa005e000
 [<ffffffffa015d587>] ib_register_client+0x87/0xc0 [ib_core]
 [<ffffffffa005e0ef>] init_module+0xef/0x1000 [ib_srpt]
 [<ffffffffa005e000>] ? 0xffffffffa005e000
 [<ffffffff810002bc>] do_one_initcall+0x8c/0x1c0
 [<ffffffff81149022>] ? __vunmap+0xc2/0x110
 [<ffffffff810bb3e3>] load_module+0x1b03/0x22a0
 [<ffffffff810b7e80>] ? show_initstate+0x60/0x60
 [<ffffffff810bbcce>] SyS_finit_module+0x8e/0x90
 [<ffffffff81555a32>] system_call_fastpath+0x12/0x17

Reported-by: Jack Wang <xjtuwjp@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6410 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-08 18:23:24 +00:00
Bart Van Assche
9bfdc312d3 ib_srpt: RHEL 5 build fix
Make the ib_srpt driver build again on RHEL 5 systems. See also
r6138.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6334 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 20:15:12 +00:00
Bart Van Assche
550ab7c1d3 ib_srpt: RHEL 7.1 build fix
With the RHEL 7.0 kernel ib_register_mad_agent() takes eight
arguments. With the RHEL 7.1 kernel the same function takes nine
arguments. Detect at build time how many arguments this function
takes.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6331 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 20:12:28 +00:00
Bart Van Assche
020ec68ddc ib_srpt: Change default behavior from using SRQ to not using SRQ
Although the non-SRQ mode needs more resources that mode has the
advantage that the end-to-end flow control mechanism is used.

From the IB spec:

C9-150.2.1: For QPs that are not associated with an SRQ, each HCA
receive queue shall generate end-to-end flow control credits. If
a QP is associated with an SRQ, the HCA receive queue shall not
generate end-to-end flow control credits.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6329 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 18:57:16 +00:00
Vladislav Bolkhovitin
906f4dfefb Merge t10-pi branch back
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6192 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-01 04:21:56 +00:00
Bart Van Assche
33a4bccc38 ib_srpt: Avoid that aborting a command triggers a race condition
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6181 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-10 05:39:44 +00:00
Bart Van Assche
98fb52432c ib_srpt: Specify a valid completion vector during completion queue creation
Avoid that SRP login can fail as follows:

kernel: ib_srpt: failed to create CQ: cqe 320; c.v. 17; ret -22


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6179 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-09 15:06:36 +00:00
Bart Van Assche
c32f79f6c1 Revert T10-PI support
The T10-PI patch (r6162) increases the time needed to run mkfs.ext4
over iSCSI from less than a second to several minutes. This is a
regression so revert the T10-PI patch until there is sufficient time
to find the root cause of this regression and to fix this regression.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6171 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-31 09:51:24 +00:00
Bart Van Assche
a3f4f28711 Build fixes - follow-up for r6162
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6164 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-29 17:32:59 +00:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Bart Van Assche
940faa9ad4 ib_srpt: Enable building against OFED headers without patching the build system
Additionally, include the OFED flavor name in the ib_srpt version number.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6138 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-02 14:28:25 +00:00
Bart Van Assche
ef48d260d2 ib_srpt: Suppress a compiler warning when building against Mellanox OFED
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6137 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-02 14:24:33 +00:00