Skip to content

Commit 0a82a62

Browse files
committed
async_tx: add support for asynchronous RAID6 recovery operations
async_raid6_2data_recov() recovers two data disk failures async_raid6_datap_recov() recovers a data disk and the P disk These routines are a port of the synchronous versions found in drivers/md/raid6recov.c. The primary difference is breaking out the xor operations into separate calls to async_xor. Two helper routines are introduced to perform scalar multiplication where needed. async_sum_product() multiplies two sources by scalar coefficients and then sums (xor) the result. async_mult() simply multiplies a single source by a scalar. This implemention also includes, in contrast to the original synchronous-only code, special case handling for the 4-disk and 5-disk array cases. In these situations the default N-disk algorithm will present 0-source or 1-source operations to dma devices. To cover for dma devices where the minimum source count is 2 we implement 4-disk and 5-disk handling in the recovery code. [ Impact: asynchronous raid6 recovery routines for 2data and datap cases ] Cc: Yuri Tikhonov <yur@emcraft.com> Cc: Ilya Yanok <yanok@emcraft.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: David Woodhouse <David.Woodhouse@intel.com> 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 b2f46fd commit 0a82a62

File tree

5 files changed

+466
-0
lines changed

5 files changed

+466
-0
lines changed

Documentation/crypto/async-tx-api.txt

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ xor_val - xor a series of source buffers and set a flag if the
6767
pq - generate the p+q (raid6 syndrome) from a series of source buffers
6868
pq_val - validate that a p and or q buffer are in sync with a given series of
6969
sources
70+
datap - (raid6_datap_recov) recover a raid6 data block and the p block
71+
from the given sources
72+
2data - (raid6_2data_recov) recover 2 raid6 data blocks from the given
73+
sources
7074

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

crypto/async_tx/Kconfig

+5
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ config ASYNC_PQ
1818
tristate
1919
select ASYNC_CORE
2020

21+
config ASYNC_RAID6_RECOV
22+
tristate
23+
select ASYNC_CORE
24+
select ASYNC_PQ
25+

crypto/async_tx/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ obj-$(CONFIG_ASYNC_MEMCPY) += async_memcpy.o
33
obj-$(CONFIG_ASYNC_MEMSET) += async_memset.o
44
obj-$(CONFIG_ASYNC_XOR) += async_xor.o
55
obj-$(CONFIG_ASYNC_PQ) += async_pq.o
6+
obj-$(CONFIG_ASYNC_RAID6_RECOV) += async_raid6_recov.o

0 commit comments

Comments
 (0)