]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Don't override netdev features field unless in error flow
authorGal Pressman <galp@mellanox.com>
Wed, 10 Jan 2018 15:11:11 +0000 (17:11 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 12 Jan 2018 00:01:49 +0000 (02:01 +0200)
commit4606bb368fb53556bcfe4b3eb9a5a0127c5776ca
tree90bb66dcc4e5990e7afebc5c11573ccf62e9a381
parent6149bf214b732112927e8d40f860c91d122c48a6
net/mlx5e: Don't override netdev features field unless in error flow

Set features function sets dev->features in order to keep track of which
features were successfully changed and which weren't (in case the user
asks for more than one change in a single command).

This breaks the logic in __netdev_update_features which assumes that
dev->features is not changed on success and checks for diffs between
features and dev->features (diffs that might not exist at this point
because of the driver override).

The solution is to keep track of successful/failed feature changes and
assign them to dev->features in case of failure only.

Fixes: e067279a8780 ("net/mlx5e: Improve set features ndo resiliency")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c