From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: David Laight <David.Laight@ACULAB.COM>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH (net.git) 2/4] stmmac: fix and better tune the default buffer sizes
Date: Thu, 27 Feb 2014 14:03:00 +0100 [thread overview]
Message-ID: <530F3784.5050304@st.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D0F6CC945@AcuExch.aculab.com>
On 2/27/2014 11:51 AM, David Laight wrote:
> 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.
no pbl, I'll fix it in the patch subject.
>
>> +#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.
Hmm, I can have a default suitable for all the cases.
Indeed other drivers program buffers (dlink/sundance.c)
and do other settings according Koption like CONFIG_VLAN_8021Q.
It is not a problem to review and delete it.
> 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.
This is true and indeed I had added the STMMAC_ALIGN to align all.
In the past to get the right alignment for SH4.
> So I'm not sure that some of these sizes are right and/or optimal.
What do you suggest?
Maybe, I can use a default for sure < 4KiB suitable to be used for VLAN
frames (it will be aligned later).
Peppe
>
> David
>
>
>
>
>
next prev parent reply other threads:[~2014-02-27 13:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 10:35 [PATCH (net.git) 0/4 (v3)] stmmac fixes: EEE and chained mode Giuseppe Cavallaro
2014-02-27 10:35 ` [PATCH (net.git) 1/4] stmmac: disable at run-time the EEE if not supported Giuseppe Cavallaro
2014-02-27 10:35 ` [PATCH (net.git) 2/4] stmmac: fix and better tune the default buffer sizes Giuseppe Cavallaro
2014-02-27 10:51 ` David Laight
2014-02-27 13:03 ` Giuseppe CAVALLARO [this message]
2014-02-27 13:31 ` David Laight
2014-02-27 13:54 ` Giuseppe CAVALLARO
2014-03-04 7:20 ` Giuseppe CAVALLARO
2014-03-05 9:33 ` David Laight
2014-03-05 10:26 ` Giuseppe CAVALLARO
2014-02-27 13:34 ` Giuseppe CAVALLARO
2014-02-27 10:35 ` [PATCH (net.git) 3/4] stmmac: dwmac-sti: fix broken STiD127 compatibility Giuseppe Cavallaro
2014-02-27 10:35 ` [PATCH (net.git) 4/4] stmmac: fix chained mode Giuseppe Cavallaro
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=530F3784.5050304@st.com \
--to=peppe.cavallaro@st.com \
--cc=David.Laight@ACULAB.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.