Re: [PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-28 Thread Akinobu Mita
2015-04-29 2:38 GMT+09:00 Tim Chen : > There are a lot of duplicated code between crc_t10dif_update and > crc_t10dif. The only difference is for the update function > we import the crc value. I will prefer that we consolidate the code > into a local inline function that crc_t10dif_update and > cr

Re: [PATCH v3 3/5] target: handle odd SG mapping for data transfer memory

2015-04-27 Thread Akinobu Mita
2015-04-26 19:07 GMT+09:00 Sagi Grimberg : > On 4/25/2015 5:33 PM, Akinobu Mita wrote: >> >> sbc_dif_generate() and sbc_dif_verify() currently assume that each >> SG element for data transfer memory doesn't straddle the block size >> boundary. >> >> Ho

[PATCH v3 3/5] target: handle odd SG mapping for data transfer memory

2015-04-25 Thread Akinobu Mita
such cases correctly, this change inverts the outer loop to iterate data transfer memory and the inner loop to iterate protection information and enables to calculate CRC for a block which straddles multiple SG elements. Signed-off-by: Akinobu Mita Cc: Tim Chen Cc: Herbert Xu Cc: "David

[PATCH v3 2/5] lib: introduce crc_t10dif_update()

2015-04-25 Thread Akinobu Mita
This introduces crc_t10dif_update() which enables to calculate CRC for a block which straddles multiple SG elements by calling multiple times. Signed-off-by: Akinobu Mita Cc: Tim Chen Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: Nicholas Bellinger

[PATCH v3 0/5] target: Fix several problems related to T10-PI support

2015-04-25 Thread Akinobu Mita
y mutiple calls - Handle odd SG mapping correctly instead of giving up * Changes from v1: - Reduce code duplication a bit in target_read_prot_action() - Fix sbc_dif_verify() for WRITE_SAME command - Fix inverted rw argument for fd_do_rw() - Perform DIF verify before write for WRITE_SAME Akinobu Mit

[PATCH v3 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller"

[PATCH v3 3/4] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita Cc: Herbert Xu Cc: Horia Geanta Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org --- * No change from v2

[PATCH v3 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-23 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita Acked-by: Tejun Heo Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc: li

[PATCH v3 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
mplify the assignment of sdb->resid in fill_from_dev_buffer() in scsi_debug Akinobu Mita (4): lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next() lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer() crypto: talitos: use sg_pcopy_to_buffer()

Re: [PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-19 Thread Akinobu Mita
2013/6/18 Tejun Heo : > On Tue, Jun 18, 2013 at 10:31:32PM +0900, Akinobu Mita wrote: >> /** >> + * sg_miter_seek - reposition mapping iterator >> + * @miter: sg mapping iter to be seeked >> + * @offset: number of bytes to plus the current location >> + * >

[PATCH v2 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
the patch "introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()" - Add function comment for internal function sg_miter_seek() - Simplify the assignment of sdb->resid in fill_from_dev_buffer() in scsi_debug Akinobu Mita (4): lib/scatterlist: factor out sg_miter_get_nex

[PATCH v2 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller"

[PATCH v2 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-18 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.ker

[PATCH v2 3/4] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-18 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita Cc: Herbert Xu Cc: Horia Geanta Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org --- * No change from v1

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-08 Thread Akinobu Mita
2013/6/7 Tejun Heo : > Hello, > > On Thu, Jun 06, 2013 at 09:52:56PM +0900, Akinobu Mita wrote: >> +static bool sg_miter_get_next_page(struct sg_mapping_iter *miter) >> +{ >> + if (!miter->__remaining) { >> + struct scatterlist *sg; >

Re: [PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-08 Thread Akinobu Mita
2013/6/6 Imre Deak : > Looks ok to me, perhaps adding the seek functionality to the mapping > iterator would make things more generic and the mapping iterator more > resemble the page iterator. So we'd have a new sg_miter_start_offset and > call it here something like: > > sg_miter_start_offset(&mi

[PATCH 1/3] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller"

[PATCH 2/3] crypto: talitos: use sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
Use sg_pcopy_to_buffer() which is better than the function previously used. Because it doesn't do kmap/kunmap for skipped pages. Signed-off-by: Akinobu Mita Cc: Herbert Xu Cc: Horia Geanta Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org --- drivers/crypto

[PATCH 0/3] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-06 Thread Akinobu Mita
list before copying. The main reason for introducing these functions is to fix a problem in scsi_debug module. And there is a local function in crypto/talitos module, which can be replaced by sg_pcopy_to_buffer(). Akinobu Mita (3): lib/scatterlist: introduce sg_pcopy_from_buffer() and

Re: Crypto API Weirdnesses

2007-07-31 Thread Akinobu Mita
> > "Failed to setup dm-crypt key mapping. > > Check kernel for support for the aes-cbc-essiv:sha256 cipher spec and > > verify that /dev/hda4 contains at least 133 sectors. > > Failed to read from key storage" > > Looks like a "cryptsetup" error message, not kernel's. I can't find CONFIG_DM_CRYPT