[PATCH net-next] ixgb: relax stack usage of 768 Byte
From: Hagen Paul Pfeifer <hidden>
Date: 2011-09-16 21:35:16
ixgb_set_multi() will push (128 * 6) byte on the stack to set the multicast filter. Fix this by allocate the scratch buffer on the heap. Signed-off-by: Hagen Paul Pfeifer <redacted> Cc: Jeff Kirsher <redacted> --- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index c8b9c90..4d23007 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c@@ -1095,8 +1095,10 @@ ixgb_set_multi(struct net_device *netdev) rctl |= IXGB_RCTL_MPE; IXGB_WRITE_REG(hw, RCTL, rctl); } else { - u8 mta[IXGB_MAX_NUM_MULTICAST_ADDRESSES * - IXGB_ETH_LENGTH_OF_ADDRESS]; + u8 *mta = kmalloc(IXGB_MAX_NUM_MULTICAST_ADDRESSES * + IXGB_ETH_LENGTH_OF_ADDRESS, GFP_ATOMIC); + if (!mta) + return; IXGB_WRITE_REG(hw, RCTL, rctl);
@@ -1106,6 +1108,8 @@ ixgb_set_multi(struct net_device *netdev) ha->addr, IXGB_ETH_LENGTH_OF_ADDRESS); ixgb_mc_addr_list_update(hw, mta, netdev_mc_count(netdev), 0); + + kfree(mta); } if (netdev->features & NETIF_F_HW_VLAN_RX)
--
1.7.5.4