lkml.org 
[lkml]   [2004]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] reduce stack usage in ixgb_ethtool_ioctl
From
Date
On Sun, 2004-09-19 at 13:33, Denis Vlasenko wrote:
> Stack usage is still high because gcc will
> allocate too much space for these cases:
>
> case ETHTOOL_GSET:{
> struct ethtool_cmd ecmd = { ETHTOOL_GSET };
> ixgb_ethtool_gset(adapter, &ecmd);
> if (copy_to_user(addr, &ecmd, sizeof(ecmd)))
> return -EFAULT;
> return 0;
> }
> case ETHTOOL_SSET:{
> struct ethtool_cmd ecmd;
> if (copy_from_user(&ecmd, addr, sizeof(ecmd)))
> return -EFAULT;
> return ixgb_ethtool_sset(adapter, &ecmd);
> }
>
> There will be space for _two_ ecmd's on stack.
>
> Shall it be worked around with ugly union of structs
> or we'll just wait for better gcc?

You could convert it to use ethtool_ops.
--
Dave Dillow <dave@thedillows.org>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.160 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site