netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ixgb: relax stack usage of 768 Byte
@ 2011-09-16 21:34 Hagen Paul Pfeifer
  2011-09-16 23:08 ` Jeff Kirsher
  0 siblings, 1 reply; 2+ messages in thread
From: Hagen Paul Pfeifer @ 2011-09-16 21:34 UTC (permalink / raw)
  To: netdev; +Cc: Hagen Paul Pfeifer, Jeff Kirsher

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 <hagen@jauu.net>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] ixgb: relax stack usage of 768 Byte
  2011-09-16 21:34 [PATCH net-next] ixgb: relax stack usage of 768 Byte Hagen Paul Pfeifer
@ 2011-09-16 23:08 ` Jeff Kirsher
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Kirsher @ 2011-09-16 23:08 UTC (permalink / raw)
  To: Hagen Paul Pfeifer; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

On Fri, 2011-09-16 at 14:34 -0700, Hagen Paul Pfeifer wrote:
> 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 <hagen@jauu.net>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-) 

Thanks Hagen! I have added the patch to my queue of ixgbe patches.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-16 23:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 21:34 [PATCH net-next] ixgb: relax stack usage of 768 Byte Hagen Paul Pfeifer
2011-09-16 23:08 ` Jeff Kirsher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).