]> git.ipfire.org Git - thirdparty/linux.git/commit
Merge branch 'net-mlx5-hws-optimize-matchers-icm-usage'
authorJakub Kicinski <kuba@kernel.org>
Tue, 8 Jul 2025 02:12:19 +0000 (19:12 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Jul 2025 02:12:19 +0000 (19:12 -0700)
commit0234362d0af4649bc2ff745e94d06d0c6f0a46ce
tree96952bcbc8d134201f8e53749a0d37521817568f
parent4b62261def0b607133b6dc6d916d830006253b27
parenta9aec713d0d9d6c3d918df26c61ee42ee2c28676
Merge branch 'net-mlx5-hws-optimize-matchers-icm-usage'

Mark Bloch says:

====================
net/mlx5: HWS, Optimize matchers ICM usage

This series optimizes ICM usage for unidirectional rules and
empty matchers and with the last patch we make hardware steering
the default FDB steering provider for NICs that don't support software
steering.

Hardware steering (HWS) uses a type of rule table container (RTC) that
is unidirectional, so matchers consist of two RTCs to accommodate
bidirectional rules.

This small series enables resizing the two RTCs independently by
tracking the number of rules separately. For extreme cases where all
rules are unidirectional, this results in saving close to half the
memory footprint.

Results for inserting 1M unidirectional rules using a simple module:

Pages Memory
Before this patch: 300k 1.5GiB
After this patch: 160k 900MiB

The 'Pages' column measures the number of 4KiB pages the device requests
for itself (the ICM).

The 'Memory' column is the difference between peak usage and baseline
usage (before starting the test) as reported by `free -h`.

In addition, second to last patch of the series handles a case where all
the matcher's rules were deleted: the large RTCs of the matcher are no
longer required, and we can save some more ICM by shrinking the matcher
to its initial size.

Finally the last patch makes hardware steering the default mode
when in swichdev for NICs that don't have software steering support.
====================

Link: https://patch.msgid.link/20250703185431.445571-1-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>