<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/target/target_core_user.c, branch v4.9</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>target/user: Fix comments to not refer to data ring</title>
<updated>2016-10-20T04:22:23+00:00</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2016-08-25T15:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3d9b95558f5874ac5d63a057813dc66b480de7e1'/>
<id>3d9b95558f5874ac5d63a057813dc66b480de7e1</id>
<content type='text'>
We no longer use a ringbuffer for the data area, so this might cause
confusion. Just call it the data area.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Christie &lt;mchristi@redhat.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>
We no longer use a ringbuffer for the data area, so this might cause
confusion. Just call it the data area.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Christie &lt;mchristi@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Return an error if cmd data size is too large</title>
<updated>2016-10-20T04:22:16+00:00</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2016-08-25T15:55:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=554617b2bbe25c3fb3c80c28fe7a465884bb40b1'/>
<id>554617b2bbe25c3fb3c80c28fe7a465884bb40b1</id>
<content type='text'>
Userspace should be implementing VPD B0 (Block Limits) to inform the
initiator of max data size, but just in case we do get a too-large request,
do what the spec says and return INVALID_CDB_FIELD.

Make sure to unlock udev-&gt;cmdr_lock before returning.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Christie &lt;mchristi@redhat.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>
Userspace should be implementing VPD B0 (Block Limits) to inform the
initiator of max data size, but just in case we do get a too-large request,
do what the spec says and return INVALID_CDB_FIELD.

Make sure to unlock udev-&gt;cmdr_lock before returning.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Christie &lt;mchristi@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Use sense_reason_t in tcmu_queue_cmd_ring</title>
<updated>2016-10-20T04:21:45+00:00</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2016-10-06T15:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=02eb924fabc5b699c0d9d354491e6f0767e3c139'/>
<id>02eb924fabc5b699c0d9d354491e6f0767e3c139</id>
<content type='text'>
Instead of using -ERROR-style returns, use sense_reason_t. This lets us
remove tcmu_pass_op(), and return more correct sense values.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Bryant G. Ly &lt;bryantly@linux.vnet.ibm.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Christie &lt;mchristi@redhat.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>
Instead of using -ERROR-style returns, use sense_reason_t. This lets us
remove tcmu_pass_op(), and return more correct sense values.

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Bryant G. Ly &lt;bryantly@linux.vnet.ibm.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mike Christie &lt;mchristi@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Report capability of handling out-of-order completions to userspace</title>
<updated>2016-03-11T05:49:09+00:00</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@yasker.org</email>
</author>
<published>2016-03-01T00:02:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=32c76de3466ed2a875e36c140ac4e3800fdfab6e'/>
<id>32c76de3466ed2a875e36c140ac4e3800fdfab6e</id>
<content type='text'>
TCMU_MAILBOX_FLAG_CAP_OOOC was introduced, and userspace can check the flag
for out-of-order completion capability support.

Also update the document on how to use the feature.

Signed-off-by: Sheng Yang &lt;sheng@yasker.org&gt;
Reviewed-by: Andy Grover &lt;agrover@redhat.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>
TCMU_MAILBOX_FLAG_CAP_OOOC was introduced, and userspace can check the flag
for out-of-order completion capability support.

Also update the document on how to use the feature.

Signed-off-by: Sheng Yang &lt;sheng@yasker.org&gt;
Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Fix size_t format-spec build warning</title>
<updated>2016-03-11T05:49:06+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2016-02-28T02:25:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0241fd39ce7bc9b82b7e57305cb0d6bb1364d45b'/>
<id>0241fd39ce7bc9b82b7e57305cb0d6bb1364d45b</id>
<content type='text'>
Fix the following printk size_t warning as per 0-day build:

All warnings (new ones prefixed by &gt;&gt;):

   drivers/target/target_core_user.c: In function 'is_ring_space_avail':
&gt;&gt; drivers/target/target_core_user.c:385:12: warning: format '%lu'
&gt;&gt; expects argument of type 'long unsigned int', but argument 3 has type
&gt;&gt; 'size_t {aka unsigned int}' [-Wformat=]
      pr_debug("no data space: only %lu available, but ask for %lu\n",
               ^

Reported-by: kbuild test robot &lt;fengguang.wu@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>
Fix the following printk size_t warning as per 0-day build:

All warnings (new ones prefixed by &gt;&gt;):

   drivers/target/target_core_user.c: In function 'is_ring_space_avail':
&gt;&gt; drivers/target/target_core_user.c:385:12: warning: format '%lu'
&gt;&gt; expects argument of type 'long unsigned int', but argument 3 has type
&gt;&gt; 'size_t {aka unsigned int}' [-Wformat=]
      pr_debug("no data space: only %lu available, but ask for %lu\n",
               ^

Reported-by: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Don't free expired command when time out</title>
<updated>2016-03-11T05:49:04+00:00</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@yasker.org</email>
</author>
<published>2016-02-26T22:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b25c786399367b9a8bd955d8496669d019409bec'/>
<id>b25c786399367b9a8bd955d8496669d019409bec</id>
<content type='text'>
Which would result in NPE after when userspace connected again.

Expired command would be freed either when handling command(by userspace),
or when device was tearing down

Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Sheng Yang &lt;sheng@yasker.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>
Which would result in NPE after when userspace connected again.

Expired command would be freed either when handling command(by userspace),
or when device was tearing down

Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Sheng Yang &lt;sheng@yasker.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Introduce data_bitmap, replace data_length/data_head/data_tail</title>
<updated>2016-03-11T05:49:02+00:00</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@yasker.org</email>
</author>
<published>2016-02-26T22:59:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=26418649eead52619d8dd6cbc6760a1b144dbcd2'/>
<id>26418649eead52619d8dd6cbc6760a1b144dbcd2</id>
<content type='text'>
The data_bitmap was introduced to support asynchornization accessing of
data area.

We divide mailbox data area into blocks, and use data_bitmap to track the
usage of data area. All the new command's data would start with a new block,
and may left unusable space after it end. But it's easy to track using
data_bitmap.

Now we can allocate data area for asynchronization accessing from userspace,
since we can track the allocation using data_bitmap. The userspace part would
be the same as Maxim's previous asynchronized implementation.

Signed-off-by: Sheng Yang &lt;sheng@yasker.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>
The data_bitmap was introduced to support asynchornization accessing of
data area.

We divide mailbox data area into blocks, and use data_bitmap to track the
usage of data area. All the new command's data would start with a new block,
and may left unusable space after it end. But it's easy to track using
data_bitmap.

Now we can allocate data area for asynchronization accessing from userspace,
since we can track the allocation using data_bitmap. The userspace part would
be the same as Maxim's previous asynchronized implementation.

Signed-off-by: Sheng Yang &lt;sheng@yasker.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Free data ring in unified function</title>
<updated>2016-03-11T05:49:00+00:00</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@yasker.org</email>
</author>
<published>2016-02-26T22:59:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0c28481ffb4683ef21c6664d15dbd5ae5a6cd027'/>
<id>0c28481ffb4683ef21c6664d15dbd5ae5a6cd027</id>
<content type='text'>
Prepare for data_bitmap in the next patch.

Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Sheng Yang &lt;sheng@yasker.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>
Prepare for data_bitmap in the next patch.

Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Sheng Yang &lt;sheng@yasker.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Use iovec[] to describe continuous area</title>
<updated>2016-03-11T05:48:57+00:00</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@yasker.org</email>
</author>
<published>2016-02-26T22:59:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=f1dbd087cc7a28c6c174cb28cf98c19f4efb1fba'/>
<id>f1dbd087cc7a28c6c174cb28cf98c19f4efb1fba</id>
<content type='text'>
We don't need use one iovec per scatter-gather list entry, since data
area are continuous.

Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Sheng Yang &lt;sheng@yasker.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>
We don't need use one iovec per scatter-gather list entry, since data
area are continuous.

Reviewed-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Sheng Yang &lt;sheng@yasker.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target/user: Fix cast from pointer to phys_addr_t</title>
<updated>2016-02-06T23:59:57+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-02-01T16:29:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0633e123465b61a12a262b742bebf2a9945f7964'/>
<id>0633e123465b61a12a262b742bebf2a9945f7964</id>
<content type='text'>
The uio_mem structure has a member that is a phys_addr_t, but can
be a number of other types too. The target core driver attempts
to assign a pointer from vmalloc() to it, by casting it to
phys_addr_t, but that causes a warning when phys_addr_t is longer
than a pointer:

drivers/target/target_core_user.c: In function 'tcmu_configure_device':
drivers/target/target_core_user.c:906:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

This adds another cast to uintptr_t to shut up the warning.
A nicer fix might be to have additional fields in uio_mem
for the different purposes, so we can assign a pointer directly.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.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>
The uio_mem structure has a member that is a phys_addr_t, but can
be a number of other types too. The target core driver attempts
to assign a pointer from vmalloc() to it, by casting it to
phys_addr_t, but that causes a warning when phys_addr_t is longer
than a pointer:

drivers/target/target_core_user.c: In function 'tcmu_configure_device':
drivers/target/target_core_user.c:906:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

This adds another cast to uintptr_t to shut up the warning.
A nicer fix might be to have additional fields in uio_mem
for the different purposes, so we can assign a pointer directly.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
