linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: caam/qi2 - Increase napi budget to process more caam responses
@ 2019-07-18 11:29 Vakul Garg
  2019-07-19 16:37 ` Horia Geanta
  2019-07-26 12:35 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Vakul Garg @ 2019-07-18 11:29 UTC (permalink / raw)
  To: linux-crypto; +Cc: Horia Geanta, Aymen Sghaier, herbert, Vakul Garg

While running ipsec processing for traffic through multiple network
interfaces, it is observed that caam driver gets less time to poll
responses from caam block compared to ethernet driver. This is because
ethernet driver has as many napi instances per cpu as the number of
ethernet interfaces in system. Therefore, caam driver's napi executes
lesser than the ethernet driver's napi instances. This results in
situation that we end up submitting more requests to caam (which it is
able to finish off quite fast), but don't dequeue the responses at same
rate. This makes caam response FQs bloat with large number of frames. In
some situations, it makes kernel crash due to out-of-memory. To prevent
it We increase the napi budget of dpseci driver to a big value so that
caam driver is able to drain its response queues at enough rate.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
---
 drivers/crypto/caam/caamalg_qi2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/caam/caamalg_qi2.h b/drivers/crypto/caam/caamalg_qi2.h
index 8646a7883c63..aa0aff4cd25b 100644
--- a/drivers/crypto/caam/caamalg_qi2.h
+++ b/drivers/crypto/caam/caamalg_qi2.h
@@ -15,7 +15,7 @@
 
 #define DPAA2_CAAM_STORE_SIZE	16
 /* NAPI weight *must* be a multiple of the store size. */
-#define DPAA2_CAAM_NAPI_WEIGHT	64
+#define DPAA2_CAAM_NAPI_WEIGHT	512
 
 /* The congestion entrance threshold was chosen so that on LS2088
  * we support the maximum throughput for the available memory
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: caam/qi2 - Increase napi budget to process more caam responses
  2019-07-18 11:29 [PATCH] crypto: caam/qi2 - Increase napi budget to process more caam responses Vakul Garg
@ 2019-07-19 16:37 ` Horia Geanta
  2019-07-26 12:35 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Horia Geanta @ 2019-07-19 16:37 UTC (permalink / raw)
  To: Vakul Garg, linux-crypto; +Cc: Aymen Sghaier, herbert

On 7/18/2019 2:29 PM, Vakul Garg wrote:
> While running ipsec processing for traffic through multiple network
> interfaces, it is observed that caam driver gets less time to poll
> responses from caam block compared to ethernet driver. This is because
> ethernet driver has as many napi instances per cpu as the number of
> ethernet interfaces in system. Therefore, caam driver's napi executes
> lesser than the ethernet driver's napi instances. This results in
> situation that we end up submitting more requests to caam (which it is
> able to finish off quite fast), but don't dequeue the responses at same
> rate. This makes caam response FQs bloat with large number of frames. In
> some situations, it makes kernel crash due to out-of-memory. To prevent
> it We increase the napi budget of dpseci driver to a big value so that
> caam driver is able to drain its response queues at enough rate.
> 
> Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: caam/qi2 - Increase napi budget to process more caam responses
  2019-07-18 11:29 [PATCH] crypto: caam/qi2 - Increase napi budget to process more caam responses Vakul Garg
  2019-07-19 16:37 ` Horia Geanta
@ 2019-07-26 12:35 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2019-07-26 12:35 UTC (permalink / raw)
  To: Vakul Garg; +Cc: linux-crypto, horia.geanta, aymen.sghaier, vakul.garg

Vakul Garg <vakul.garg@nxp.com> wrote:
> While running ipsec processing for traffic through multiple network
> interfaces, it is observed that caam driver gets less time to poll
> responses from caam block compared to ethernet driver. This is because
> ethernet driver has as many napi instances per cpu as the number of
> ethernet interfaces in system. Therefore, caam driver's napi executes
> lesser than the ethernet driver's napi instances. This results in
> situation that we end up submitting more requests to caam (which it is
> able to finish off quite fast), but don't dequeue the responses at same
> rate. This makes caam response FQs bloat with large number of frames. In
> some situations, it makes kernel crash due to out-of-memory. To prevent
> it We increase the napi budget of dpseci driver to a big value so that
> caam driver is able to drain its response queues at enough rate.
> 
> Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
> ---
> drivers/crypto/caam/caamalg_qi2.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-26 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 11:29 [PATCH] crypto: caam/qi2 - Increase napi budget to process more caam responses Vakul Garg
2019-07-19 16:37 ` Horia Geanta
2019-07-26 12:35 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).