]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: Multi-threaded calls to TX tls_dev_del
authorTariq Toukan <tariqt@nvidia.com>
Wed, 27 Jul 2022 09:43:42 +0000 (12:43 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Jul 2022 04:50:54 +0000 (21:50 -0700)
commitf8bca99b3f34e5d639873c3e01e845678d434198
treeef573dc17f1c5fbc6842a2b42f7cb2223615bc06
parent9a0f611f2a9cda36de014cae889c2e17e628636a
net/tls: Multi-threaded calls to TX tls_dev_del

Multiple TLS device-offloaded contexts can be added in parallel via
concurrent calls to .tls_dev_add, while calls to .tls_dev_del are
sequential in tls_device_gc_task.

This is not a sustainable behavior. This creates a rate gap between add
and del operations (addition rate outperforms the deletion rate).  When
running for enough time, the TLS device resources could get exhausted,
failing to offload new connections.

Replace the single-threaded garbage collector work with a per-context
alternative, so they can be handled on several cores in parallel. Use
a new dedicated destruct workqueue for this.

Tested with mlx5 device:
Before: 22141 add/sec,   103 del/sec
After:  11684 add/sec, 11684 del/sec

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/tls.h
net/tls/tls_device.c