[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1299012424.2529.39.camel@bwh-desktop>
Date: Tue, 01 Mar 2011 20:47:04 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: David Miller <davem@...emloft.net>
Cc: linux-net-drivers@...arflare.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next-2.6] sfc: Reduce size of efx_rx_buffer by
unionising skb and page
On Tue, 2011-03-01 at 12:24 -0800, David Miller wrote:
> From: Ben Hutchings <bhutchings@...arflare.com>
> Date: Tue, 01 Mar 2011 01:21:30 +0000
>
> > From: Steve Hodgson <shodgson@...arflare.com>
> >
> > [bwh: Forward-ported to net-next-2.6.]
> > Signed-off-by: Ben Hutchings <bhutchings@...arflare.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists