netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Dillow <dave@thedillows.org>
To: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [PATCH] reduce stack usage in ixgb_ethtool_ioctl
Date: Sun, 19 Sep 2004 14:24:43 -0400	[thread overview]
Message-ID: <1095618283.4870.0.camel@dillow.idleaire.com> (raw)
In-Reply-To: <200409192033.56716.vda@port.imtp.ilyichevsk.odessa.ua>

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>

  reply	other threads:[~2004-09-19 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-19 17:33 [PATCH] reduce stack usage in ixgb_ethtool_ioctl Denis Vlasenko
2004-09-19 18:24 ` Dave Dillow [this message]
2004-09-19 18:26   ` Jeff Garzik
2004-09-19 18:47     ` Denis Vlasenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1095618283.4870.0.camel@dillow.idleaire.com \
    --to=dave@thedillows.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).