For me a scatter/gather dma means: a separate scatterlist for “input” and one for “output”. Those lists don’t have to match. Depending on the operation, the total length should match, but not the individual segments. The input could be e.g. 4 segments and the output only 2 for a given length.
This hardware expects an “input (physical) address”, an “output (physical) address” and a “length”. So if I get two scatterlist via the API call to the crypto driver it is very likely that they are not the same fragmented.
Scatterlist to a linear buffer copy, do the DMA on the buffer. DMA back into a buffer and coy the buffer back into a scatterlist. However this seems to defeat a “zero copy” approach which should be possible using DMA.
As for using it via the XFRM offload API, then it gets a SKB which might be non-linear. This would be solved by a system call to make the SKB linear again. (Possible advice the user to always use linear SKB for the underlying network.)
|