Skip to content

Commit 7bb5c68

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 b2c49fb commit 7bb5c68

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
@@ -6756,6 +6756,14 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
67566756
goto err_resume;
67576757
}
67586758

6759+
/* mlx5e_fix_features() returns early when the device is not present
6760+
* to avoid dereferencing cleared priv during profile changes.
6761+
* This also causes it to be a no-op during register_netdev(), where
6762+
* the device is not yet present.
6763+
* Trigger an additional features update that will actually work.
6764+
*/
6765+
mlx5e_update_features(netdev);
6766+
67596767
mlx5e_dcbnl_init_app(priv);
67606768
mlx5_core_uplink_netdev_set(mdev, netdev);
67616769
mlx5e_params_print_info(mdev, &priv->channels.params);

0 commit comments

Comments
 (0)