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)
commit75b81ce719b79565eb0b39aa9954b6e11a5e73bf
tree90bb66dcc4e5990e7afebc5c11573ccf62e9a381
parent4b7d4363f14a0398eca48c7e96e46120c5eb6a96
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: 0e405443e803 ("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