Commit 949b922e authored by Andre Guedes's avatar Andre Guedes Committed by Jeff Kirsher

igc: Add debug messages to MAC filter code

This patch adds log messages to functions related to the MAC address
filtering code to ease debugging.
Signed-off-by: default avatarAndre Guedes <andre.guedes@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 5f930713
...@@ -776,6 +776,7 @@ static void igc_setup_tctl(struct igc_adapter *adapter) ...@@ -776,6 +776,7 @@ static void igc_setup_tctl(struct igc_adapter *adapter)
static void igc_set_mac_filter_hw(struct igc_adapter *adapter, int index, static void igc_set_mac_filter_hw(struct igc_adapter *adapter, int index,
const u8 *addr, int queue) const u8 *addr, int queue)
{ {
struct net_device *dev = adapter->netdev;
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
u32 ral, rah; u32 ral, rah;
...@@ -795,6 +796,8 @@ static void igc_set_mac_filter_hw(struct igc_adapter *adapter, int index, ...@@ -795,6 +796,8 @@ static void igc_set_mac_filter_hw(struct igc_adapter *adapter, int index,
wr32(IGC_RAL(index), ral); wr32(IGC_RAL(index), ral);
wr32(IGC_RAH(index), rah); wr32(IGC_RAH(index), rah);
netdev_dbg(dev, "MAC address filter set in HW: index %d", index);
} }
/** /**
...@@ -804,6 +807,7 @@ static void igc_set_mac_filter_hw(struct igc_adapter *adapter, int index, ...@@ -804,6 +807,7 @@ static void igc_set_mac_filter_hw(struct igc_adapter *adapter, int index,
*/ */
static void igc_clear_mac_filter_hw(struct igc_adapter *adapter, int index) static void igc_clear_mac_filter_hw(struct igc_adapter *adapter, int index)
{ {
struct net_device *dev = adapter->netdev;
struct igc_hw *hw = &adapter->hw; struct igc_hw *hw = &adapter->hw;
if (WARN_ON(index >= hw->mac.rar_entry_count)) if (WARN_ON(index >= hw->mac.rar_entry_count))
...@@ -811,18 +815,24 @@ static void igc_clear_mac_filter_hw(struct igc_adapter *adapter, int index) ...@@ -811,18 +815,24 @@ static void igc_clear_mac_filter_hw(struct igc_adapter *adapter, int index)
wr32(IGC_RAL(index), 0); wr32(IGC_RAL(index), 0);
wr32(IGC_RAH(index), 0); wr32(IGC_RAH(index), 0);
netdev_dbg(dev, "MAC address filter cleared in HW: index %d", index);
} }
/* Set default MAC address for the PF in the first RAR entry */ /* Set default MAC address for the PF in the first RAR entry */
static void igc_set_default_mac_filter(struct igc_adapter *adapter) static void igc_set_default_mac_filter(struct igc_adapter *adapter)
{ {
struct igc_mac_addr *mac_table = &adapter->mac_table[0]; struct igc_mac_addr *mac_table = &adapter->mac_table[0];
struct net_device *dev = adapter->netdev;
u8 *addr = adapter->hw.mac.addr;
netdev_dbg(dev, "Set default MAC address filter: address %pM", addr);
ether_addr_copy(mac_table->addr, adapter->hw.mac.addr); ether_addr_copy(mac_table->addr, addr);
mac_table->state = IGC_MAC_STATE_DEFAULT | IGC_MAC_STATE_IN_USE; mac_table->state = IGC_MAC_STATE_DEFAULT | IGC_MAC_STATE_IN_USE;
mac_table->queue = -1; mac_table->queue = -1;
igc_set_mac_filter_hw(adapter, 0, mac_table->addr, mac_table->queue); igc_set_mac_filter_hw(adapter, 0, addr, mac_table->queue);
} }
/** /**
...@@ -2231,6 +2241,7 @@ static int igc_get_avail_mac_filter_slot(struct igc_adapter *adapter) ...@@ -2231,6 +2241,7 @@ static int igc_get_avail_mac_filter_slot(struct igc_adapter *adapter)
int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr, int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr,
const s8 queue, const u8 flags) const s8 queue, const u8 flags)
{ {
struct net_device *dev = adapter->netdev;
int index; int index;
if (!is_valid_ether_addr(addr)) if (!is_valid_ether_addr(addr))
...@@ -2246,6 +2257,9 @@ int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr, ...@@ -2246,6 +2257,9 @@ int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr,
if (index < 0) if (index < 0)
return -ENOSPC; return -ENOSPC;
netdev_dbg(dev, "Add MAC address filter: index %d address %pM queue %d",
index, addr, queue);
ether_addr_copy(adapter->mac_table[index].addr, addr); ether_addr_copy(adapter->mac_table[index].addr, addr);
adapter->mac_table[index].state |= IGC_MAC_STATE_IN_USE | flags; adapter->mac_table[index].state |= IGC_MAC_STATE_IN_USE | flags;
update_queue_assignment: update_queue_assignment:
...@@ -2267,6 +2281,7 @@ int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr, ...@@ -2267,6 +2281,7 @@ int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr,
int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr, int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
const u8 flags) const u8 flags)
{ {
struct net_device *dev = adapter->netdev;
struct igc_mac_addr *entry; struct igc_mac_addr *entry;
int index; int index;
...@@ -2284,9 +2299,14 @@ int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr, ...@@ -2284,9 +2299,14 @@ int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
* We just reset to its default value i.e. disable queue * We just reset to its default value i.e. disable queue
* assignment. * assignment.
*/ */
netdev_dbg(dev, "Disable default MAC filter queue assignment");
entry->queue = -1; entry->queue = -1;
igc_set_mac_filter_hw(adapter, 0, addr, entry->queue); igc_set_mac_filter_hw(adapter, 0, addr, entry->queue);
} else { } else {
netdev_dbg(dev, "Delete MAC address filter: index %d address %pM",
index, addr);
entry->state = 0; entry->state = 0;
entry->queue = -1; entry->queue = -1;
memset(entry->addr, 0, ETH_ALEN); memset(entry->addr, 0, ETH_ALEN);
......
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