<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/target, branch v3.3-rc2</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>target: Set additional sense length field in sense data</title>
<updated>2011-12-16T06:29:04+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-12-13T22:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=895f3022523361e9b383cf48f51feb1f7d5e7e53'/>
<id>895f3022523361e9b383cf48f51feb1f7d5e7e53</id>
<content type='text'>
The target code was not setting the additional sense length field in the
sense data it returned, which meant that at least the Linux stack
ignored the ASC/ASCQ fields.  For example, without this patch, on a
tcm_loop device:

    # sg_raw -v /dev/sda 2 0 0 0 0 0

gives

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
      Raw sense data (in hex):
            70 00 05 00 00 00 00 00

while after the patch we correctly get the following (which matches what
a regular disk returns):

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
     Additional sense: Invalid command operation code
     Raw sense data (in hex):
            70 00 05 00 00 00 00 0a  00 00 00 00 20 00 00 00
            00 00

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The target code was not setting the additional sense length field in the
sense data it returned, which meant that at least the Linux stack
ignored the ASC/ASCQ fields.  For example, without this patch, on a
tcm_loop device:

    # sg_raw -v /dev/sda 2 0 0 0 0 0

gives

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
      Raw sense data (in hex):
            70 00 05 00 00 00 00 00

while after the patch we correctly get the following (which matches what
a regular disk returns):

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
     Additional sense: Invalid command operation code
     Raw sense data (in hex):
            70 00 05 00 00 00 00 0a  00 00 00 00 20 00 00 00
            00 00

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Remove legacy device status check from transport_execute_tasks</title>
<updated>2011-12-14T11:53:29+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-12-01T02:24:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6d5b59756033c2a029bde7262bb5f8d45f4ca952'/>
<id>6d5b59756033c2a029bde7262bb5f8d45f4ca952</id>
<content type='text'>
This patch removes a legacy se_dev_check_online() check from within
transport_execute_tasks() that should no longer be necessary as
transport_lookup_cmd_lun() is already making this call.

Using transport_cmd_check_stop() from transport_execute_tasks() should
already be checking per se_cmd context for each descriptor upon active
I/O shutdown, so no need to acquire dev-&gt;dev_status_lock again while
executing se_task submission.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes a legacy se_dev_check_online() check from within
transport_execute_tasks() that should no longer be necessary as
transport_lookup_cmd_lun() is already making this call.

Using transport_cmd_check_stop() from transport_execute_tasks() should
already be checking per se_cmd context for each descriptor upon active
I/O shutdown, so no need to acquire dev-&gt;dev_status_lock again while
executing se_task submission.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Remove __transport_execute_tasks() for each processing context</title>
<updated>2011-12-14T11:50:12+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-12-01T02:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=beb55a0cc15a43be43a646b588fcf83822f0c44f'/>
<id>beb55a0cc15a43be43a646b588fcf83822f0c44f</id>
<content type='text'>
This patch removes the original usage of __transport_execute_tasks() ahead
of every transport_get_cmd_from_queue() call in transport_processing_thread().
This helps reduce se_device-&gt;execute_task_lock contention between qla2xxx wq
with target_submit_cmd() for READs and transport_processing_thread()
context servicing WRITEs with full payloads for I/O submission.

It also adds a __transport_execute_tasks() to kick the task queue again
without a *se_cmd descriptor with existing queue full logic, but this may
end up not being necessary.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes the original usage of __transport_execute_tasks() ahead
of every transport_get_cmd_from_queue() call in transport_processing_thread().
This helps reduce se_device-&gt;execute_task_lock contention between qla2xxx wq
with target_submit_cmd() for READs and transport_processing_thread()
context servicing WRITEs with full payloads for I/O submission.

It also adds a __transport_execute_tasks() to kick the task queue again
without a *se_cmd descriptor with existing queue full logic, but this may
end up not being necessary.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Remove extra se_device-&gt;execute_task_lock access in fast path</title>
<updated>2011-12-14T11:48:46+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-12-01T02:18:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4d2300ccffd22d1d0213b6a8e4d685eb6ca069c0'/>
<id>4d2300ccffd22d1d0213b6a8e4d685eb6ca069c0</id>
<content type='text'>
This patch makes __transport_execute_tasks() perform the addition of
tasks to dev-&gt;execute_task_list via __transport_add_tasks_from_cmd()
while holding dev-&gt;execute_task_lock during normal I/O fast path
submission.

It effectively removes the unnecessary re-acquire of dev-&gt;execute_task_lock
during transport_execute_tasks() -&gt; transport_add_tasks_from_cmd() ahead
of calling  __transport_execute_tasks() to queue tasks for the passed
*se_cmd descriptor.

(v2: Re-add goto check_depth usage for multi-task submission for now..)

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes __transport_execute_tasks() perform the addition of
tasks to dev-&gt;execute_task_list via __transport_add_tasks_from_cmd()
while holding dev-&gt;execute_task_lock during normal I/O fast path
submission.

It effectively removes the unnecessary re-acquire of dev-&gt;execute_task_lock
during transport_execute_tasks() -&gt; transport_add_tasks_from_cmd() ahead
of calling  __transport_execute_tasks() to queue tasks for the passed
*se_cmd descriptor.

(v2: Re-add goto check_depth usage for multi-task submission for now..)

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Drop se_device TCQ queue_depth usage from I/O path</title>
<updated>2011-12-14T11:42:13+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-30T09:25:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=65586d51e0986be574118286c3d0007e903a2add'/>
<id>65586d51e0986be574118286c3d0007e903a2add</id>
<content type='text'>
Historically, pSCSI devices have been the ones that required target-core
to enforce a per se_device-&gt;depth_left.  This patch changes target-core
to no longer (by default) enforce a per se_device-&gt;depth_left or sleep in
transport_tcq_window_closed() when we out of queue slots for all backend
export cases.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Historically, pSCSI devices have been the ones that required target-core
to enforce a per se_device-&gt;depth_left.  This patch changes target-core
to no longer (by default) enforce a per se_device-&gt;depth_left or sleep in
transport_tcq_window_closed() when we out of queue slots for all backend
export cases.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Fix possible NULL pointer with __transport_execute_tasks</title>
<updated>2011-12-14T11:42:12+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-30T08:41:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=40be67f4c588fe2f3e2dbd60ae1f470abc5b6ad8'/>
<id>40be67f4c588fe2f3e2dbd60ae1f470abc5b6ad8</id>
<content type='text'>
This patch makes __transport_execute_tasks() use a local *se_dev
reference to prevent direct se_cmd-&gt;se_dev access after
transport_cmd_check_stop() -&gt; transport_add_tasks_from_cmd()
has been called, as in the current implementation we can expect
__transport_execute_tasks() may be called from another context
that may have already completed the I/O.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes __transport_execute_tasks() use a local *se_dev
reference to prevent direct se_cmd-&gt;se_dev access after
transport_cmd_check_stop() -&gt; transport_add_tasks_from_cmd()
has been called, as in the current implementation we can expect
__transport_execute_tasks() may be called from another context
that may have already completed the I/O.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tcm_fc: Convert ft_send_work to use target_submit_cmd</title>
<updated>2011-12-14T11:42:08+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-23T05:41:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4355a9110eeb2eaf1dd44fcab16ccbd1c8c5fad4'/>
<id>4355a9110eeb2eaf1dd44fcab16ccbd1c8c5fad4</id>
<content type='text'>
This patch converts the main ft_send_work() I/O path to use
target_submit_cmd() with a single se_cmd-&gt;cmd_kref reference
that is released via the existing ft_check_stop_free() response
path callback.

It also makes ft_send_tm() use transport_init_se_cmd() and
target_get_sess_cmd() to also use single se_cmd-&gt;cmd_kref
reference.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Kiran Patil &lt;kiran.patil@intel.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch converts the main ft_send_work() I/O path to use
target_submit_cmd() with a single se_cmd-&gt;cmd_kref reference
that is released via the existing ft_check_stop_free() response
path callback.

It also makes ft_send_tm() use transport_init_se_cmd() and
target_get_sess_cmd() to also use single se_cmd-&gt;cmd_kref
reference.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Kiran Patil &lt;kiran.patil@intel.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Add target_submit_cmd() for process context fabric submission</title>
<updated>2011-12-14T11:40:56+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-19T04:36:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a63607855224702ea17e6016ecf3f7d544e83625'/>
<id>a63607855224702ea17e6016ecf3f7d544e83625</id>
<content type='text'>
This patch adds a target_submit_cmd() caller that can be used by fabrics
to submit an uninitialized se_cmd descriptor to an struct se_session +
unpacked_lun from workqueue process context.  This call will invoke the
following steps:

- transport_init_se_cmd() to setup se_cmd specific pointers
- Obtain se_cmd-&gt;cmd_kref references with target_get_sess_cmd()
- set se_cmd-&gt;t_tasks_bidi
- transport_lookup_cmd_lun() to setup struct se_cmd-&gt;se_lun from
  the passed unpacked_lun
- transport_generic_allocate_tasks() to setup the passed *cdb, and
- transport_handle_cdb_direct() handle READ dispatch or WRITE
  ready-to-transfer callback to fabric

v2 changes from hch feedback:

*) Add target_sc_flags_table for target_submit_cmd flags
*) Rename bidi parameter to flags, add TARGET_SCF_BIDI_OP
*) Convert checks to BUG_ON
*) Add out_check_cond for transport_send_check_condition_and_sense
   usage

v3 changes:

*) Add TARGET_SCF_ACK_KREF for target_submit_cmd into
   target_get_sess_cmd to determine when the fabric caller is expecting
   a second kref_put() from fabric packet acknowledgement.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a target_submit_cmd() caller that can be used by fabrics
to submit an uninitialized se_cmd descriptor to an struct se_session +
unpacked_lun from workqueue process context.  This call will invoke the
following steps:

- transport_init_se_cmd() to setup se_cmd specific pointers
- Obtain se_cmd-&gt;cmd_kref references with target_get_sess_cmd()
- set se_cmd-&gt;t_tasks_bidi
- transport_lookup_cmd_lun() to setup struct se_cmd-&gt;se_lun from
  the passed unpacked_lun
- transport_generic_allocate_tasks() to setup the passed *cdb, and
- transport_handle_cdb_direct() handle READ dispatch or WRITE
  ready-to-transfer callback to fabric

v2 changes from hch feedback:

*) Add target_sc_flags_table for target_submit_cmd flags
*) Rename bidi parameter to flags, add TARGET_SCF_BIDI_OP
*) Convert checks to BUG_ON
*) Add out_check_cond for transport_send_check_condition_and_sense
   usage

v3 changes:

*) Add TARGET_SCF_ACK_KREF for target_submit_cmd into
   target_get_sess_cmd to determine when the fabric caller is expecting
   a second kref_put() from fabric packet acknowledgement.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Make target_put_sess_cmd use target_release_cmd_kref</title>
<updated>2011-12-14T11:38:29+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-12T08:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7481deb413be132a22193e8a0bce88b311ecb3c2'/>
<id>7481deb413be132a22193e8a0bce88b311ecb3c2</id>
<content type='text'>
This patch moves target_put_sess_cmd() to use a se_cmd-&gt;cmd_kref
callback target_release_cmd_kref when performing driver release of
fabric-&gt;se_cmd descriptor memory.  It sets the default cmd_kref
count value to '2' within target_get_sess_cmd() setup, and
currently assumes TFO-&gt;check_stop_free() usage.

It drops se_tfo-&gt;check_release_cmd() usage in the main
transport_release_cmd codepath.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch moves target_put_sess_cmd() to use a se_cmd-&gt;cmd_kref
callback target_release_cmd_kref when performing driver release of
fabric-&gt;se_cmd descriptor memory.  It sets the default cmd_kref
count value to '2' within target_get_sess_cmd() setup, and
currently assumes TFO-&gt;check_stop_free() usage.

It drops se_tfo-&gt;check_release_cmd() usage in the main
transport_release_cmd codepath.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Set response format in INQUIRY response</title>
<updated>2011-12-14T11:38:28+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-12-06T18:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ce136176fea522fc8f4c16dcae7e8ed1d890ca39'/>
<id>ce136176fea522fc8f4c16dcae7e8ed1d890ca39</id>
<content type='text'>
Current SCSI specs say that the "response format" field in the standard
INQUIRY response should be set to 2, and all the real SCSI devices I
have do put 2 here.  So let's do that too.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current SCSI specs say that the "response format" field in the standard
INQUIRY response should be set to 2, and all the real SCSI devices I
have do put 2 here.  So let's do that too.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
