Commit Graph

765 Commits

Author SHA1 Message Date
Bart Van Assche
747511e3b8 IB verbs compliance fix: drain the completion queues before destroying them.
Moved some thread=1 related functions in ib_srpt.c such that these are grouped in the source file.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1876 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-25 13:13:45 +00:00
Bart Van Assche
0925119ad8 Made sure that invocation of srpt_pending_cmd_timeout() after
srpt_handle_rdma_comp() finished and before srpt_xmit_response() started works
properly.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1875 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-25 09:34:20 +00:00
Bart Van Assche
1c64261bec Increased default send queue size from 2048 to 4096 and made the send queue
size configurable via the kernel module parameter srpt_sq_size.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1874 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-25 09:15:10 +00:00
Bart Van Assche
95bba60a0a Fixed a bug in the command abortion logic that could result rmmod ib_srpt to hang.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1873 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-24 16:47:29 +00:00
Bart Van Assche
ef509acbd8 Refined the timeout error message.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1872 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-24 11:46:29 +00:00
Bart Van Assche
dc80bce266 Fixed a race between initiator and target in the algorithm for computing the REQUEST LIMIT DELTA value sent in responses towards the initiator that could cause the initiators req_lim value temporarily to exceed 128 (SRPT_RQ_SIZE). While harmless, this caused messages like "ib_srpt: ***ERROR***: req_lim = -1 < 0" to appear in the target kernel log.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1871 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-24 08:35:28 +00:00
Bart Van Assche
a9d5ab6737 Added --group_reporting.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1870 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-23 13:41:59 +00:00
Bart Van Assche
06b4f6d8aa Increased SRP initiator lockup safety margin, fixed a sparse warning and added more comments.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1869 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-23 13:41:55 +00:00
Bart Van Assche
7322ff6c24 Added an additional test.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1868 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-23 12:25:54 +00:00
Bart Van Assche
c7472c2aa6 Made sure that ib_srp initiator cannot lock up even when its I/O depth > 1.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1867 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-23 12:23:39 +00:00
Bart Van Assche
baa4b4ee29 Fixed a bug that caused trouble while handling send completions for failed data transfer commands. An example of the call stack that could be logged:
WARNING: at srpt/src/ib_srpt.c:2908 srpt_unmap_sg_to_ib_sge+0xcb/0x13e [ib_srpt]()
[ ... ]
Call Trace:
 <IRQ>  [<ffffffffa0317827>] ? srpt_unmap_sg_to_ib_sge+0xcb/0x13e [ib_srpt]
 [<ffffffff8023885a>] ? warn_slowpath_common+0x77/0x8e
 [<ffffffffa0317827>] ? srpt_unmap_sg_to_ib_sge+0xcb/0x13e [ib_srpt]
 [<ffffffffa03178f1>] ? srpt_handle_send_comp+0x57/0x7d [ib_srpt]
 [<ffffffffa0319c18>] ? srpt_send_completion+0x82/0xca [ib_srpt]
 [<ffffffffa024f646>] ? mlx4_cq_completion+0x21/0x62 [mlx4_core]
 [<ffffffffa025051e>] ? mlx4_eq_int+0x55/0x2a4 [mlx4_core]
 [<ffffffffa025077c>] ? mlx4_msi_x_interrupt+0xf/0x17 [mlx4_core]
 [<ffffffff8023cff6>] ? tasklet_action+0x64/0xb5
 [<ffffffff802675f9>] ? handle_IRQ_event+0x53/0x105
 [<ffffffff802690ac>] ? handle_edge_irq+0xda/0x11a
 [<ffffffff8020db65>] ? handle_irq+0x81/0x8a
 [<ffffffff8020d399>] ? do_IRQ+0x57/0xbf
 [<ffffffff8020c2d3>] ? ret_from_intr+0x0/0xa
 <EOI>  [<ffffffff80211ca6>] ? mwait_idle+0xa3/0xd1
 [<ffffffff8051ac1a>] ? notifier_call_chain+0x29/0x4c
 [<ffffffff8020aa61>] ? cpu_idle+0x40/0x5e
---[ end trace fef4d0c17ebda700 ]---
------------[ cut here ]------------
kernel BUG at /usr/src/redhat/BUILD/kernel-2.6.30.10/arch/x86/include/asm/dma-mapping.h:104!
invalid opcode: 0000 [#1] SMP
[ ... ]

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1866 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-23 07:38:15 +00:00
Bart Van Assche
380d63a33e Updated performance measurements.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1858 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-22 08:32:50 +00:00
Bart Van Assche
34bab4bc58 Micro-optimized the IB completion handlers for modes thread=0 and thread=2.
Fixed another session unregistration race.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1857 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-22 07:43:17 +00:00
Bart Van Assche
a8d02fbfca Enabled rdy_to_xfer_atomic for mode thread=0.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1855 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-22 05:54:55 +00:00
Bart Van Assche
b5c0a25514 Module removal and session unregistration with ongoing I/O should now finally work reliably.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1849 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-21 14:22:34 +00:00
Bart Van Assche
5ded0b7660 Changes:
- Implemented a workaround for a race between ib_destroy_cq() and the IB
  completion handlers. This race could trigger a kernel crash or kernel lockup
  when unloading the ib_srpt module while I/O was ongoing or by performing
  a relogin from an SRP initiator while I/O was ongoing.
- Moved the code for handling IB completions in single-threaded mode to
  separate functions.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1848 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-21 10:52:36 +00:00
Bart Van Assche
0e6414624e Follow-up for r1845.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1846 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-20 19:44:39 +00:00
Bart Van Assche
a9668c9f07 Micro-optimized srpt_handle_rdma_comp().
Assigned names to the three threading modes.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1845 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-20 18:40:29 +00:00
Bart Van Assche
7cca01ae41 Added one more test.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1842 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-18 17:43:44 +00:00
Bart Van Assche
2d3b5d3387 Partially reverted r1416 in order to fix a data corruption issue that occurred
with highly parallel workloads.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1841 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-18 17:39:43 +00:00
Bart Van Assche
5d78905aaf Whitespace-only changes: converted spaces to tabs.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1840 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 20:17:45 +00:00
Bart Van Assche
3b69f969f1 Under heavily multithreaded I/O (twenty or more concurrent writers), data corruption could occur. This issue was introduced in r1506 and has now been fixed.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1839 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 19:50:45 +00:00
Bart Van Assche
78cb9e9458 Changed meaning of thread kernel module parameter: while 0 still stands for IRQ context, 1 does now stand for single-threaded processing and 2 for processing SCSI command via multiple kernel threads.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1838 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-17 19:21:22 +00:00
Bart Van Assche
402306e3e0 Relaxed send-queue-full error handling.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1826 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-14 18:37:42 +00:00
Bart Van Assche
7a0a6fb86e Made srpt_srq_size configurable as a kernel module parameter.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1825 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-14 18:28:09 +00:00
Bart Van Assche
fe81f9766c Changed two PRINT_INFO() messages that reported that the send queue was full into PRINT_ERROR() messages, and renamed a few variables.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1824 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-14 17:22:52 +00:00
Bart Van Assche
e7c082ac23 Implemented several source code refinements that do not affect functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1819 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-13 18:36:08 +00:00
Bart Van Assche
47a5c6072c Fixed a bug in the command abortion code. E.g. the following kernel message could be generated when unloading ib_srpt while I/O was ongoing:
------------[ cut here ]------------
WARNING: at /home/bart/software/scst/srpt/src/ib_srpt.c:1063 srpt_reset_ioctx+0x15b/0x170 [ib_srpt]()
Hardware name: P5Q DELUXE
Modules linked in: [ ... ]
Pid: 20709, comm: disk011_4 Tainted: G        W  2.6.34-scst #1
Call Trace:
 [<ffffffff81048dbb>] warn_slowpath_common+0x7b/0xc0
 [<ffffffff81048e14>] warn_slowpath_null+0x14/0x20
 [<ffffffffa050772b>] srpt_reset_ioctx+0x15b/0x170 [ib_srpt]
 [<ffffffff81048dcf>] ? warn_slowpath_common+0x8f/0xc0
 [<ffffffffa0507773>] srpt_on_free_cmd+0x33/0x60 [ib_srpt]
 [<ffffffffa0480a0b>] scst_free_cmd+0xab/0x460 [scst]
 [<ffffffffa046dd38>] scst_finish_cmd+0x178/0x300 [scst]
 [<ffffffffa0470ed4>] scst_process_active_cmd+0x134/0x640 [scst]
 [<ffffffffa0471dac>] scst_process_redirect_cmd+0x2bc/0x3f0 [scst]
 [<ffffffffa047247a>] scst_tgt_cmd_done+0x6a/0x100 [scst]
 [<ffffffffa0508dec>] srpt_xmit_response+0x11c/0x210 [ib_srpt]
 [<ffffffffa046b53c>] scst_xmit_response+0x13c/0x560 [scst]
 [<ffffffffa0470efb>] scst_process_active_cmd+0x15b/0x640 [scst]
 [<ffffffffa047149d>] scst_do_job_active+0xbd/0x180 [scst]
 [<ffffffffa0471806>] scst_cmd_thread+0x1c6/0x4b0 [scst]
 [<ffffffff8103e960>] ? default_wake_function+0x0/0x20
 [<ffffffffa0471640>] ? scst_cmd_thread+0x0/0x4b0 [scst]
 [<ffffffff810683e6>] kthread+0x96/0xa0
 [<ffffffff81003d94>] kernel_thread_helper+0x4/0x10
 [<ffffffff8103dcb1>] ? finish_task_switch+0x51/0xb0
 [<ffffffff81344dac>] ? _raw_spin_unlock_irq+0x1c/0x40
 [<ffffffff813458ad>] ? restore_args+0x0/0x30
 [<ffffffff81068350>] ? kthread+0x0/0xa0
 [<ffffffff81003d90>] ? kernel_thread_helper+0x0/0x10
---[ end trace 84b1e00ea2ac6651 ]---


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1812 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-10 18:27:59 +00:00
Bart Van Assche
008841b622 Minor optimization: merged a srpt_get_cmd_state() and srpt_set_cmd_state() call.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1811 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-10 07:17:30 +00:00
Bart Van Assche
66ccc6d619 Reverted r1806 and fixed a race condition that could cause data corruption.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1808 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-09 18:12:24 +00:00
Bart Van Assche
45bbbbba5f Improved I/O stress test.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1807 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-09 18:04:23 +00:00
Bart Van Assche
cdd65273e9 Applied a temporary fix for data corruption that could occur when multiple initiators were accessing data on a multicore target system.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1806 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-08 18:29:52 +00:00
Bart Van Assche
2e07133917 Converted a WARN_ON() statement into PRINT_INFO().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1802 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-04 20:11:47 +00:00
Bart Van Assche
936f080310 Fixed a race condition that could cause SRP commands to be processed out of
order on a multicore system. Also, split send and receive completion queues
such that the amount of code that is executed under spinlock and with IRQs
disabled is minimal.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1801 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-04 19:44:33 +00:00
Bart Van Assche
4438a65592 Fixed grammar in a source code comment.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1800 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-30 18:54:29 +00:00
Bart Van Assche
3375930bad Cleanup.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1797 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-28 19:03:40 +00:00
Bart Van Assche
58e0bbd491 Whitespace-only changes for checkpatch.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1796 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-28 18:35:38 +00:00
Bart Van Assche
2e0703275d SRPT with thread=0 works again (was broken by r1714, the merge of the persistent reservation branch to the trunk).
Added more consistency checks.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1795 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-28 18:23:28 +00:00
Bart Van Assche
c7369b432b Micro-optimized srpt_completion().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1792 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-26 10:42:06 +00:00
Bart Van Assche
e730fac09d Fixed sparse warnings.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1779 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-18 19:29:19 +00:00
Bart Van Assche
d3a2a54d48 Made sure endianness of ch->max_ti_iu_len is correct. The previous
implementation could result in e.g. the following message in /var/log/messages:

       ib_srpt: Received SRP_LOGIN_REQ with i_port_id 0x200b000453000581:0x4538330005811, t_port_id 0x66a00980074b8:0x66a00980074b8 and it_iu_len 996 on port 1 (guid=0xfe80000000000000:0x66a00a00074b8)
       ...
       ib_srpt: ***WARNING***: truncated sense data from 18 to -469565476 bytes

This patch was submitted by Chas Williams.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1777 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-17 16:33:37 +00:00
Bart Van Assche
165bcc0f64 Use tabs instead of spaces for indentation.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1748 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-06 07:09:39 +00:00
Bart Van Assche
7268591baf Added support for persistent reservations.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1747 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-05 18:29:57 +00:00
Bart Van Assche
dd303b6198 Added to repository.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1724 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-30 07:50:09 +00:00
Bart Van Assche
fdbc99557e Fixed build breakage caused by r1714.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1715 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-26 18:16:26 +00:00
Vladislav Bolkhovitin
b53e4cb4c1 Merge of the pr branch with additional fixes for problems found during extra testing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1714 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-26 17:46:46 +00:00
Bart Van Assche
ca2c97f7ba Fixed checkpatch warnings about long lines.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1708 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-22 08:25:25 +00:00
Bart Van Assche
c5a981ff61 Refined a comment.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1675 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-02 10:09:50 +00:00
Bart Van Assche
b19930753a Added sysfs support.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1674 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-02 08:15:29 +00:00
Bart Van Assche
87fb70f624 OFED version number update.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1664 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-29 06:35:35 +00:00