Commit Graph

222 Commits

Author SHA1 Message Date
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
Bart Van Assche
bb20653c37 Updated OFED version numbers.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1653 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-24 14:25:31 +00:00
Bart Van Assche
38575b3d34 RHEL 5 / CentOS 5 bug fix: the argument of flush_workqueue() is a workqueue
pointer, not a struct work pointer.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1581 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-04 11:55:37 +00:00
Bart Van Assche
4aadb84528 Added timeout handling for IB completions, in case it would ever happen
that a HCA does not send an IB completion for an RDMA operation or IB send.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1579 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-02 16:38:15 +00:00
Bart Van Assche
2e6b0aef42 Changes:
- Fixed a rare lockup triggered by module removal while I/O was ongoing.
- Made sure that IB cable removal works fine.
- Exported srpt_service_guid via sysfs.
- Made sure that ib_srpt.c compiles fine with #undef CONFIG_SCST_PROC.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1575 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-31 18:04:23 +00:00
Bart Van Assche
f2b01c8595 Converted function, enum and struct documentation to kernel-doc style.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-27 10:40:13 +00:00
Vladislav Bolkhovitin
cbaab260f1 Add new scst_cmd_get_queue_type()/scst_cmd_set_queue_type() accessors and use them in target drivers instead of direct access to SCST's cmd->queue_type.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1553 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-17 19:11:18 +00:00
Bart Van Assche
b05d967c8a Clarified a source code comment.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-15 19:25:29 +00:00
Bart Van Assche
e56b672502 Updated error messages -- req_lim < 0 is not an internal error but can be caused by a buggy initiator.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1532 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-03 19:36:05 +00:00
Bart Van Assche
a32e120e21 Added missing space in an error message.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1531 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-03 19:29:37 +00:00
Bart Van Assche
2d4d49f304 Fixed two WARN_ON() statements.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1512 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-19 12:03:48 +00:00
Bart Van Assche
c519012fb2 Factored out channel unregistration code into a new function srpt_unregister_channel().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1508 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-14 12:51:14 +00:00
Bart Van Assche
4f7e597345 Fixed a memory leak in an error path.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1507 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-14 12:11:54 +00:00
Bart Van Assche
40869e57d1 Moved srpt_unmap_sg_to_ib_sge(ch, ioctx) call back into srpt_abort_scst_cmd().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1506 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-14 12:08:47 +00:00
Bart Van Assche
add3508a0c Changes:
- Fixed race condition between SCST session registration and IB channel event
  handler in srpt_add_one(): at least in theory it was possible that 
  sdev->scst_tgt was accessed before being initialized properly.
- A kernel WARN_ON() is no longer triggered when a DREQ has been received after
  SCST session deregistration started.
- Made sure that srpt_unmap_sg_to_ib_sge() does not call ib_dma_unmap_sg()
  twice.
- Moved srpt_unmap_sg_to_ib_sge() call out of srpt_reset_ioctx() and
  srpt_abort_scst_cmd() into the callers of these functions.
- Renamed some of the SRPT command states.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1505 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-14 11:36:34 +00:00
Bart Van Assche
cedf31579e Removed handling of AESOLNT, CRSOLNT and LOSOLNT flags again.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1504 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-12 19:42:00 +00:00
Bart Van Assche
26866a1e28 Simplified implementation of the thread=1 mode.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-12 19:37:43 +00:00
Bart Van Assche
8981044fb8 Updated test instructions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1502 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-12 19:30:08 +00:00
Bart Van Assche
492e570df0 Made ib_srpt easier to build on a multiboot system where multiple kernels
have been installed -- one kernel with OFED and one or more kernels without
OFED.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-11 19:28:58 +00:00
Bart Van Assche
7c04f47a6b Fixed two MODULE_PARM_DESC() clauses.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1497 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-11 19:27:49 +00:00
Bart Van Assche
0b3861da48 Added a blank line.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1483 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-29 19:09:06 +00:00
Bart Van Assche
421dbafa7c Changes:
- The entire receive queue can be used again instead of only SRPT_RQ_SIZE - 1
  elements (as in r1470).
- Added initiator-lockup-avoidance code to SRP_TSK_MGMT processing code too.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1473 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-17 13:07:46 +00:00
Bart Van Assche
5ce3870372 Updated test instructions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-16 19:38:08 +00:00
Bart Van Assche
e3d9724359 Updated copyright statement.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1471 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-16 19:36:29 +00:00
Bart Van Assche
c654261e03 Changes:
- Updated copyright statement.
- Micro-optimized the function srpt_req_lim_delta().
- Made sure that SRPT does not cause a lockup in (at least) the Linux SRP
  initiator. See also http://bugzilla.kernel.org/show_bug.cgi?id=14235.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1470 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-14 20:35:37 +00:00
Bart Van Assche
ee0767206c Removed SRP_CRED_REQ support again.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1464 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-13 20:19:54 +00:00
Bart Van Assche
2610bf1d0a Fixed a race condition (use-after-free) that could trigger a kernel bug report during module unloading.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1451 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-12 08:52:08 +00:00
Bart Van Assche
b85002b263 Made sure that if a work completion reports an error status that
completion queue processing is not aborted but that the remaining
completion queue entries are processed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1446 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-11 19:00:03 +00:00
Bart Van Assche
530ecf06c2 Converted a WARN_ON() into a PRINT_ERROR() statement.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1445 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-11 18:41:55 +00:00
Bart Van Assche
661ecd52d2 Close IB channel after session unregistration instead of before in order
to prevent the following errors to occur:
ib_srpt: srpt_completion:1737:***ERROR***: failed sending response status= 4
ib_srpt: srpt_completion:1737:***ERROR***: failed sending response status= 5


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1444 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-11 11:30:08 +00:00
Bart Van Assche
0cd53b65ef Made sure that the pre-cflags patches are uniform to the other in-tree kernel
patches, i.e. that -p1 has to be used to apply these patches.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1443 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-10 13:16:28 +00:00
Bart Van Assche
048a338747 Backported some 2.6.32 IB bug fixes to the 2.6.30 kernel.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1442 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-10 13:14:28 +00:00
Bart Van Assche
5cc522712e Fixed the following race conditions:
- With thread=1, the kernel thread was stopped before all I/O was stopped.
  This could result in IB completions for responses sent to the initiator
  not being processed, scst_tgt_cmd_done() not being called for certain
  SCST commands and hence this race could cause "rmmod ib_srpt" to hang.
- ib_unregister_event_handler() was called after cancel_work_sync(). This
  could cause srpt_event_handler() to queue new work, work that could be
  executed after the data it operates on had been deallocated.
Change: simplified module unloading by calling ib_destroy_cm_id(sdev->cm_id)
  before calling scst_unregister(). This made the variable "cleaning_up"
  superfluous.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1441 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-09 20:14:13 +00:00
Bart Van Assche
7bf99a3584 Removed some TRACE_ENTRY() / TRACE_EXIT() statements.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1434 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-06 20:47:08 +00:00
Bart Van Assche
ca9004962d Changes:
- srpt_release_channel_by_cmid(): the sdev->spinlock and scst_mgmt_lock are
  no longer locked nested.
- srpt_find_channel(): does now return NULL when the channel is not found
  (which never happens).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1432 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-06 20:11:24 +00:00
Bart Van Assche
6a523b3c13 Added more debugging code.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1430 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-04 20:56:00 +00:00
Bart Van Assche
45c93135f8 Changes:
- Removed references to SCST core internal state names.
- Does no longer accept new connections while unloading.
- Module unloading should now really no longer cause a hang.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1429 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-04 20:26:19 +00:00
Bart Van Assche
af086e27a8 Merged two lines.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1428 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-04 20:13:04 +00:00
Bart Van Assche
388c38bfd9 Fixed typos.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1426 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-03 08:34:21 +00:00
Bart Van Assche
a8a72c1b51 Fixed sporadic lockup triggered by removing the ib_srpt kernel module.
The following complaint was logged by the kernel when this happened:

INFO: task rmmod:26637 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
rmmod         D 00000000ffffffff     0 26637  26629
 ffff88009ce9dbd8 0000000000000046 ffff88009ce9dbf8 ffffffff8052466e
 0000000000000000 0000000000000001 0000000000000001 0000000000000001
 ffff88003c24d070 00000000001d17c0 000000000000c8a0 ffff88003c24d078
Call Trace:
 [<ffffffff8052466e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff80522408>] schedule+0x18/0x40
 [<ffffffff805227a5>] schedule_timeout+0x165/0x1a0
 [<ffffffff80525320>] ? _spin_unlock_irq+0x30/0x60
 [<ffffffff8023f4d9>] ? sub_preempt_count+0xa9/0xe0
 [<ffffffff80521756>] wait_for_common+0x116/0x1a0
 [<ffffffff80248850>] ? default_wake_function+0x0/0x20
 [<ffffffff8052189d>] wait_for_completion+0x1d/0x20
 [<ffffffffa06983e1>] scst_unregister_session+0x101/0x240 [scst]
 [<ffffffffa070f52f>] srpt_release+0xef/0x1e0 [ib_srpt]
 [<ffffffff805252d5>] ? _spin_unlock_irqrestore+0x65/0x80
 [<ffffffffa0693f60>] scst_unregister+0x70/0x380 [scst]
 [<ffffffff805252b2>] ? _spin_unlock_irqrestore+0x42/0x80
 [<ffffffffa0711982>] srpt_remove_one+0xa2/0x190 [ib_srpt]
 [<ffffffffa03b3105>] ib_unregister_client+0x65/0x120 [ib_core]
 [<ffffffff8027a02d>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffffa0715114>] srpt_cleanup_module+0x70/0xd4 [ib_srpt]
 [<ffffffff80284f87>] sys_delete_module+0x1a7/0x270
 [<ffffffff8020cc6d>] ? retint_swapgs+0xe/0x13
 [<ffffffff80279e79>] ? trace_hardirqs_on_caller+0x29/0x1d0
 [<ffffffff8052466e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff8020c21b>] system_call_fastpath+0x16/0x1b
INFO: lockdep is turned off.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1425 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-02 13:56:12 +00:00
Bart Van Assche
d124f1cc8e Changes:
- Decreased number of target-to-initiator request send buffers from two
  to one such that a clear error message can be printed when the SRP
  initiator did not respond to the SRP_CRED_REQ information unit.
- Bug fix: don't modify ch->last_response_req_lim when sending an SRP
  information unit that contains the REQUEST LIMIT DELTA field failed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1424 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-02 12:27:32 +00:00
Bart Van Assche
e1de778c3a Changes related to credit-based SRP buffer management:
- Bug fix: don't set the REQUEST LIMIT DELTA field to SRPT_RQ_SIZE when
  sending the first reponse to the initiator but to the proper value
  (a small integer).
- An SRP_CRED_REQ information unit is now sent to the initiator if the
  number of I/O contexts available for receiving dropped below two I/O
  contexts (see also the SRP standard for more information). This change
  is required to fix the SRP initiator lockup that happens when the
  initiator sends requests faster than the target can process them. In
  order to fix the lockup, it is  also necessary to implement SRP_CRED_REQ
  support in the SRP initiator in the vanilla Linux kernel and in OFED.
  Neither kernel version 2.6.32 nor OFED 1.5 nor any previous
  version of these components supports SRP_CRED_REQ information units.
  See also http://bugzilla.kernel.org/show_bug.cgi?id=14235 for more
  information about the initiator lockup.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1423 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-01 17:48:07 +00:00
Bart Van Assche
0d4ba05ae8 Added and commented out the following statement:
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1422 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-01-01 17:06:38 +00:00
Bart Van Assche
d1e5f40622 Changes:
- Convert sense data to/from fixed format / descriptor format before
  sending back a response.
- Print an error message to the kernel log when an unsupported IB event
  has been received.
- Return the SCSI status BUSY instead of CHECK CONDITION when allocating
  an SCST command failed (until r1409, the SCSI status in the SRP_RSP
  information unit was set to TASK SET FULL in this case).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1419 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-28 19:31:51 +00:00