aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaskiewicz Jr, Peter P <peter.p.waskiewicz.jr@intel.com>2009-05-17 08:32:48 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-18 00:04:07 -0400
commitaca6bee75fe53ae019b9cabff42095dfb6471fde (patch)
treebf7ebd5d5f0aa301c170a98fbf8baeac13696cd0
parent0365e6e4373a5a447746fd7ac26074b92f180311 (diff)
ixgbe: Add SAN MAC address to the RAR, return the address to DCB
After acquiring the SAN MAC address from the EEPROM, we need to program it into one of the RARs. Also, DCB will use this MAC address to run DCBX commands, so it doesn't have to play musical MAC addresses when things like bonding enter the picture. So we need to return the MAC address through the netlink interface to userspace. This also moves the init_rx_addrs() call out of start_hw() and into reset_hw(). We shouldn't try to read any of the RAR information before initializing our internal accounting of the RAR table, which was what was happening. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ixgbe/ixgbe_82598.c6
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c17
-rw-r--r--drivers/net/ixgbe/ixgbe_common.c6
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c7
4 files changed, 29 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index e051964347e4..55186dc7dd78 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -801,6 +801,12 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
801 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc); 801 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc);
802 } 802 }
803 803
804 /*
805 * Store MAC address from RAR0, clear receive address registers, and
806 * clear the multicast table
807 */
808 hw->mac.ops.init_rx_addrs(hw);
809
804 /* Store the permanent mac address */ 810 /* Store the permanent mac address */
805 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); 811 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
806 812
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 6bc964fdacbe..eaecf5e595c7 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -816,12 +816,29 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
816 } 816 }
817 } 817 }
818 818
819 /*
820 * Store MAC address from RAR0, clear receive address registers, and
821 * clear the multicast table. Also reset num_rar_entries to 128,
822 * since we modify this value when programming the SAN MAC address.
823 */
824 hw->mac.num_rar_entries = 128;
825 hw->mac.ops.init_rx_addrs(hw);
826
819 /* Store the permanent mac address */ 827 /* Store the permanent mac address */
820 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); 828 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
821 829
822 /* Store the permanent SAN mac address */ 830 /* Store the permanent SAN mac address */
823 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); 831 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr);
824 832
833 /* Add the SAN MAC address to the RAR only if it's a valid address */
834 if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) {
835 hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1,
836 hw->mac.san_addr, 0, IXGBE_RAH_AV);
837
838 /* Reserve the last RAR for the SAN MAC address */
839 hw->mac.num_rar_entries--;
840 }
841
825reset_hw_out: 842reset_hw_out:
826 return status; 843 return status;
827} 844}
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 60638e267c61..af392758b2b4 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -71,12 +71,6 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw)
71 /* Identify the PHY */ 71 /* Identify the PHY */
72 hw->phy.ops.identify(hw); 72 hw->phy.ops.identify(hw);
73 73
74 /*
75 * Store MAC address from RAR0, clear receive address registers, and
76 * clear the multicast table
77 */
78 hw->mac.ops.init_rx_addrs(hw);
79
80 /* Clear the VLAN filter table */ 74 /* Clear the VLAN filter table */
81 hw->mac.ops.clear_vfta(hw); 75 hw->mac.ops.clear_vfta(hw);
82 76
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 99e0c106e671..5d5d390f84bf 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -155,10 +155,15 @@ static void ixgbe_dcbnl_get_perm_hw_addr(struct net_device *netdev,
155 u8 *perm_addr) 155 u8 *perm_addr)
156{ 156{
157 struct ixgbe_adapter *adapter = netdev_priv(netdev); 157 struct ixgbe_adapter *adapter = netdev_priv(netdev);
158 int i; 158 int i, j;
159 159
160 for (i = 0; i < netdev->addr_len; i++) 160 for (i = 0; i < netdev->addr_len; i++)
161 perm_addr[i] = adapter->hw.mac.perm_addr[i]; 161 perm_addr[i] = adapter->hw.mac.perm_addr[i];
162
163 if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
164 for (j = 0; j < netdev->addr_len; j++, i++)
165 perm_addr[i] = adapter->hw.mac.san_addr[j];
166 }
162} 167}
163 168
164static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc, 169static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,