public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: linux-net-drivers@solarflare.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] sfc: Reduce size of efx_rx_buffer by unionising skb and page
Date: Tue, 01 Mar 2011 20:47:04 +0000	[thread overview]
Message-ID: <1299012424.2529.39.camel@bwh-desktop> (raw)
In-Reply-To: <20110301.122459.183051942.davem@davemloft.net>

On Tue, 2011-03-01 at 12:24 -0800, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Tue, 01 Mar 2011 01:21:30 +0000
> 
> > From: Steve Hodgson <shodgson@solarflare.com>
> > 
> > [bwh: Forward-ported to net-next-2.6.]
> > Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> 
> I'm going to apply this, but you can take this further by making
> the buffer an "unsigned long" and encode the pointer plus a one-bit
> binary state there to indicate what it is.

We were primarily concerned with reducing the size of the software ring
for RX queues on 64-bit (DMA address & pointer) systems, where the
structure layout is:

Original:

struct efx_rx_buffer {
       dma_addr_t dma_addr;		// 0
       struct sk_buff *skb;		// 8
       struct page *page;		// 16
       char *data;			// 24
       unsigned int len;		// 32
};					// size = 40

Current:

struct efx_rx_buffer {
       dma_addr_t dma_addr;		// 0
       union {
               struct sk_buff *skb;	// 8
               struct page *page;	// 8
       } u;
       unsigned int len;		// 16
       bool is_page;			// 20
};					// size = 24

Combining the flag with the pointers wouldn't improve on this:

struct efx_rx_buffer {
       dma_addr_t dma_addr;		// 0
       unsigned long magic_pointer;	// 8
       unsigned int len;		// 16
};					// size = 24

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2011-03-01 20:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  1:16 pull request: sfc-next-2.6 2011-03-01 Ben Hutchings
2011-03-01  1:21 ` [PATCH net-next-2.6] sfc: Reduce size of efx_rx_buffer by unionising skb and page Ben Hutchings
2011-03-01 20:24   ` David Miller
2011-03-01 20:47     ` Ben Hutchings [this message]
2011-03-01 21:08       ` David Miller
2011-03-01  1:22 ` [PATCH net-next-2.6 2/8] sfc: Reduce size of efx_rx_buffer further by removing data member Ben Hutchings
2011-03-01  1:22 ` [PATCH net-next-2.6 3/8] sfc: Read MC firmware version when requested through ethtool Ben Hutchings
2011-03-01  1:22 ` [PATCH net-next-2.6 4/8] sfc: Do not read STAT1.FAULT in efx_mdio_check_mmd() Ben Hutchings
2011-03-01  1:23 ` [PATCH net-next-2.6 5/8] sfc: Update copyright dates Ben Hutchings
2011-03-01  1:23 ` [PATCH net-next-2.6 6/8] sfc: Expose TX push and TSO counters through ethtool statistics Ben Hutchings
2011-03-01  1:23 ` [PATCH net-next-2.6 7/8] sfc: Remove configurable FIFO thresholds for pause frame generation Ben Hutchings
2011-03-01  1:23 ` [PATCH net-next-2.6 8/8] sfc: Bump version to 3.1 Ben Hutchings
2011-03-01 20:25 ` pull request: sfc-next-2.6 2011-03-01 David Miller

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=1299012424.2529.39.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /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