From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: David Laight <David.Laight@ACULAB.COM>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "alexandre.torgue@st.com" <alexandre.torgue@st.com>,
Fabrice Gasnier <fabrice.gasnier@st.com>
Subject: Re: [PATCH (net-next.git) 13/18] stmmac: perf, remove modulo in stmmac_rx()
Date: Thu, 10 Dec 2015 06:51:23 +0100 [thread overview]
Message-ID: <566912DB.5010000@st.com> (raw)
In-Reply-To: <5669096B.6050505@st.com>
On 12/10/2015 6:11 AM, Giuseppe CAVALLARO wrote:
> On 12/9/2015 6:21 PM, David Laight wrote:
>> From: Giuseppe Cavallaro
>>> Sent: 09 December 2015 08:38
>>> The indexes into the ring buffer are always incremented, and
>>> the entry is accessed via doing a modulo to find the "real" index.
>>> Modulo is an expensive operation.
>>>
>>> This patch replaces the modulo with a simple if clamp.
>>> It helps improve stmmac RX path as it's being called inside RX loop.
>>
>> Is dma_rx_size always a power of 2 ?
>
> no
>
>> If so you can replace the % by & and remove the conditionals.
>>
>> If you have changed the read and write values to indexes
>> then you need to be certain that the 'ring full' and 'ring empty'
>> cases are correctly distinguished.
>
> this is implicitly managed by dirty and curr index.
... also the dma will fail with unavailable buffer.
peppe
>
> thx
> peppe
>
>>
>> David
>>
>
>
>
next prev parent reply other threads:[~2015-12-10 5:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 8:37 [PATCH (net-next.git) 00/18] stmmac: enhance driver performances and update the version Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 01/18] stmmac: share reset function between dwmac100 and dwmac1000 Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 02/18] stmmac: rework DMA bus setting and introduce new platform AXI structure Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 03/18] stmmac: change descriptor layout Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 04/18] stmmac: remove modulo in stmmac_xmit() Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 05/18] stmmac: add length field to dma data Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 06/18] stmmac: add last_segment " Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 07/18] stmmac: add is_jumbo " Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 08/18] stmmac: merge get_rx_owner into rx_status routine Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 09/18] stmmac: optimize tx desc management Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 10/18] stmmac: optimize tx clean function Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 11/18] stmmac: set dirty index out of the loop Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 12/18] stmmac: first frame prep at the end of xmit routine Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 13/18] stmmac: perf, remove modulo in stmmac_rx() Giuseppe Cavallaro
2015-12-09 17:21 ` David Laight
2015-12-10 5:11 ` Giuseppe CAVALLARO
2015-12-10 5:51 ` Giuseppe CAVALLARO [this message]
2015-12-09 8:37 ` [PATCH (net-next.git) 14/18] stmmac: do not poll phy handler when attach a switch Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 15/18] stmmac: fix phy init when attached to a phy Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 16/18] stmmac: do not perform zero-copy for rx frames Giuseppe Cavallaro
2015-12-12 1:09 ` David Miller
2015-12-16 11:33 ` Giuseppe CAVALLARO
2015-12-09 8:37 ` [PATCH (net-next.git) 17/18] stmmac: tune rx copy via threshold Giuseppe Cavallaro
2015-12-09 8:37 ` [PATCH (net-next.git) 18/18] stmmac: update version to Oct_2015 Giuseppe Cavallaro
-- strict thread matches above, loose matches on Subject: below --
2016-01-04 13:06 [PATCHv2 (net-next.git) 00/18] stmmac: enhance driver performances and update the version Giuseppe Cavallaro
2016-01-04 13:06 ` [PATCH (net-next.git) 13/18] stmmac: perf, remove modulo in stmmac_rx() 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=566912DB.5010000@st.com \
--to=peppe.cavallaro@st.com \
--cc=David.Laight@ACULAB.COM \
--cc=alexandre.torgue@st.com \
--cc=fabrice.gasnier@st.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).