mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
ice: Remove duplicate addition of VLANs in replay path
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>
This commit is contained in:
parent
33e055fcc2
commit
9ecd25c268
@ -191,7 +191,6 @@ struct ice_vsi {
|
|||||||
u64 tx_linearize;
|
u64 tx_linearize;
|
||||||
DECLARE_BITMAP(state, __ICE_STATE_NBITS);
|
DECLARE_BITMAP(state, __ICE_STATE_NBITS);
|
||||||
DECLARE_BITMAP(flags, ICE_VSI_FLAG_NBITS);
|
DECLARE_BITMAP(flags, ICE_VSI_FLAG_NBITS);
|
||||||
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
|
|
||||||
unsigned int current_netdev_flags;
|
unsigned int current_netdev_flags;
|
||||||
u32 tx_restart;
|
u32 tx_restart;
|
||||||
u32 tx_busy;
|
u32 tx_busy;
|
||||||
|
@ -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_netdev_priv *np = netdev_priv(netdev);
|
||||||
struct ice_vsi *vsi = np->vsi;
|
struct ice_vsi *vsi = np->vsi;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (vid >= VLAN_N_VID) {
|
if (vid >= VLAN_N_VID) {
|
||||||
netdev_err(netdev, "VLAN id requested %d is out of range %d\n",
|
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 */
|
/* Enable VLAN pruning when VLAN 0 is added */
|
||||||
if (unlikely(!vid)) {
|
if (unlikely(!vid)) {
|
||||||
ret = ice_cfg_vlan_pruning(vsi, true);
|
int ret = ice_cfg_vlan_pruning(vsi, true);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return 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
|
* needed to continue allowing all untagged packets since VLAN prune
|
||||||
* list is applied to all packets by the switch
|
* list is applied to all packets by the switch
|
||||||
*/
|
*/
|
||||||
ret = ice_vsi_add_vlan(vsi, vid);
|
return ice_vsi_add_vlan(vsi, vid);
|
||||||
|
|
||||||
if (!ret)
|
|
||||||
set_bit(vid, vsi->active_vlans);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1677,8 +1672,6 @@ static int ice_vlan_rx_kill_vid(struct net_device *netdev,
|
|||||||
if (status)
|
if (status)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
clear_bit(vid, vsi->active_vlans);
|
|
||||||
|
|
||||||
/* Disable VLAN pruning when VLAN 0 is removed */
|
/* Disable VLAN pruning when VLAN 0 is removed */
|
||||||
if (unlikely(!vid))
|
if (unlikely(!vid))
|
||||||
status = ice_cfg_vlan_pruning(vsi, false);
|
status = ice_cfg_vlan_pruning(vsi, false);
|
||||||
@ -2515,31 +2508,6 @@ static int ice_vsi_vlan_setup(struct ice_vsi *vsi)
|
|||||||
return ret;
|
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
|
* ice_vsi_cfg - Setup the VSI
|
||||||
* @vsi: the VSI being configured
|
* @vsi: the VSI being configured
|
||||||
@ -2552,7 +2520,9 @@ static int ice_vsi_cfg(struct ice_vsi *vsi)
|
|||||||
|
|
||||||
if (vsi->netdev) {
|
if (vsi->netdev) {
|
||||||
ice_set_rx_mode(vsi->netdev);
|
ice_set_rx_mode(vsi->netdev);
|
||||||
err = ice_restore_vlan(vsi);
|
|
||||||
|
err = ice_vsi_vlan_setup(vsi);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -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)) {
|
if (!ice_vsi_add_vlan(vsi, vid)) {
|
||||||
vf->num_vlan++;
|
vf->num_vlan++;
|
||||||
set_bit(vid, vsi->active_vlans);
|
|
||||||
|
|
||||||
/* Enable VLAN pruning when VLAN 0 is added */
|
/* Enable VLAN pruning when VLAN 0 is added */
|
||||||
if (unlikely(!vid))
|
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)) {
|
if (!ice_vsi_kill_vlan(vsi, vid)) {
|
||||||
vf->num_vlan--;
|
vf->num_vlan--;
|
||||||
clear_bit(vid, vsi->active_vlans);
|
|
||||||
|
|
||||||
/* Disable VLAN pruning when removing VLAN 0 */
|
/* Disable VLAN pruning when removing VLAN 0 */
|
||||||
if (unlikely(!vid))
|
if (unlikely(!vid))
|
||||||
|
Loading…
Reference in New Issue
Block a user