aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/e1000_mac.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-07-23 14:08:54 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-26 12:46:52 -0400
commit28fc06f58b1fe567bb86c7d0e3d93137e5c0126e (patch)
tree8f579894d96f4d9aea951f8985f0cd8e5fb6b16c /drivers/net/igb/e1000_mac.c
parent009bc06e5311b48c77b7708d9e226ae0f110373a (diff)
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>
Diffstat (limited to 'drivers/net/igb/e1000_mac.c')
-rw-r--r--drivers/net/igb/e1000_mac.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index 60343b58364..46e27e98254 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -261,6 +261,41 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
261} 261}
262 262
263/** 263/**
264 * igb_update_mc_addr_list - Update Multicast addresses
265 * @hw: pointer to the HW structure
266 * @mc_addr_list: array of multicast addresses to program
267 * @mc_addr_count: number of multicast addresses to program
268 *
269 * Updates entire Multicast Table Array.
270 * The caller must have a packed mc_addr_list of multicast addresses.
271 **/
272void igb_update_mc_addr_list(struct e1000_hw *hw,
273 u8 *mc_addr_list, u32 mc_addr_count)
274{
275 u32 hash_value, hash_bit, hash_reg;
276 int i;
277
278 /* clear mta_shadow */
279 memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
280
281 /* update mta_shadow from mc_addr_list */
282 for (i = 0; (u32) i < mc_addr_count; i++) {
283 hash_value = igb_hash_mc_addr(hw, mc_addr_list);
284
285 hash_reg = (hash_value >> 5) & (hw->mac.mta_reg_count - 1);
286 hash_bit = hash_value & 0x1F;
287
288 hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit);
289 mc_addr_list += (ETH_ALEN);
290 }
291
292 /* replace the entire MTA table */
293 for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
294 array_wr32(E1000_MTA, i, hw->mac.mta_shadow[i]);
295 wrfl();
296}
297
298/**
264 * igb_hash_mc_addr - Generate a multicast hash value 299 * igb_hash_mc_addr - Generate a multicast hash value
265 * @hw: pointer to the HW structure 300 * @hw: pointer to the HW structure
266 * @mc_addr: pointer to a multicast address 301 * @mc_addr: pointer to a multicast address