]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: IPoIB, Block queue count configuration when sub interfaces are present
authorDragos Tatulea <dtatulea@nvidia.com>
Thu, 15 Dec 2022 11:02:38 +0000 (13:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:29 +0000 (11:58 +0100)
commita561907355d80afb8ae69bafbcbf3721d04840e2
treedd48093c3ec2d1608ebf54c69b478166c7c551c1
parent915b0efa2ac11d16ef73d6c039772c50886961a2
net/mlx5e: IPoIB, Block queue count configuration when sub interfaces are present

[ Upstream commit 39fe7937444e3be27bb60d3ef4813bbdc1a3114b ]

PKEY sub interfaces share the receive queues with the parent interface.
While setting the sub interface queue count is not supported, it is
currently possible to change the number of queues of the parent interface.
Thus we can end up with inconsistent queue sizes between the parent and its
sub interfaces.

This change disallows setting the queue count on the parent interface when
sub interfaces are present.

This is achieved by introducing an explicit reference to the parent netdev
in the mlx5i_priv of the child interface. An additional counter is also
required on the parent side to detect when sub interfaces are attached and
for proper cleanup.

The rtnl lock is taken during the ethtool op and the sub interface
ndo_init/uninit ops. There is no race here around counting the sub
interfaces, reading the sub interfaces and setting the number of
channels. The ASSERT_RTNL was added to document that.

Fixes: d8c04fd59ea2 ("net/mlx5e: Use dynamic per-channel allocations in stats")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c