HomeFreeBSD

mlx5: Preallocate ktls tags asynchronously

Description

mlx5: Preallocate ktls tags asynchronously

Change tag preallocation to happen asynchronously when an interface is
brought up, so as to reduce boot times when preallocating tags.

  • A new mlx5-tls-prealloc_wq is allocated when preallocation is desired, and started when an interface is opened
  • The bulk of the prealloc code remains the same, except the allocations are now M_NOWAIT. M_NOWAIT is needed because, since the preallocation is done asynchronously, and since tag allocation is not instant, we could race with a real TLS session trying to allocate a tag. Note that in this case, we take allocation failure as a sign that we were unable to obtain the entire zone due to there being other consumers. This was suggested by @markj as a way to keep things simple, after discussing why uma_zone_get_cur() didn't immediately report a fully allocated zone. If this turns out to be problematic, we could use uma_zone_set_maxaction() to stop pre-allocations (also suggested by Mark)

Reviewed by: glebius, kib, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D53570

Details

Provenance
gallatinAuthored on Nov 5 2025, 11:58 PM
Reviewer
glebius
Differential Revision
D53570: mlx5: Preallocate ktls tags asynchronously
Parents
rGa7c558b4ade8: inetd.8: Remove the enumeration of examples
Branches
Unknown
Tags
Unknown