|
@@ -3845,6 +3845,36 @@ static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
|
|
|
ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * ixgbe_write_mc_addr_list - write multicast addresses to MTA
|
|
|
+ * @netdev: network interface device structure
|
|
|
+ *
|
|
|
+ * Writes multicast address list to the MTA hash table.
|
|
|
+ * Returns: -ENOMEM on failure
|
|
|
+ * 0 on no addresses written
|
|
|
+ * X on writing X addresses to MTA
|
|
|
+ **/
|
|
|
+static int ixgbe_write_mc_addr_list(struct net_device *netdev)
|
|
|
+{
|
|
|
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
|
|
|
+ struct ixgbe_hw *hw = &adapter->hw;
|
|
|
+
|
|
|
+ if (!netif_running(netdev))
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ if (hw->mac.ops.update_mc_addr_list)
|
|
|
+ hw->mac.ops.update_mc_addr_list(hw, netdev);
|
|
|
+ else
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+#ifdef CONFIG_PCI_IOV
|
|
|
+ if (adapter->num_vfs)
|
|
|
+ ixgbe_restore_vf_multicasts(adapter);
|
|
|
+#endif
|
|
|
+
|
|
|
+ return netdev_mc_count(netdev);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* ixgbe_write_uc_addr_list - write unicast addresses to RAR table
|
|
|
* @netdev: network interface device structure
|
|
@@ -3908,7 +3938,6 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
|
int count;
|
|
|
|
|
|
/* Check for Promiscuous and All Multicast modes */
|
|
|
-
|
|
|
fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
|
|
|
vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
|
|
|
|
|
@@ -3924,7 +3953,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
|
if (netdev->flags & IFF_PROMISC) {
|
|
|
hw->addr_ctrl.user_set_promisc = true;
|
|
|
fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
|
|
|
- vmolr |= (IXGBE_VMOLR_ROPE | IXGBE_VMOLR_MPE);
|
|
|
+ vmolr |= IXGBE_VMOLR_MPE;
|
|
|
/* Only disable hardware filter vlans in promiscuous mode
|
|
|
* if SR-IOV and VMDQ are disabled - otherwise ensure
|
|
|
* that hardware VLAN filters remain enabled.
|
|
@@ -3956,11 +3985,13 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
|
* then we should just turn on promiscuous mode so
|
|
|
* that we can at least receive multicast traffic
|
|
|
*/
|
|
|
- hw->mac.ops.update_mc_addr_list(hw, netdev);
|
|
|
- vmolr |= IXGBE_VMOLR_ROMPE;
|
|
|
-
|
|
|
- if (adapter->num_vfs)
|
|
|
- ixgbe_restore_vf_multicasts(adapter);
|
|
|
+ count = ixgbe_write_mc_addr_list(netdev);
|
|
|
+ if (count < 0) {
|
|
|
+ fctrl |= IXGBE_FCTRL_MPE;
|
|
|
+ vmolr |= IXGBE_VMOLR_MPE;
|
|
|
+ } else if (count) {
|
|
|
+ vmolr |= IXGBE_VMOLR_ROMPE;
|
|
|
+ }
|
|
|
|
|
|
if (hw->mac.type != ixgbe_mac_82598EB) {
|
|
|
vmolr |= IXGBE_READ_REG(hw, IXGBE_VMOLR(VMDQ_P(0))) &
|