ice: Remove duplicate addition of VLANs in replay path
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Fri, 26 Oct 2018 17:40:54 +0000 (10:40 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 6 Nov 2018 20:46:47 +0000 (12:46 -0800)
ice_restore_vlan and active_vlans were originally put in place to
reprogram VLAN filters in the replay path. This is now done as part
of the much broader VSI rebuild/replay framework. So remove both
ice_restore_vlan and active_vlans

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>
drivers/net/ethernet/intel/ice/ice.h
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c

index e5b37fa60884415fdd7ef91981cf66f0b0fc3948..1639e955f15803b7e2bfbe0d0f2a2ec2809fafce 100644 (file)
@@ -191,7 +191,6 @@ struct ice_vsi {
        u64 tx_linearize;
        DECLARE_BITMAP(state, __ICE_STATE_NBITS);
        DECLARE_BITMAP(flags, ICE_VSI_FLAG_NBITS);
-       unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
        unsigned int current_netdev_flags;
        u32 tx_restart;
        u32 tx_busy;
index aee22f11a41aaa2fc32742f9c78039ef5b5fa84d..338abb1b9233881791ed99328ddef19b2bb1bf41 100644 (file)
@@ -1622,7 +1622,6 @@ static int ice_vlan_rx_add_vid(struct net_device *netdev,
 {
        struct ice_netdev_priv *np = netdev_priv(netdev);
        struct ice_vsi *vsi = np->vsi;
-       int ret;
 
        if (vid >= VLAN_N_VID) {
                netdev_err(netdev, "VLAN id requested %d is out of range %d\n",
@@ -1635,7 +1634,8 @@ static int ice_vlan_rx_add_vid(struct net_device *netdev,
 
        /* Enable VLAN pruning when VLAN 0 is added */
        if (unlikely(!vid)) {
-               ret = ice_cfg_vlan_pruning(vsi, true);
+               int ret = ice_cfg_vlan_pruning(vsi, true);
+
                if (ret)
                        return ret;
        }
@@ -1644,12 +1644,7 @@ static int ice_vlan_rx_add_vid(struct net_device *netdev,
         * needed to continue allowing all untagged packets since VLAN prune
         * list is applied to all packets by the switch
         */
-       ret = ice_vsi_add_vlan(vsi, vid);
-
-       if (!ret)
-               set_bit(vid, vsi->active_vlans);
-
-       return ret;
+       return ice_vsi_add_vlan(vsi, vid);
 }
 
 /**
@@ -1677,8 +1672,6 @@ static int ice_vlan_rx_kill_vid(struct net_device *netdev,
        if (status)
                return status;
 
-       clear_bit(vid, vsi->active_vlans);
-
        /* Disable VLAN pruning when VLAN 0 is removed */
        if (unlikely(!vid))
                status = ice_cfg_vlan_pruning(vsi, false);
@@ -2515,31 +2508,6 @@ static int ice_vsi_vlan_setup(struct ice_vsi *vsi)
        return ret;
 }
 
-/**
- * ice_restore_vlan - Reinstate VLANs when vsi/netdev comes back up
- * @vsi: the VSI being brought back up
- */
-static int ice_restore_vlan(struct ice_vsi *vsi)
-{
-       int err;
-       u16 vid;
-
-       if (!vsi->netdev)
-               return -EINVAL;
-
-       err = ice_vsi_vlan_setup(vsi);
-       if (err)
-               return err;
-
-       for_each_set_bit(vid, vsi->active_vlans, VLAN_N_VID) {
-               err = ice_vlan_rx_add_vid(vsi->netdev, htons(ETH_P_8021Q), vid);
-               if (err)
-                       break;
-       }
-
-       return err;
-}
-
 /**
  * ice_vsi_cfg - Setup the VSI
  * @vsi: the VSI being configured
@@ -2552,7 +2520,9 @@ static int ice_vsi_cfg(struct ice_vsi *vsi)
 
        if (vsi->netdev) {
                ice_set_rx_mode(vsi->netdev);
-               err = ice_restore_vlan(vsi);
+
+               err = ice_vsi_vlan_setup(vsi);
+
                if (err)
                        return err;
        }
index 45f10f8f01dc1ba0e39cd1e87ba16a11c5fbbe7f..9576b958622b382db25f179f90e2f8c7d872205f 100644 (file)
@@ -2171,7 +2171,6 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)
 
                        if (!ice_vsi_add_vlan(vsi, vid)) {
                                vf->num_vlan++;
-                               set_bit(vid, vsi->active_vlans);
 
                                /* Enable VLAN pruning when VLAN 0 is added */
                                if (unlikely(!vid))
@@ -2190,7 +2189,6 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)
                         */
                        if (!ice_vsi_kill_vlan(vsi, vid)) {
                                vf->num_vlan--;
-                               clear_bit(vid, vsi->active_vlans);
 
                                /* Disable VLAN pruning when removing VLAN 0 */
                                if (unlikely(!vid))