All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Dave Dillow <dave@thedillows.org>
Cc: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>,
	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:26:40 -0400	[thread overview]
Message-ID: <414DCF60.1070104@pobox.com> (raw)
In-Reply-To: <1095618283.4870.0.camel@dillow.idleaire.com>

Dave Dillow wrote:
> 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.

Check -mm to make sure viro hasn't already converted it to ethtool_ops...

	Jeff



  reply	other threads:[~2004-09-19 18:27 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
2004-09-19 18:26   ` Jeff Garzik [this message]
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=414DCF60.1070104@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=dave@thedillows.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.