Skip to content

Commit 4cdb61d

Browse files
gal-pressmangregkh
authored andcommitted
net/mlx5e: Fix features not applied during netdev registration
[ Upstream commit 9994ad4 ] mlx5e_fix_features() returns early when the netdevice is not present. This is correct during profile transitions where priv is cleared, but it also incorrectly blocks feature fixups during register_netdev(), when the device is also not yet present. It is not trivial to distinguish between both cases as we cannot use priv to carry state, and in both cases reg_state == NETREG_REGISTERED. Force a netdev features update after register_netdev() completes, where the device is present and fix_features() can actually work. This is not a pretty solution, as it results in an additional features update call (register_netdevice() already calls __netdev_update_features() internally), but it is the simplest, cleanest, and most robust way I found to fix this issue after multiple attempts. This fixes an issue on systems where CQE compression is enabled by default, RXHASH remains enabled after registration despite the two features being mutually exclusive. Fixes: ab4b01b ("net/mlx5e: Verify dev is present for fix features ndo") Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260409202852.158059-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8a4a748 commit 4cdb61d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6466,6 +6466,14 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
64666466
goto err_resume;
64676467
}
64686468

6469+
/* mlx5e_fix_features() returns early when the device is not present
6470+
* to avoid dereferencing cleared priv during profile changes.
6471+
* This also causes it to be a no-op during register_netdev(), where
6472+
* the device is not yet present.
6473+
* Trigger an additional features update that will actually work.
6474+
*/
6475+
mlx5e_update_features(netdev);
6476+
64696477
mlx5e_dcbnl_init_app(priv);
64706478
mlx5_core_uplink_netdev_set(mdev, netdev);
64716479
mlx5e_params_print_info(mdev, &priv->channels.params);

0 commit comments

Comments
 (0)