]> www.infradead.org Git - users/willy/pagecache.git/commit
net/mlx5: HWS, reduce memory consumption of a matcher struct
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Thu, 2 Jan 2025 18:14:07 +0000 (20:14 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Jan 2025 00:33:40 +0000 (16:33 -0800)
commit05e3c287b98795cf01d829d29841179cef3fb9ce
tree7eec9fdfb1e1af8b00fd4516be2dbee68bee9fe7
parentad4da6cc36ace35d80a292bfeaac49e63e9e26eb
net/mlx5: HWS, reduce memory consumption of a matcher struct

Instead of having a large array of action templates allocated with
kmalloc, have smaller array and allocate it with kvmalloc.

The size of the array represents the max number of AT attach
operations for the same matcher. This number is not expected
to be very high. In any case, when the limit is reached, the
next attempt to attach new AT will result in creation of a new
matcher and moving all the rules to this matcher.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250102181415.1477316-9-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.h
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/matcher.c