Skip to content

Commit 099f53c

Browse files
committed
async_tx: rename zero_sum to val
'zero_sum' does not properly describe the operation of generating parity and checking that it validates against an existing buffer. Change the name of the operation to 'val' (for 'validate'). This is in anticipation of the p+q case where it is a requirement to identify the target parity buffers separately from the source buffers, because the target parity buffers will not have corresponding pq coefficients. Reviewed-by: Andre Noll <maan@systemlinux.org> Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent fd74ea6 commit 099f53c

9 files changed

Lines changed: 47 additions & 47 deletions

File tree

‎Documentation/crypto/async-tx-api.txt‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ async_<operation>(<op specific parameters>,
6161
void *callback_parameter);
6262

6363
3.2 Supported operations:
64-
memcpy - memory copy between a source and a destination buffer
65-
memset - fill a destination buffer with a byte value
66-
xor - xor a series of source buffers and write the result to a
67-
destination buffer
68-
xor_zero_sum - xor a series of source buffers and set a flag if the
69-
result is zero. The implementation attempts to prevent
70-
writes to memory
64+
memcpy - memory copy between a source and a destination buffer
65+
memset - fill a destination buffer with a byte value
66+
xor - xor a series of source buffers and write the result to a
67+
destination buffer
68+
xor_val - xor a series of source buffers and set a flag if the
69+
result is zero. The implementation attempts to prevent
70+
writes to memory
7171

7272
3.3 Descriptor management:
7373
The return value is non-NULL and points to a 'descriptor' when the operation

‎arch/arm/mach-iop13xx/setup.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ void __init iop13xx_platform_init(void)
478478
dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
479479
dma_cap_set(DMA_XOR, plat_data->cap_mask);
480480
dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
481-
dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
481+
dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
482482
dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
483483
dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
484484
dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
@@ -490,7 +490,7 @@ void __init iop13xx_platform_init(void)
490490
dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
491491
dma_cap_set(DMA_XOR, plat_data->cap_mask);
492492
dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
493-
dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
493+
dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
494494
dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
495495
dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
496496
dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
@@ -502,13 +502,13 @@ void __init iop13xx_platform_init(void)
502502
dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
503503
dma_cap_set(DMA_XOR, plat_data->cap_mask);
504504
dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
505-
dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
505+
dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
506506
dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
507507
dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
508508
dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
509509
dma_cap_set(DMA_PQ_XOR, plat_data->cap_mask);
510510
dma_cap_set(DMA_PQ_UPDATE, plat_data->cap_mask);
511-
dma_cap_set(DMA_PQ_ZERO_SUM, plat_data->cap_mask);
511+
dma_cap_set(DMA_PQ_VAL, plat_data->cap_mask);
512512
break;
513513
}
514514
}

‎arch/arm/plat-iop/adma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static int __init iop3xx_adma_cap_init(void)
198198
dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
199199
#else
200200
dma_cap_set(DMA_XOR, iop3xx_aau_data.cap_mask);
201-
dma_cap_set(DMA_ZERO_SUM, iop3xx_aau_data.cap_mask);
201+
dma_cap_set(DMA_XOR_VAL, iop3xx_aau_data.cap_mask);
202202
dma_cap_set(DMA_MEMSET, iop3xx_aau_data.cap_mask);
203203
dma_cap_set(DMA_INTERRUPT, iop3xx_aau_data.cap_mask);
204204
#endif

‎crypto/async_tx/async_xor.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int page_is_zero(struct page *p, unsigned int offset, size_t len)
222222
}
223223

224224
/**
225-
* async_xor_zero_sum - attempt a xor parity check with a dma engine.
225+
* async_xor_val - attempt a xor parity check with a dma engine.
226226
* @dest: destination page used if the xor is performed synchronously
227227
* @src_list: array of source pages. The dest page must be listed as a source
228228
* at index zero. The contents of this array may be overwritten.
@@ -236,13 +236,13 @@ static int page_is_zero(struct page *p, unsigned int offset, size_t len)
236236
* @cb_param: parameter to pass to the callback routine
237237
*/
238238
struct dma_async_tx_descriptor *
239-
async_xor_zero_sum(struct page *dest, struct page **src_list,
239+
async_xor_val(struct page *dest, struct page **src_list,
240240
unsigned int offset, int src_cnt, size_t len,
241241
u32 *result, enum async_tx_flags flags,
242242
struct dma_async_tx_descriptor *depend_tx,
243243
dma_async_tx_callback cb_fn, void *cb_param)
244244
{
245-
struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_ZERO_SUM,
245+
struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_XOR_VAL,
246246
&dest, 1, src_list,
247247
src_cnt, len);
248248
struct dma_device *device = chan ? chan->device : NULL;
@@ -261,15 +261,15 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
261261
dma_src[i] = dma_map_page(device->dev, src_list[i],
262262
offset, len, DMA_TO_DEVICE);
263263

264-
tx = device->device_prep_dma_zero_sum(chan, dma_src, src_cnt,
265-
len, result,
266-
dma_prep_flags);
264+
tx = device->device_prep_dma_xor_val(chan, dma_src, src_cnt,
265+
len, result,
266+
dma_prep_flags);
267267
if (unlikely(!tx)) {
268268
async_tx_quiesce(&depend_tx);
269269

270270
while (!tx) {
271271
dma_async_issue_pending(chan);
272-
tx = device->device_prep_dma_zero_sum(chan,
272+
tx = device->device_prep_dma_xor_val(chan,
273273
dma_src, src_cnt, len, result,
274274
dma_prep_flags);
275275
}
@@ -296,7 +296,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
296296

297297
return tx;
298298
}
299-
EXPORT_SYMBOL_GPL(async_xor_zero_sum);
299+
EXPORT_SYMBOL_GPL(async_xor_val);
300300

301301
static int __init async_xor_init(void)
302302
{

‎drivers/dma/dmaengine.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ int dma_async_device_register(struct dma_device *device)
644644
!device->device_prep_dma_memcpy);
645645
BUG_ON(dma_has_cap(DMA_XOR, device->cap_mask) &&
646646
!device->device_prep_dma_xor);
647-
BUG_ON(dma_has_cap(DMA_ZERO_SUM, device->cap_mask) &&
648-
!device->device_prep_dma_zero_sum);
647+
BUG_ON(dma_has_cap(DMA_XOR_VAL, device->cap_mask) &&
648+
!device->device_prep_dma_xor_val);
649649
BUG_ON(dma_has_cap(DMA_MEMSET, device->cap_mask) &&
650650
!device->device_prep_dma_memset);
651651
BUG_ON(dma_has_cap(DMA_INTERRUPT, device->cap_mask) &&

‎drivers/dma/iop-adma.c‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,9 @@ iop_adma_prep_dma_xor(struct dma_chan *chan, dma_addr_t dma_dest,
660660
}
661661

662662
static struct dma_async_tx_descriptor *
663-
iop_adma_prep_dma_zero_sum(struct dma_chan *chan, dma_addr_t *dma_src,
664-
unsigned int src_cnt, size_t len, u32 *result,
665-
unsigned long flags)
663+
iop_adma_prep_dma_xor_val(struct dma_chan *chan, dma_addr_t *dma_src,
664+
unsigned int src_cnt, size_t len, u32 *result,
665+
unsigned long flags)
666666
{
667667
struct iop_adma_chan *iop_chan = to_iop_adma_chan(chan);
668668
struct iop_adma_desc_slot *sw_desc, *grp_start;
@@ -906,7 +906,7 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
906906

907907
#define IOP_ADMA_NUM_SRC_TEST 4 /* must be <= 15 */
908908
static int __devinit
909-
iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device)
909+
iop_adma_xor_val_self_test(struct iop_adma_device *device)
910910
{
911911
int i, src_idx;
912912
struct page *dest;
@@ -1002,7 +1002,7 @@ iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device)
10021002
PAGE_SIZE, DMA_TO_DEVICE);
10031003

10041004
/* skip zero sum if the capability is not present */
1005-
if (!dma_has_cap(DMA_ZERO_SUM, dma_chan->device->cap_mask))
1005+
if (!dma_has_cap(DMA_XOR_VAL, dma_chan->device->cap_mask))
10061006
goto free_resources;
10071007

10081008
/* zero sum the sources with the destintation page */
@@ -1016,10 +1016,10 @@ iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device)
10161016
dma_srcs[i] = dma_map_page(dma_chan->device->dev,
10171017
zero_sum_srcs[i], 0, PAGE_SIZE,
10181018
DMA_TO_DEVICE);
1019-
tx = iop_adma_prep_dma_zero_sum(dma_chan, dma_srcs,
1020-
IOP_ADMA_NUM_SRC_TEST + 1, PAGE_SIZE,
1021-
&zero_sum_result,
1022-
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1019+
tx = iop_adma_prep_dma_xor_val(dma_chan, dma_srcs,
1020+
IOP_ADMA_NUM_SRC_TEST + 1, PAGE_SIZE,
1021+
&zero_sum_result,
1022+
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
10231023

10241024
cookie = iop_adma_tx_submit(tx);
10251025
iop_adma_issue_pending(dma_chan);
@@ -1072,10 +1072,10 @@ iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device)
10721072
dma_srcs[i] = dma_map_page(dma_chan->device->dev,
10731073
zero_sum_srcs[i], 0, PAGE_SIZE,
10741074
DMA_TO_DEVICE);
1075-
tx = iop_adma_prep_dma_zero_sum(dma_chan, dma_srcs,
1076-
IOP_ADMA_NUM_SRC_TEST + 1, PAGE_SIZE,
1077-
&zero_sum_result,
1078-
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
1075+
tx = iop_adma_prep_dma_xor_val(dma_chan, dma_srcs,
1076+
IOP_ADMA_NUM_SRC_TEST + 1, PAGE_SIZE,
1077+
&zero_sum_result,
1078+
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
10791079

10801080
cookie = iop_adma_tx_submit(tx);
10811081
iop_adma_issue_pending(dma_chan);
@@ -1192,9 +1192,9 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
11921192
dma_dev->max_xor = iop_adma_get_max_xor();
11931193
dma_dev->device_prep_dma_xor = iop_adma_prep_dma_xor;
11941194
}
1195-
if (dma_has_cap(DMA_ZERO_SUM, dma_dev->cap_mask))
1196-
dma_dev->device_prep_dma_zero_sum =
1197-
iop_adma_prep_dma_zero_sum;
1195+
if (dma_has_cap(DMA_XOR_VAL, dma_dev->cap_mask))
1196+
dma_dev->device_prep_dma_xor_val =
1197+
iop_adma_prep_dma_xor_val;
11981198
if (dma_has_cap(DMA_INTERRUPT, dma_dev->cap_mask))
11991199
dma_dev->device_prep_dma_interrupt =
12001200
iop_adma_prep_dma_interrupt;
@@ -1249,7 +1249,7 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
12491249

12501250
if (dma_has_cap(DMA_XOR, dma_dev->cap_mask) ||
12511251
dma_has_cap(DMA_MEMSET, dma_dev->cap_mask)) {
1252-
ret = iop_adma_xor_zero_sum_self_test(adev);
1252+
ret = iop_adma_xor_val_self_test(adev);
12531253
dev_dbg(&pdev->dev, "xor self test returned %d\n", ret);
12541254
if (ret)
12551255
goto err_free_iop_chan;
@@ -1259,10 +1259,10 @@ static int __devinit iop_adma_probe(struct platform_device *pdev)
12591259
"( %s%s%s%s%s%s%s%s%s%s)\n",
12601260
dma_has_cap(DMA_PQ_XOR, dma_dev->cap_mask) ? "pq_xor " : "",
12611261
dma_has_cap(DMA_PQ_UPDATE, dma_dev->cap_mask) ? "pq_update " : "",
1262-
dma_has_cap(DMA_PQ_ZERO_SUM, dma_dev->cap_mask) ? "pq_zero_sum " : "",
1262+
dma_has_cap(DMA_PQ_VAL, dma_dev->cap_mask) ? "pq_val " : "",
12631263
dma_has_cap(DMA_XOR, dma_dev->cap_mask) ? "xor " : "",
12641264
dma_has_cap(DMA_DUAL_XOR, dma_dev->cap_mask) ? "dual_xor " : "",
1265-
dma_has_cap(DMA_ZERO_SUM, dma_dev->cap_mask) ? "xor_zero_sum " : "",
1265+
dma_has_cap(DMA_XOR_VAL, dma_dev->cap_mask) ? "xor_val " : "",
12661266
dma_has_cap(DMA_MEMSET, dma_dev->cap_mask) ? "fill " : "",
12671267
dma_has_cap(DMA_MEMCPY_CRC32C, dma_dev->cap_mask) ? "cpy+crc " : "",
12681268
dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask) ? "cpy " : "",

‎drivers/md/raid5.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ static void ops_run_check(struct stripe_head *sh)
854854
xor_srcs[count++] = dev->page;
855855
}
856856

857-
tx = async_xor_zero_sum(xor_dest, xor_srcs, 0, count, STRIPE_SIZE,
857+
tx = async_xor_val(xor_dest, xor_srcs, 0, count, STRIPE_SIZE,
858858
&sh->ops.zero_sum_result, 0, NULL, NULL, NULL);
859859

860860
atomic_inc(&sh->count);

‎include/linux/async_tx.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ async_xor(struct page *dest, struct page **src_list, unsigned int offset,
117117
dma_async_tx_callback cb_fn, void *cb_fn_param);
118118

119119
struct dma_async_tx_descriptor *
120-
async_xor_zero_sum(struct page *dest, struct page **src_list,
120+
async_xor_val(struct page *dest, struct page **src_list,
121121
unsigned int offset, int src_cnt, size_t len,
122122
u32 *result, enum async_tx_flags flags,
123123
struct dma_async_tx_descriptor *depend_tx,

‎include/linux/dmaengine.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ enum dma_transaction_type {
5555
DMA_PQ_XOR,
5656
DMA_DUAL_XOR,
5757
DMA_PQ_UPDATE,
58-
DMA_ZERO_SUM,
59-
DMA_PQ_ZERO_SUM,
58+
DMA_XOR_VAL,
59+
DMA_PQ_VAL,
6060
DMA_MEMSET,
6161
DMA_MEMCPY_CRC32C,
6262
DMA_INTERRUPT,
@@ -214,7 +214,7 @@ struct dma_async_tx_descriptor {
214214
* @device_free_chan_resources: release DMA channel's resources
215215
* @device_prep_dma_memcpy: prepares a memcpy operation
216216
* @device_prep_dma_xor: prepares a xor operation
217-
* @device_prep_dma_zero_sum: prepares a zero_sum operation
217+
* @device_prep_dma_xor_val: prepares a xor validation operation
218218
* @device_prep_dma_memset: prepares a memset operation
219219
* @device_prep_dma_interrupt: prepares an end of chain interrupt operation
220220
* @device_prep_slave_sg: prepares a slave dma operation
@@ -243,7 +243,7 @@ struct dma_device {
243243
struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
244244
struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
245245
unsigned int src_cnt, size_t len, unsigned long flags);
246-
struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
246+
struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)(
247247
struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
248248
size_t len, u32 *result, unsigned long flags);
249249
struct dma_async_tx_descriptor *(*device_prep_dma_memset)(

0 commit comments

Comments
 (0)