Commit Graph

765 Commits

Author SHA1 Message Date
Bart Van Assche
345cd34aae Whitespace-only change: fixed a checkpatch complaint.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1386 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-09 12:03:35 +00:00
Bart Van Assche
ca81d05dd7 Update: the __same_type() macro has been introduced in kernel version 2.6.31, not in 2.6.30.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1383 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-07 08:51:58 +00:00
Bart Van Assche
e4b93a83c0 - Fixed a checkpatch complaint.
- Made sure that the SRPT source code compiles again on systems with a 2.6.29
  or older kernel.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1382 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-07 08:07:58 +00:00
Bart Van Assche
6a9b203dd2 FMR only applies to the SRP initiator, not to the SRP target.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-07 07:21:39 +00:00
Bart Van Assche
799820d44b - Simplified error handling in srpt_get_desc_tbl(): incorrect indirect
descriptors are now reported by returning -EINVAL instead of setting the
  third argument to true. Removed the third argument of this function.
- Added support for SRP_CMD requests with non-zero ADDITIONAL CDB LENGTH.
  Note: support for these requests has not yet been tested -- I do not know
  of any SRP initiator that generates such requests.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1380 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-06 19:00:25 +00:00
Bart Van Assche
ffb2fb1f11 Updated SRPT documentation.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1379 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-06 12:44:47 +00:00
Bart Van Assche
001d47266c Updated to do list.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1378 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-06 12:37:21 +00:00
Bart Van Assche
0486e8404c - Moved two constants from ib_srpt.c to ib_srpt.h.
- Changed default value of srp_max_message_size from 4096 to 2116. This
  size corresponds to the size of an SRP_CMD request message containing
  an indirect buffer list with 128 elements.
- A warning is now printed when an SRP_CMD request is received containing
  more than one CDB -- this kind of messages is not yet supported.
- Switched back from multiple ib_dma_sync_single_for_cpu() calls to a
  single call because the latter results in better performance.
- An error message is now printed if a corrupt SRP_CMD request has been
  received. Before these were ignored silently.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-12-05 10:10:53 +00:00
Bart Van Assche
7a330f2e09 Should have been included in the previous commit (r1371).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1372 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-30 10:59:40 +00:00
Bart Van Assche
b371630185 Avoid dangling pointer dereferences by resetting ioctx->scmnd in srpt_on_free_cmd().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1371 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-30 09:51:17 +00:00
Bart Van Assche
7cdcbc8c69 Cleanup:
- Removed a spinlock that became superfluous.
- Fixed checkpatch and sparse complaints.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1370 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-28 18:40:15 +00:00
Bart Van Assche
418e7fb3d6 - Split srpt_find_channel into two functions: srpt_find_channel() and
srpt_release_channel_by_cmid().
- Removed tracing statements from srpt_unmap_sg_to_ib_sge() because this
  function is now invoked while performing I/O.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-28 17:20:22 +00:00
Bart Van Assche
ec2e199060 Bug fixes (some introduced in the previous revision, some long-standing):
- Fixed system lockup triggered by "rmmod ib_srpt" while the SRP was writing
  data. This lockup occurred because srpt_reset_ioctx() was not resetting
  the pointers to the memory it freed, which indirectly triggered a kernel
  oops in the IB interrupt handler.
- Fixed BUG() during "rmmod ib_srpt" triggered by calling scst_rx_cmd()
  after scst_unregister_session(). This has been fixed by making sure that
  the channel state is set to RDMA_CHANNEL_DISCONNECTING before calling
  scst_unregister_session().
Performance improvements:
- Simplified cmd_wait_list manipulation code.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1368 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-28 16:36:53 +00:00
Bart Van Assche
f50ce17866 Bug fixes:
- Fixed races on srpt_ioctx::state manipulation by declaring this variable
  atomic.
- Fixed races on srpt_rdma_ch::state manipulation by declaring this variable
  atomic.
- Fixed bug in srpt_abort_scst_cmd(): SRPT_STATE_DATA_IN was not yet handled.
- Fixed races on srpt_rdma_ch::cm_id destruction. Clearly documented which
  object owns the cm_id at which time.
Performance improvements:
- Eliminated the list of active commands (active_scmnd_list) because this
  list was a duplicated of a list already kept by the SCST core.
- Switched to double-checked locking in srpt_handle_new_iu(). This saves one
  spin_lock_irqsave() and one spin_unlock_irqrestore() call in the common
  case (that is, a live channel).
- Eliminated RDMA channel state tests in SCST command handling callback
  functions -- removed the function srpt_abort_if_disconnecting().


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-28 14:03:55 +00:00
Bart Van Assche
e6f5aa8865 Changes:
- The message that sense data is truncated is now generated via the
  PRINT_WARNING() macro instead of TRACE_DBG().
- Cleaned up code for sense data truncation.
- Compiles again on RHEL and CentOS systems.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1363 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-27 17:52:47 +00:00
Bart Van Assche
1065e2d317 Log sense data truncation when debugging is enabled.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1362 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-27 12:10:59 +00:00
Bart Van Assche
10530125a5 Whitespace-only change.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1354 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-23 08:40:51 +00:00
Bart Van Assche
495257b44e - Added counter that keeps track of the number of work requests posted on
the per-channel queue pair. This counter is used to prevent that
  ib_post_send() triggers a queue overflow.
- Fixed error handling in srpt_xfer_data(): srpt_unmap_sg_to_ib_sge() is now
  called before returning an error code.
- Simplified implementation of the sysfs attribute login_info.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1353 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-22 18:42:35 +00:00
Bart Van Assche
b9402438ff Updated to do list once more.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1346 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-18 07:22:30 +00:00
Bart Van Assche
b01b495735 Updated to do list.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1345 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-17 20:03:35 +00:00
Bart Van Assche
a57d10033f Added more comments.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-17 18:01:16 +00:00
Bart Van Assche
9d65e4fe05 Removed a BUILD_BUG_ON() statement that was too restrictive.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1343 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-17 18:00:23 +00:00
Bart Van Assche
9955ef7627 Since the expression "sizeof(*sense) + sizeof(*sense) % 4" did not make
sense, replaced this expression by "sizeof(*sense)" and a BUILD_BUG_ON()
statement that verifies that sizeof(*sense) is a multiple of four. Should
the first expression have been "roundup(sizeof(*sense), 4)" ?


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1336 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-15 13:14:40 +00:00
Bart Van Assche
bcec50e065 - Small performance improvement: ib_dma_sync_for_device() and
ib_dma_sync_for_cpu() calls do now only synchronize the data areas used.
- Removed per-command mutex again because it's not a full solution with
  regard to avoiding races between module unloading / IB error handling and
  SCST's command handling.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1335 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-15 13:11:46 +00:00
Bart Van Assche
4afbe006a5 Updated test instructions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1333 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-11 18:56:05 +00:00
Bart Van Assche
5c208ca261 - Fixed races between command abortion code and regular command processing
code.
- Fixed the bug that new commands could be queued for a channel that was
  being closed.
- Bug fix: ib_dma_unmap_sg() is now called by srpt_xmit_response() when
  aborting commands.
- Changed default value of the kernel module parameter 'thread' from zero
  to one because using thread=0 can cause the Linux and the OFED SRP
  initiator to lock up -- see also
  http://bugzilla.kernel.org/show_bug.cgi?id=14235 and
  https://bugs.openfabrics.org/show_bug.cgi?id=1745.
- Made disconnect logging more detailed -- added cm_id in output.
- Changed argument type of second argument of srpt_release_channel() from
  int to bool.
- Eliminated srpt_abort_scst_cmd's 'tell_initiator' argument because this
  argument always has the same value (i.e. true).
- Simplified abortion of commands in state SRPT_STATE_NEW. Simplified
  implementation of srpt_on_free_cmd().


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1332 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-11 18:44:05 +00:00
Bart Van Assche
a6e1b94e5b - Changed default maximum control message size from 996 to 4096 bytes.
As a result, the maximum number of sg list elements that an initiator
  can pass in one message increased from 58 to 251.
- Added kernel module parameter srp_max_message_size, which allows to
  specify the maximum size of SRP control messages.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1328 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-07 11:56:51 +00:00
Bart Van Assche
cdbd65daeb Removed trailing whitespace.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1313 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-03 07:46:39 +00:00
Bart Van Assche
d5cd0c893a - Fixed uninitialized variable read that was introduced in r1307.
- Introduced new kernel module parameter srp_max_rdma_size. This parameter
  allows to configure the maximum size of SRP RDMA transfers.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1312 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-02 19:45:45 +00:00
Bart Van Assche
b9f64a7c61 - Fixed a bug introduced in the previous commit.
- Added more debug tracing related to command abortion.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1308 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-01 20:11:30 +00:00
Bart Van Assche
c9f49128bb Fixed the following issues found by Vladislav Bolkhovitin via source reading:
- Inserted tests such that ib_dma_unmap_sg() is never called with a NULL
  second argument.
- Fixed race conditions triggered by ioctx->state manipulations.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1307 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-11-01 17:01:08 +00:00
Bart Van Assche
b9a0eb9386 Updates for the OFED 1.5 + kernel 2.6.30 combination.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1306 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-31 13:06:39 +00:00
Bart Van Assche
ec836491e4 Should have been included in the previous commit.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1303 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 19:42:53 +00:00
Bart Van Assche
eb46362a7b Added more debug code.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1299 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 18:56:23 +00:00
Bart Van Assche
debe7f1152 Added and commented out compiler flags that make it easier to locate the statement that triggered a kernel oops.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1298 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 18:42:53 +00:00
Bart Van Assche
e83ed53e9b Updated for the 2.6.30 kernel + OFED combination.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1297 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 18:41:52 +00:00
Bart Van Assche
8ec85a34a4 Added to repository.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1295 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 18:41:08 +00:00
Bart Van Assche
1d0b2a972d Simplified OFED installation instructions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1294 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-29 18:40:37 +00:00
Bart Van Assche
773146af26 Added and commented out -DCONFIG_SCST_TRACING.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1270 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-25 09:39:55 +00:00
Bart Van Assche
87be4a7213 More #undef CONFIG_SCST_PROC fixes.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1269 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-25 09:39:27 +00:00
Bart Van Assche
049293249b Made srpt compilation more silent.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1264 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-23 18:41:05 +00:00
Bart Van Assche
942aef8387 Compiles now with CONFIG_SCST_PROC undefined.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1255 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-23 10:56:44 +00:00
Bart Van Assche
77af82d2c3 Compiles again on RHEL 5 / CentOS 5 with CONFIG_SCST_DEBUG enabled.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1176 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-10-04 08:31:04 +00:00
Bart Van Assche
994b61e39b Added more error injection code.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1154 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-26 15:51:58 +00:00
Bart Van Assche
916dee314f Another bug fix for aborting SCST commands: commands in state
SRPT_STATE_NEW are now aborted properly too. Until now aborting an
SCST command that had state SRPT_STATE_NEW triggered a sBUG_ON()
statement in scst_tgt_cmd_done().


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1153 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-26 12:56:20 +00:00
Bart Van Assche
0ff548a598 Fixed a typo in the documentation: replaced ipsrpdm by ibsrpdm.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1140 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-25 08:00:00 +00:00
Bart Van Assche
267f3b1f79 Only report that a command already got aborted when SCSI management
debugging has been enabled.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1139 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-24 18:42:22 +00:00
Bart Van Assche
2a01729d4d Builds again when CONFIG_SCST_DEBUG has not been defined.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1129 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-23 06:50:49 +00:00
Bart Van Assche
18fcb11be3 Added error injection code: the kernel parameter processing_delay_in_us
allows to control by how much the srpt_completion() function (which runs
in interrupt context) will be delayed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1128 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-22 19:18:45 +00:00
Bart Van Assche
9adc308a2a Since it is normal that the SCST core calls srpt_xmit_response() for
a command that has already been aborted, changed the message that
reports this from an error message to an informational message.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1123 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-09-21 18:43:15 +00:00