diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2010-05-13 13:33:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-14 00:07:32 -0400 |
commit | e433ea1fb03c10debf101019668b83abed041c24 (patch) | |
tree | e337d64fc7be738c1220b0e66fa4c1e5a5f4c552 /drivers/net/ixgbe | |
parent | e7874c996b8591f59d78efa519031dab5b58723b (diff) |
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: Ben Greear <greearb@candelatech.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 5 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 6 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 1 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 6eb5814ca7da..753f2ab39d7f 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -1392,14 +1392,17 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, | |||
1392 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 1392 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
1393 | fctrl |= IXGBE_FCTRL_UPE; | 1393 | fctrl |= IXGBE_FCTRL_UPE; |
1394 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); | 1394 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); |
1395 | hw->addr_ctrl.uc_set_promisc = true; | ||
1395 | } | 1396 | } |
1396 | } else { | 1397 | } else { |
1397 | /* only disable if set by overflow, not by user */ | 1398 | /* only disable if set by overflow, not by user */ |
1398 | if (old_promisc_setting && !hw->addr_ctrl.user_set_promisc) { | 1399 | if ((old_promisc_setting && hw->addr_ctrl.uc_set_promisc) && |
1400 | !(hw->addr_ctrl.user_set_promisc)) { | ||
1399 | hw_dbg(hw, " Leaving address overflow promisc mode\n"); | 1401 | hw_dbg(hw, " Leaving address overflow promisc mode\n"); |
1400 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 1402 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
1401 | fctrl &= ~IXGBE_FCTRL_UPE; | 1403 | fctrl &= ~IXGBE_FCTRL_UPE; |
1402 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); | 1404 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); |
1405 | hw->addr_ctrl.uc_set_promisc = false; | ||
1403 | } | 1406 | } |
1404 | } | 1407 | } |
1405 | 1408 | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index d1a1868df817..15032c79e003 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2952,7 +2952,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev) | |||
2952 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 2952 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
2953 | 2953 | ||
2954 | if (netdev->flags & IFF_PROMISC) { | 2954 | if (netdev->flags & IFF_PROMISC) { |
2955 | hw->addr_ctrl.user_set_promisc = 1; | 2955 | hw->addr_ctrl.user_set_promisc = true; |
2956 | fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); | 2956 | fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); |
2957 | /* don't hardware filter vlans in promisc mode */ | 2957 | /* don't hardware filter vlans in promisc mode */ |
2958 | ixgbe_vlan_filter_disable(adapter); | 2958 | ixgbe_vlan_filter_disable(adapter); |
@@ -2960,11 +2960,11 @@ void ixgbe_set_rx_mode(struct net_device *netdev) | |||
2960 | if (netdev->flags & IFF_ALLMULTI) { | 2960 | if (netdev->flags & IFF_ALLMULTI) { |
2961 | fctrl |= IXGBE_FCTRL_MPE; | 2961 | fctrl |= IXGBE_FCTRL_MPE; |
2962 | fctrl &= ~IXGBE_FCTRL_UPE; | 2962 | fctrl &= ~IXGBE_FCTRL_UPE; |
2963 | } else { | 2963 | } else if (!hw->addr_ctrl.uc_set_promisc) { |
2964 | fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); | 2964 | fctrl &= ~(IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE); |
2965 | } | 2965 | } |
2966 | ixgbe_vlan_filter_enable(adapter); | 2966 | ixgbe_vlan_filter_enable(adapter); |
2967 | hw->addr_ctrl.user_set_promisc = 0; | 2967 | hw->addr_ctrl.user_set_promisc = false; |
2968 | } | 2968 | } |
2969 | 2969 | ||
2970 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); | 2970 | IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl); |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 4277cbbb8126..8fc59ac3c0e8 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2268,6 +2268,7 @@ struct ixgbe_addr_filter_info { | |||
2268 | u32 mc_addr_in_rar_count; | 2268 | u32 mc_addr_in_rar_count; |
2269 | u32 mta_in_use; | 2269 | u32 mta_in_use; |
2270 | u32 overflow_promisc; | 2270 | u32 overflow_promisc; |
2271 | bool uc_set_promisc; | ||
2271 | bool user_set_promisc; | 2272 | bool user_set_promisc; |
2272 | }; | 2273 | }; |
2273 | 2274 | ||