crypto: marvell - Copy IV vectors by DMA transfers for acipher requests
Add a TDMA descriptor at the end of the request for copying the output IV vector via a DMA transfer. This is a good way for offloading as much as processing as possible to the DMA and the crypto engine. This is also required for processing multiple cipher requests in chained mode, otherwise the content of the IV vector would be overwritten by the last processed request. Signed-off-by: Romain Perier <romain.perier@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:

committed by
Herbert Xu

orang tua
b99acf79a1
melakukan
bac8e805a3
@@ -275,6 +275,7 @@ struct mv_cesa_op_ctx {
|
||||
#define CESA_TDMA_DUMMY 0
|
||||
#define CESA_TDMA_DATA 1
|
||||
#define CESA_TDMA_OP 2
|
||||
#define CESA_TDMA_IV 3
|
||||
|
||||
/**
|
||||
* struct mv_cesa_tdma_desc - TDMA descriptor
|
||||
@@ -390,6 +391,7 @@ struct mv_cesa_dev_dma {
|
||||
struct dma_pool *op_pool;
|
||||
struct dma_pool *cache_pool;
|
||||
struct dma_pool *padding_pool;
|
||||
struct dma_pool *iv_pool;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -790,6 +792,9 @@ mv_cesa_tdma_desc_iter_init(struct mv_cesa_tdma_chain *chain)
|
||||
memset(chain, 0, sizeof(*chain));
|
||||
}
|
||||
|
||||
int mv_cesa_dma_add_iv_op(struct mv_cesa_tdma_chain *chain, dma_addr_t src,
|
||||
u32 size, u32 flags, gfp_t gfp_flags);
|
||||
|
||||
struct mv_cesa_op_ctx *mv_cesa_dma_add_op(struct mv_cesa_tdma_chain *chain,
|
||||
const struct mv_cesa_op_ctx *op_templ,
|
||||
bool skip_ctx,
|
||||
|
Reference in New Issue
Block a user