aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_main.c
diff options
context:
space:
mode:
authorTony Nguyen <anthony.l.nguyen@intel.com>2019-04-16 13:21:23 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-05-04 17:33:44 -0400
commit8f529ff912073f778e3cd74e87fb69a36499fc2f (patch)
tree2a41d90967490b77a334c0d9167b4ea35bb30bf8 /drivers/net/ethernet/intel/ice/ice_main.c
parenta03499d614b8d86a7edb4fa0c20e87003248d643 (diff)
ice: Separate if conditions for ice_set_features()
Set features can have multiple features turned on|off in a single call. Grouping these all in an if/else means after one condition is met, other conditions/features will not be evaluated. Break the if/else statements by feature to ensure all features will be handled properly. Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_main.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 2352b4129a62..aa832d9b2458 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2873,6 +2873,9 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
2873 struct ice_vsi *vsi = np->vsi; 2873 struct ice_vsi *vsi = np->vsi;
2874 int ret = 0; 2874 int ret = 0;
2875 2875
2876 /* Multiple features can be changed in one call so keep features in
2877 * separate if/else statements to guarantee each feature is checked
2878 */
2876 if (features & NETIF_F_RXHASH && !(netdev->features & NETIF_F_RXHASH)) 2879 if (features & NETIF_F_RXHASH && !(netdev->features & NETIF_F_RXHASH))
2877 ret = ice_vsi_manage_rss_lut(vsi, true); 2880 ret = ice_vsi_manage_rss_lut(vsi, true);
2878 else if (!(features & NETIF_F_RXHASH) && 2881 else if (!(features & NETIF_F_RXHASH) &&
@@ -2885,8 +2888,9 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
2885 else if (!(features & NETIF_F_HW_VLAN_CTAG_RX) && 2888 else if (!(features & NETIF_F_HW_VLAN_CTAG_RX) &&
2886 (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) 2889 (netdev->features & NETIF_F_HW_VLAN_CTAG_RX))
2887 ret = ice_vsi_manage_vlan_stripping(vsi, false); 2890 ret = ice_vsi_manage_vlan_stripping(vsi, false);
2888 else if ((features & NETIF_F_HW_VLAN_CTAG_TX) && 2891
2889 !(netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) 2892 if ((features & NETIF_F_HW_VLAN_CTAG_TX) &&
2893 !(netdev->features & NETIF_F_HW_VLAN_CTAG_TX))
2890 ret = ice_vsi_manage_vlan_insertion(vsi); 2894 ret = ice_vsi_manage_vlan_insertion(vsi);
2891 else if (!(features & NETIF_F_HW_VLAN_CTAG_TX) && 2895 else if (!(features & NETIF_F_HW_VLAN_CTAG_TX) &&
2892 (netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) 2896 (netdev->features & NETIF_F_HW_VLAN_CTAG_TX))