git: 235ed6a48629 - main - mlx5e: Make TLS tag zones unmanaged
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Feb 2022 14:25:54 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=235ed6a48629771e4bc89141fdfe865b71024758
commit 235ed6a48629771e4bc89141fdfe865b71024758
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-02-15 14:03:31 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-02-15 14:25:34 +0000
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
---
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 3 ++-
sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
index f6ac2200f076..056202f814f7 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
@@ -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);
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
index 5ac60c51a1db..462556bd9d99 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
@@ -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);