Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tony Nguyen and committed by
Jeff Kirsher
8f529ff9 a03499d6

+6 -2
+6 -2
drivers/net/ethernet/intel/ice/ice_main.c
··· 2873 2873 struct ice_vsi *vsi = np->vsi; 2874 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 2879 if (features & NETIF_F_RXHASH && !(netdev->features & NETIF_F_RXHASH)) 2877 2880 ret = ice_vsi_manage_rss_lut(vsi, true); 2878 2881 else if (!(features & NETIF_F_RXHASH) && ··· 2888 2885 else if (!(features & NETIF_F_HW_VLAN_CTAG_RX) && 2889 2886 (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) 2890 2887 ret = ice_vsi_manage_vlan_stripping(vsi, false); 2891 - else if ((features & NETIF_F_HW_VLAN_CTAG_TX) && 2892 - !(netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) 2888 + 2889 + if ((features & NETIF_F_HW_VLAN_CTAG_TX) && 2890 + !(netdev->features & NETIF_F_HW_VLAN_CTAG_TX)) 2893 2891 ret = ice_vsi_manage_vlan_insertion(vsi); 2894 2892 else if (!(features & NETIF_F_HW_VLAN_CTAG_TX) && 2895 2893 (netdev->features & NETIF_F_HW_VLAN_CTAG_TX))