netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Mason <jdmason@us.ibm.com>
To: "Venkatesan, Ganesh" <ganesh.venkatesan@intel.com>
Cc: "Christoph Hellwig" <hch@infradead.org>, <jgarzik@pobox.com>,
	"netdev" <netdev@oss.sgi.com>
Subject: Re: [PATCH netdev-2.6 7/10] ixgb: Replace kmalloc with vmalloc to allocate driver local data structures
Date: Fri, 29 Oct 2004 11:41:12 -0500	[thread overview]
Message-ID: <200410291141.12330.jdmason@us.ibm.com> (raw)
In-Reply-To: <468F3FDA28AA87429AD807992E22D07E031286C0@orsmsx408>

On Friday 29 October 2004 10:35 am, Venkatesan, Ganesh wrote:
> >There seems to be 3 ways around this problem.
> >1) change the unsigned long fields in ixgb_buffer to unsigned ints
>
> (this
>
> >decreases the size of the struct enough to use kmalloc)
>
> PATCH netdev-2.6 6/10 does this.

Problem with patch 6/10.

--- netdev-2.6/drivers/net/ixgb/ixgb.h  2004-10-15 13:15:38.000000000 -0700
+++ netdev-2.6/drivers/net/ixgb.new/ixgb.h      2004-10-15 13:15:51.000000000 
-0700
@@ -105,9 +105,9 @@ struct ixgb_adapter;
 struct ixgb_buffer {
        struct sk_buff *skb;
        uint64_t dma;
-       unsigned long length;
+       uint16_t length;
        unsigned long time_stamp;
-       unsigned int next_to_watch;
+       uint16_t next_to_watch;
 };

Since the 2 16bit fields are not contigious, they will take up 32bits each.  
This ballons the struct to still be too large.  By moving thse 2 fields next 
to one another, this fixes the problem and makes the struct small enough to 
use kmalloc for up to 4096 descriptors.  

The patch below removes the need for patch 7/10 (and I have verified this).

--- ixgb.h.orig 2004-10-29 11:36:06.757879120 -0700
+++ ixgb.h      2004-10-29 11:35:51.065001784 -0700
@@ -123,8 +123,8 @@ struct ixgb_adapter;
 struct ixgb_buffer {
        struct sk_buff *skb;
        uint64_t dma;
-       uint16_t length;
        unsigned long time_stamp;
+       uint16_t length;
        uint16_t next_to_watch;
 };


-- 
Jon Mason
jdmason@us.ibm.com

  reply	other threads:[~2004-10-29 16:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-29 15:35 [PATCH netdev-2.6 7/10] ixgb: Replace kmalloc with vmalloc to allocate driver local data structures Venkatesan, Ganesh
2004-10-29 16:41 ` Jon Mason [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-29 12:50 Venkatesan, Ganesh
2004-10-29 13:08 ` Christoph Hellwig
2004-10-29 15:28   ` Jon Mason
2004-10-29 17:02   ` Jeff Garzik
2004-10-29 17:36     ` William Lee Irwin III
2004-10-29 18:26       ` Jeff Garzik
2004-10-29 18:29         ` William Lee Irwin III
2004-10-29 12:11 Ganesh Venkatesan
2004-10-29 12:14 ` Christoph Hellwig

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=200410291141.12330.jdmason@us.ibm.com \
    --to=jdmason@us.ibm.com \
    --cc=ganesh.venkatesan@intel.com \
    --cc=hch@infradead.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /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).