crypto: caam/jr - optimize job ring enqueue and dequeue operations
authorVakul Garg <vakul.garg@nxp.com>
Tue, 5 Mar 2019 18:03:14 +0000 (18:03 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Mar 2019 12:57:26 +0000 (20:57 +0800)
commit16c4dd83a1b2a23004e2728b7c6222592e64e354
treecf68af53279ebe79019009eb65ee2e3bdcda087c
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b
crypto: caam/jr - optimize job ring enqueue and dequeue operations

Instead of reading job ring's occupancy registers for every req/rsp
enqueued/dequeued respectively, we read these registers once and store
them in memory. After completing a job enqueue/dequeue, we decrement
these values. When these values become zero, we refresh the snapshot of
job ring's occupancy registers. This eliminates need of expensive device
register read operations for every job enqueued and dequeued and hence
makes caam_jr_enqueue() and caam_jr_dequeue() faster. The performance of
kernel ipsec improved by about 6% on ls1028 (for frame size 408 bytes).

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/intern.h
drivers/crypto/caam/jr.c