OSDN Git Service

net/tls: Combined memory allocation for decryption request
authorVakul Garg <vakul.garg@nxp.com>
Fri, 10 Aug 2018 15:16:41 +0000 (20:46 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Aug 2018 15:41:09 +0000 (08:41 -0700)
commit0b243d004ea640875115d1500ec429a3e9f9fae9
tree2388709906c2696baa252891f4845d8a680b8369
parent78cbac647e61fb20ad615075949ea77cedf74e0c
net/tls: Combined memory allocation for decryption request

For preparing decryption request, several memory chunks are required
(aead_req, sgin, sgout, iv, aad). For submitting the decrypt request to
an accelerator, it is required that the buffers which are read by the
accelerator must be dma-able and not come from stack. The buffers for
aad and iv can be separately kmalloced each, but it is inefficient.
This patch does a combined allocation for preparing decryption request
and then segments into aead_req || sgin || sgout || iv || aad.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tls.h
net/tls/tls_sw.c