igb: move all multicast addresses into multicast table array
This patch moves all of the multicast addresses out of the free Receive address registers and instead programs them all into the multicast table array. As a result the multicast filtering may not be as precise, but it also greatly reduces the overhead for multicast addresses. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
009bc06e53
commit
28fc06f58b
@@ -797,65 +797,6 @@ static void igb_init_rx_addrs_82575(struct e1000_hw *hw, u16 rar_count)
|
||||
hw->mac.ops.rar_set(hw, addr, i);
|
||||
}
|
||||
|
||||
/**
|
||||
* igb_update_mc_addr_list - Update Multicast addresses
|
||||
* @hw: pointer to the HW structure
|
||||
* @mc_addr_list: array of multicast addresses to program
|
||||
* @mc_addr_count: number of multicast addresses to program
|
||||
* @rar_used_count: the first RAR register free to program
|
||||
* @rar_count: total number of supported Receive Address Registers
|
||||
*
|
||||
* Updates the Receive Address Registers and Multicast Table Array.
|
||||
* The caller must have a packed mc_addr_list of multicast addresses.
|
||||
* The parameter rar_count will usually be hw->mac.rar_entry_count
|
||||
* unless there are workarounds that change this.
|
||||
**/
|
||||
void igb_update_mc_addr_list(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list, u32 mc_addr_count,
|
||||
u32 rar_used_count, u32 rar_count)
|
||||
{
|
||||
u32 hash_value;
|
||||
u32 i;
|
||||
u8 addr[6] = {0,0,0,0,0,0};
|
||||
/*
|
||||
* This function is essentially the same as that of
|
||||
* igb_update_mc_addr_list_generic. However it also takes care
|
||||
* of the special case where the register offset of the
|
||||
* second set of RARs begins elsewhere. This is implicitly taken care by
|
||||
* function e1000_rar_set_generic.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Load the first set of multicast addresses into the exact
|
||||
* filters (RAR). If there are not enough to fill the RAR
|
||||
* array, clear the filters.
|
||||
*/
|
||||
for (i = rar_used_count; i < rar_count; i++) {
|
||||
if (mc_addr_count) {
|
||||
igb_rar_set(hw, mc_addr_list, i);
|
||||
mc_addr_count--;
|
||||
mc_addr_list += ETH_ALEN;
|
||||
} else {
|
||||
igb_rar_set(hw, addr, i);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear the old settings from the MTA */
|
||||
hw_dbg("Clearing MTA\n");
|
||||
for (i = 0; i < hw->mac.mta_reg_count; i++) {
|
||||
array_wr32(E1000_MTA, i, 0);
|
||||
wrfl();
|
||||
}
|
||||
|
||||
/* Load any remaining multicast addresses into the hash table. */
|
||||
for (; mc_addr_count > 0; mc_addr_count--) {
|
||||
hash_value = igb_hash_mc_addr(hw, mc_addr_list);
|
||||
hw_dbg("Hash value = 0x%03X\n", hash_value);
|
||||
igb_mta_set(hw, hash_value);
|
||||
mc_addr_list += ETH_ALEN;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* igb_shutdown_fiber_serdes_link_82575 - Remove link during power down
|
||||
* @hw: pointer to the HW structure
|
||||
|
Reference in New Issue
Block a user