[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6CC945@AcuExch.aculab.com>
Date: Thu, 27 Feb 2014 10:51:22 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Giuseppe Cavallaro' <peppe.cavallaro@...com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH (net.git) 2/4] stmmac: fix and better tune the default
buffer sizes
From: Giuseppe Cavallaro
> This patch is to fix and tune the default buffer sizes.
> It reduces the default bufsize used by the driver from
> 2048 to 1518 (taking into account the extra 4 bytes in case of VLAN).
...
> -#define DMA_BUFFER_SIZE BUF_SIZE_4KiB
> -static int buf_sz = DMA_BUFFER_SIZE;
Does this means that the old default was 4k, not the 2k in the
patch description.
> +#ifdef STMMAC_VLAN_TAG_USED
> +#define DEFAULT_BUFSIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
> +#else
> +#define DEFAULT_BUFSIZE (ETH_FRAME_LEN + ETH_FCS_LEN)
> +#endif
...
> + if (unlikely((buf_sz < DEFAULT_BUFSIZE) || (buf_sz > BUF_SIZE_16KiB)))
> + buf_sz = DEFAULT_BUFSIZE;
It doesn't seem right to me for the minimum buffer size to
depend on a compile-time option for VLAN.
Also (provided the hardware supports it) the rx buffers (are these
the ones being sized?) need to be aligned on a 4n+2 boundary in
order to avoid a realignment copy later on.
So I'm not sure that some of these sizes are right and/or optimal.
David
--
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