]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Support multiple RSS contexts
authorTariq Toukan <tariqt@nvidia.com>
Mon, 16 Aug 2021 13:30:04 +0000 (16:30 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 16 Aug 2021 23:17:28 +0000 (16:17 -0700)
commita8a8eb8a9120c123c5949909a296836171bccb6d
tree1e8019c78cba18c33ef6117c4e7bad4c88074d5a
parentb8d1fdbf6e5f1152911dc793fe5fa1781c9a50a1
net/mlx5e: Support multiple RSS contexts

Add support to multiple RSS contexts. Resources of the non-default
RSS contexts are allocated and created on demand. Each RSS context
can be controlled and configured separately, via the implemented
ethtool ops. Here we limit the num of total contexts to 16.

We do not enforce any kind of new limitation over the indirection table
content. More specifically, two separate contexts can be configured to
fully or partially point to the same set of receive rings.

The default RSS context (index 0) is created with its full set of TIRs.
All other contexts are created with an empty set, then TIRs are added
upon first usage when steering rules are added.
We use a reference counting mechanism to make sure an RSS context is
not removed before the rules pointing to it.

Block ethtool set_channels operations when multiple RSS contexts exist,
as currently the kernel doesn't protect against inconsistent channels
configs that break non-default RSS contexts.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/rss.c
drivers/net/ethernet/mellanox/mlx5/core/en/rss.h
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c