summaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbevf/ixgbevf_main.c
diff options
context:
space:
mode:
authorGreg Rose <gregory.v.rose@intel.com>2011-05-13 01:33:42 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-05-14 17:50:44 -0700
commit46ec20ff7d6f9f011e06d58e4e87153ed8c893ed (patch)
treed2976bcdef595eb8c3c14dd4d9ad036bbc1293eb /drivers/net/ixgbevf/ixgbevf_main.c
parentd64a6f4dca0b45495dd5be8116b618d9cc004eea (diff)
downloadtalos-obmc-linux-46ec20ff7d6f9f011e06d58e4e87153ed8c893ed.tar.gz
talos-obmc-linux-46ec20ff7d6f9f011e06d58e4e87153ed8c893ed.zip
ixgbevf: Add macvlan support in the set rx mode op
Implement setup of unicast address list in the VF driver's set_rx_mode netdev op. Unicast addresses are sent to the PF via a mailbox message and the PF will check if it has room in the RAR table and if so set the filter for the VF. Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbevf/ixgbevf_main.c')
-rw-r--r--drivers/net/ixgbevf/ixgbevf_main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 05fa7c85deed..d7ab202fb95c 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -1460,6 +1460,34 @@ static void ixgbevf_restore_vlan(struct ixgbevf_adapter *adapter)
}
}
+static int ixgbevf_write_uc_addr_list(struct net_device *netdev)
+{
+ struct ixgbevf_adapter *adapter = netdev_priv(netdev);
+ struct ixgbe_hw *hw = &adapter->hw;
+ int count = 0;
+
+ if ((netdev_uc_count(netdev)) > 10) {
+ printk(KERN_ERR "Too many unicast filters - No Space\n");
+ return -ENOSPC;
+ }
+
+ if (!netdev_uc_empty(netdev)) {
+ struct netdev_hw_addr *ha;
+ netdev_for_each_uc_addr(ha, netdev) {
+ hw->mac.ops.set_uc_addr(hw, ++count, ha->addr);
+ udelay(200);
+ }
+ } else {
+ /*
+ * If the list is empty then send message to PF driver to
+ * clear all macvlans on this VF.
+ */
+ hw->mac.ops.set_uc_addr(hw, 0, NULL);
+ }
+
+ return count;
+}
+
/**
* ixgbevf_set_rx_mode - Multicast set
* @netdev: network interface device structure
@@ -1476,6 +1504,8 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev)
/* reprogram multicast list */
if (hw->mac.ops.update_mc_addr_list)
hw->mac.ops.update_mc_addr_list(hw, netdev);
+
+ ixgbevf_write_uc_addr_list(netdev);
}
static void ixgbevf_napi_enable_all(struct ixgbevf_adapter *adapter)
OpenPOWER on IntegriCloud