Commit Graph

664 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
3bd81edc6e Version changed to 3.3.0-rc
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7227 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-09-01 03:57:09 +00:00
Bart Van Assche
bbaf688a0e ib_srpt: Build fix for kernels before v4.12
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7220 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-08-27 21:40:23 +00:00
Bart Van Assche
1e457529eb ib_srpt: Port to Linux kernel v4.12
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7218 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-08-27 15:40:59 +00:00
Bart Van Assche
b799130680 ib_srpt: Fix a logging statement
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7182 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-05-14 14:55:00 +00:00
Vladislav Bolkhovitin
68fa7e1a0d Copyright updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-22 03:19:52 +00:00
Bart Van Assche
9529f5e5b3 ib_srpt: Ensure that the BUG_ON() argument has no side effects
Reported-by: David Butterfield <dab21774@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7106 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-11 18:48:36 +00:00
Bart Van Assche
1bf5d439d6 scst: Coding style update related to the use of the keyword 'unsigned'
Use 'unsigned int' instead of 'unsigned' and 'unsigned long long'
instead of 'long long unsigned'.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7103 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-03-02 00:10:24 +00:00
Bart Van Assche
b51c624855 ib_srpt: Only report that SRQ creation failed if it was attempted to create an SRQ
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7089 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-01-08 21:46:20 +00:00
Bart Van Assche
3abcc849df ib_srpt: Destroy SRQ before freeing the buffers posted on the SRQ
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7088 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-01-08 21:45:39 +00:00
Bart Van Assche
db686530c9 ib_srpt: Rename a symbolic constant
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7087 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-01-08 21:10:54 +00:00
Bart Van Assche
c9b2dfa070 ib_srpt: Remove a local variable
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7086 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-01-08 21:10:32 +00:00
Bart Van Assche
db5426169b ib_srpt: Improve portability
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7082 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-27 20:23:31 +00:00
Bart Van Assche
122a343343 ib_srpt: Fix RHEL / CentOS 7.3 build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7063 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-17 12:46:51 +00:00
Bart Van Assche
3f9439a772 ib_srpt: Revert r7050
r7050 did not change any behavior so revert it. Note for myself: in the
ib_srpt driver the port number is set by the ib_modify_qp() call in
srpt_init_ch_qp().


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7061 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-17 12:33:45 +00:00
Bart Van Assche
3749ca972b ib_srpt: Create QP on the RDMA port the initiator logged in to
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7050 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-14 12:31:23 +00:00
Bart Van Assche
f09274f365 ib_srpt: Simplify a debug statement
It is likely that ib_device.dma_ops will be removed sooner or later.
Hence make sure that the ib_srpt driver does not depend on it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7049 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-07 23:52:41 +00:00
Bart Van Assche
dca84e290b ib_srpt: Only complain if immediate data has to be copied if CONFIG_SLUB_DEBUG=n
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7046 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-01 16:18:39 +00:00
Bart Van Assche
8c04ce53f4 ib_srpt: Port to Linux kernel v4.9
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7018 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-25 20:50:34 +00:00
Bart Van Assche
120c66f924 ib_srpt: Cache global L_Key
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7017 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-25 20:50:15 +00:00
Bart Van Assche
74a537dcfd ib_srpt: Enable S/G-list clustering
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7004 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-10 18:51:42 +00:00
Bart Van Assche
47183f2b16 ib_srpt: Fix a race condition in the initialization code
Initialize port information before registering the CM ID. One of
the functions called by the CM handler (srpt_cm_req_recv())
namely uses the SCST target pointer so that pointer must be
initialized before the CM ID is registered. This patch avoids that
SRP login during ib_srpt initialization sporadically triggers the
following bug:

ib_srpt: Rejecting login with reason 0x10001
BUG: unable to handle kernel NULL pointer dereference at 0000000000000100
IP: [<ffffffffa09f1ccf>] srpt_cm_req_recv+0xf3f/0xf60 [ib_srpt]
Call Trace:
 [<ffffffffa09f1dd5>] srpt_ib_cm_req_recv+0xe5/0x110 [ib_srpt]
 [<ffffffffa06c6fae>] cm_process_work+0x1e/0x130 [ib_cm]
 [<ffffffffa06c9ca8>] cm_req_handler+0x398/0x460 [ib_cm]
 [<ffffffffa06c9e25>] cm_work_handler+0xb5/0x208 [ib_cm]
 [<ffffffff8107d2fc>] process_one_work+0x16c/0x350
 [<ffffffff8108002a>] worker_thread+0x17a/0x410
 [<ffffffff810843f6>] kthread+0x96/0xa0
 [<ffffffff8146f364>] kernel_thread_helper+0x4/0x10



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7003 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-10 18:51:06 +00:00
Bart Van Assche
95979e90cf ib_srpt: Retry with a smaller send queue size if QP creation fails
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7001 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-10 18:10:13 +00:00
Bart Van Assche
9c466a504a ib_srpt: Rework QP failure reporting code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7000 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-10 18:09:51 +00:00
Bart Van Assche
c707a4fd2d ib_srpt: Use tabs instead of spaces to indent
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6998 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-10 18:09:12 +00:00
Bart Van Assche
6d9c43f821 ib_srpt: Reduce default value of srpt_sq_size
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
2016-08-28 16:27:43 +00:00
Bart Van Assche
558e064c20 ib_srpt: More MOFED 3.3 fixes for kernel versions >= 4.6.0
This is a slightly modified version of a patch from
Israel Rukshin <israelr@mellanox.com>.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6978 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-23 15:43:25 +00:00
Bart Van Assche
c02fcc5ba3 ib_srpt: Change unsigned into unsigned int
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6976 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-22 17:05:46 +00:00
Bart Van Assche
d2dd61c072 isert-scst, srpt: Fix build on systems with kernel >= 4.2.0 + MOFED 3.3
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6973 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-22 04:28:52 +00:00
Bart Van Assche
f221a515e2 ib_srpt: Address a checkpatch complaint about a missing space
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6970 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-21 22:59:16 +00:00
Bart Van Assche
89e278e2d6 ib_srpt: Remove trailing whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6969 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-21 22:58:45 +00:00
Vladislav Bolkhovitin
69863eb497 Increase version to 3.3
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6927 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-03 02:32:17 +00:00
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