lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 29 May 2009 14:42:15 +0100
From:	"Sosnowski, Maciej" <maciej.sosnowski@...el.com>
To:	"Williams, Dan J" <dan.j.williams@...el.com>
CC:	"neilb@...e.de" <neilb@...e.de>,
	"linux-raid@...r.kernel.org" <linux-raid@...r.kernel.org>,
	"maan@...temlinux.org" <maan@...temlinux.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"yur@...raft.com" <yur@...raft.com>,
	"hpa@...or.com" <hpa@...or.com>
Subject: RE: [PATCH v2 09/11] async_tx: add support for asynchronous RAID6
 recovery operations

Dan Williams wrote:
>  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.
> 
> [ Impact: asynchronous raid6 recovery routines for 2data and datap cases ]
> 
> Cc: Yuri Tikhonov <yur@...raft.com>
> Cc: Ilya Yanok <yanok@...raft.com>
> Cc: H. Peter Anvin <hpa@...or.com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> ---
>  crypto/async_tx/Kconfig             |    5 +
>  crypto/async_tx/Makefile            |    1
>  crypto/async_tx/async_raid6_recov.c |  292 +++++++++++++++++++++++++++++++++++
>  include/linux/async_tx.h            |    8 +
>  4 files changed, 306 insertions(+), 0 deletions(-)
>  create mode 100644 crypto/async_tx/async_raid6_recov.c

Acked-by: Maciej Sosnowski <maciej.sosnowski@...el.com>
 
With a minor comment:

> +static struct dma_async_tx_descriptor *
> +async_mult(struct page *dest, struct page *src, u8 coef, size_t len,
> +          struct async_submit_ctl *submit)
> +{
> +       struct dma_chan *chan = async_tx_find_channel(submit, DMA_PQ,
> +                                                     &dest, 1, srcs, 2, len);
> +       struct dma_device *dma = chan ? chan->device : NULL;
> +       const u8 *qmul; /* Q multiplier table */
> +       u8 *d, *s;
> +
> +       if (dma) {
> +               dma_addr_t dma_dest[2];
> +               dma_addr_t dma_src[1];
> +               struct device *dev = dma->dev;
> +               struct dma_async_tx_descriptor *tx;
> +               enum dma_ctrl_flags dma_flags = DMA_PREP_PQ_DISABLE_P;
> +
> +               dma_dest[1] = dma_map_page(dev, dest, 0, len,
> DMA_BIDIRECTIONAL);
> +               dma_src[0] = dma_map_page(dev, src, 0, len, DMA_TO_DEVICE);
> +               tx = dma->device_prep_dma_pq(chan, dma_dest, dma_src, 1, &coef,
> +                                            len, dma_flags);
> +               if (tx) {
> +                       async_tx_submit(chan, tx, submit);
> +                       return tx;
> +               }
> +       }

How about adding "run the operation synchronously" comment at this point, just like it is in async_sum_product?

Maciej--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ