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:34:29 +0100 [thread overview]
Message-ID: <530F3EE5.4080600@st.com> (raw)
In-Reply-To: <530F3784.5050304@st.com>
On 2/27/2014 2:03 PM, Giuseppe CAVALLARO wrote:
> 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).
I did some other check and indeed it is aligned to 2KiB so what do you
think if I use it instead of 4KiB? I do not remember why this was added
but it should be only set in case of we change the mtu and the driver
should take care about that.
if you agree, I can do further test on sh4 and arm and repost the patch
peppe
>
> Peppe
>
>>
>> David
>>
>>
>>
>>
>>
>
>
>
next prev parent reply other threads:[~2014-02-27 13:34 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
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 [this message]
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=530F3EE5.4080600@st.com \
--to=peppe.cavallaro@st$(echo .)com \
--cc=David.Laight@ACULAB$(echo .)COM \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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