mlx5e: Make TLS tag zones unmanaged

These zones are cache zones used to allocate TLS offload contexts from
firmware.  Releasing items from the cache is a sleepable operation due
to the need to await a response from the firmware command freeing the
tag, so items cannot be reclaimed from the zone in non-sleepable
contexts.  Since the cache size is limited by firmware limits, avoid
this by setting UMA_ZONE_UNMANAGED to avoid reclamation by uma_timeout()
and the low memory handler.

Reviewed by:	hselasky, kib
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34142
This commit is contained in:
Mark Johnston 2022-02-15 09:03:31 -05:00
parent 389a3fa693
commit 235ed6a486
2 changed files with 4 additions and 2 deletions

View File

@ -165,7 +165,8 @@ mlx5e_tls_init(struct mlx5e_priv *priv)
ptls->zone = uma_zcache_create(ptls->zname,
sizeof(struct mlx5e_tls_tag), NULL, NULL, NULL, NULL,
mlx5e_tls_tag_import, mlx5e_tls_tag_release, priv->mdev, 0);
mlx5e_tls_tag_import, mlx5e_tls_tag_release, priv->mdev,
UMA_ZONE_UNMANAGED);
/* shared between RX and TX TLS */
ptls->max_resources = 1U << (MLX5_CAP_GEN(priv->mdev, log_max_dek) - 1);

View File

@ -459,7 +459,8 @@ mlx5e_tls_rx_init(struct mlx5e_priv *priv)
ptls->zone = uma_zcache_create(ptls->zname,
sizeof(struct mlx5e_tls_rx_tag), NULL, NULL, NULL, NULL,
mlx5e_tls_rx_tag_import, mlx5e_tls_rx_tag_release, priv->mdev, 0);
mlx5e_tls_rx_tag_import, mlx5e_tls_rx_tag_release, priv->mdev,
UMA_ZONE_UNMANAGED);
/* shared between RX and TX TLS */
ptls->max_resources = 1U << (MLX5_CAP_GEN(priv->mdev, log_max_dek) - 1);