Commit e433ea1f authored by Emil Tantilov's avatar Emil Tantilov Committed by David S. Miller

ixgbe: fix setting of promisc mode when using mac-vlans

Introduce uc_set_promisc flag to fix enabling of promisc mode
when exceeding the number of supported RAR entries.

Issue discovered by Ben Greear when using mac-vlans.
Reported-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7874c99
...@@ -1392,14 +1392,17 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, ...@@ -1392,14 +1392,17 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
fctrl |= IXGBE_FCTRL_UPE; fctrl |= IXGBE_FCTRL_UPE;
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
hw->addr_ctrl.uc_set_promisc = true;
} }
} else { } else {
/* only disable if set by overflow, not by user */ /* only disable if set by overflow, not by user */
if (old_promisc_setting && !hw->addr_ctrl.user_set_promisc) { if ((old_promisc_setting && hw->addr_ctrl.uc_set_promisc) &&
!(hw->addr_ctrl.user_set_promisc)) {
hw_dbg(hw, " Leaving address overflow promisc mode\n"); hw_dbg(hw, " Leaving address overflow promisc mode\n");
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
fctrl &= ~IXGBE_FCTRL_UPE; fctrl &= ~IXGBE_FCTRL_UPE;
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
hw->addr_ctrl.uc_set_promisc = false;
} }
} }
......
...@@ -2952,7 +2952,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev) ...@@ -2952,7 +2952,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
if (netdev->flags & IFF_PROMISC) { if (netdev->flags & IFF_PROMISC) {
hw->addr_ctrl.user_set_promisc = 1; hw->addr_ctrl.user_set_promisc = true;
fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
/* don't hardware filter vlans in promisc mode */ /* don't hardware filter vlans in promisc mode */
ixgbe_vlan_filter_disable(adapter); ixgbe_vlan_filter_disable(adapter);
...@@ -2960,11 +2960,11 @@ void ixgbe_set_rx_mode(struct net_device *netdev) ...@@ -2960,11 +2960,11 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
if (netdev->flags & IFF_ALLMULTI) { if (netdev->flags & IFF_ALLMULTI) {
fctrl |= IXGBE_FCTRL_MPE; fctrl |= IXGBE_FCTRL_MPE;
fctrl &= ~IXGBE_FCTRL_UPE; fctrl &= ~IXGBE_FCTRL_UPE;
} else { } else if (!hw->addr_ctrl.uc_set_promisc) {
fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
} }
ixgbe_vlan_filter_enable(adapter); ixgbe_vlan_filter_enable(adapter);
hw->addr_ctrl.user_set_promisc = 0; hw->addr_ctrl.user_set_promisc = false;
} }
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
......
...@@ -2268,6 +2268,7 @@ struct ixgbe_addr_filter_info { ...@@ -2268,6 +2268,7 @@ struct ixgbe_addr_filter_info {
u32 mc_addr_in_rar_count; u32 mc_addr_in_rar_count;
u32 mta_in_use; u32 mta_in_use;
u32 overflow_promisc; u32 overflow_promisc;
bool uc_set_promisc;
bool user_set_promisc; bool user_set_promisc;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment