lkml.org 
[lkml]   [2013]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net] sfc: Reduce RX scatter buffer size to multiple of 256
From
Date
On Mon, 2013-05-13 at 21:16 +0200, Geert Uytterhoeven wrote:
> On Mon, May 13, 2013 at 9:11 PM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> >> error: BUILD_BUG_ON failed: sizeof(struct efx_rx_page_state) +
> >> EFX_PAGE_IP_ALIGN + EFX_RX_USR_BUF_SIZE > PAGE_SIZE / 2
> >> make[4]: *** [drivers/net/ethernet/sfc/efx.o] Error 1
> >
> > OK, this doesn't work because on s390 EFX_PAGE_IP_ALIGN == 2 (this macro
>
> Yeah, that's what I just discovered, too.
>
> #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
> #define EFX_PAGE_IP_ALIGN 0
> #else
> #define EFX_PAGE_IP_ALIGN NET_IP_ALIGN
> #endif
>
> > is equivalent to NET_IP_ALIGN, though that wasn't always true). So DMA
> > is going to be misaligned on s390 anyway.
>
> Hmm, so it's making the choice between misaligned CPU and misaligned
> DMA? Sounds fishy...

When writing headers into an skb, we need to ensure that the IP header
is aligned as required by the CPU. I'm not sure whether this is true
for page buffers; it will depend on whether GRO pulls the IP header into
an skb header area before looking at it.

For RX DMA, our controller doesn't care about alignment but there is a
performance concern. So where possible we prefer to align the start of
the DMA buffer with a cache line.

Ben.

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



\
 
 \ /
  Last update: 2013-05-13 22:41    [W:0.039 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site