linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Pavel Machek <pavel@ucw.cz>, David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.
Date: Fri, 2 Dec 2016 09:24:48 +0100	[thread overview]
Message-ID: <b6ac7a3c-6774-9568-1cc0-97074eaa928f@st.com> (raw)
In-Reply-To: <20161124212540.GA24796@amd>


Hello


On 11/24/2016 10:25 PM, Pavel Machek wrote:
> Hi!
>
>>>> I'm debugging strange delays during transmit in stmmac driver. They
>>>> seem to be present in 4.4 kernel (and older kernels, too). Workload is
>>>> burst of udp packets being sent, pause, burst of udp packets, ...
> ...
>>> 4.9-rc6 still has the delays. With the
>>>
>>> #define STMMAC_COAL_TX_TIMER 1000
>>> #define STMMAC_TX_MAX_FRAMES 2
>>>
>>> settings, delays go away, and driver still works. (It fails fairly
>>> fast in 4.4). Good news. But the question still is: what is going on
>>> there?
>>
>> 256 packets looks way too large for being a trigger for aborting the
>> TX coalescing timer.
>>
>> Looking more deeply into this, the driver is using non-highres timers
>> to implement the TX coalescing.  This simply cannot work.
>>
>> 1 HZ, which is the lowest granularity of non-highres timers in the
>> kernel, is variable as well as already too large of a delay for
>> effective TX coalescing.
>>
>> I seriously think that the TX coalescing support should be ripped out
>> or disabled entirely until it is implemented properly in this
>> driver.
>
> Ok, I'd disable coalescing, but could not figure it out till. What is
> generic way to do that?
>
> It seems only thing stmmac_tx_timer() does is calling
> stmmac_tx_clean(), which reclaims tx_skbuff[] entries. It should be
> possible to do that explicitely, without delay, but it stops working
> completely if I attempt to do that.
>
> On a side note, stmmac_poll() does stmmac_enable_dma_irq() while
> stmmac_dma_interrupt() disables interrupts. But I don't see any
> protection between the two, so IMO it could race and we'd end up
> without polling or interrupts...


the idea behind the TX mitigation is to mix the interrupt and
timer and this approach gave us real benefit in terms
of performances and CPU usage (especially on SH4-200/SH4-300 platforms
based).
In the ring, some descriptors can raise the irq (according to a
threshold) and set the IC bit. In this path, the NAPI  poll will be
scheduled.
But there is a timer that can run (and we experimented that no high
resolution is needed) to clear the tx resources.
Concerning the lock protection, we had reviewed long time ago and
IIRC, no raise condition should be present. Open to review it, again!

So, welcome any other schema and testing on platforms supported.


Hoping this summary can help.

Peppe


>
> Thanks and best regards,
> 									Pavel
>

  reply	other threads:[~2016-12-02  8:24 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 10:51 stmmac ethernet in kernel 4.4: coalescing related pauses? Pavel Machek
2016-11-24  8:55 ` stmmac ethernet in kernel 4.9-rc6: coalescing related pauses Pavel Machek
2016-11-24 10:29   ` Pavel Machek
2016-11-24 10:36     ` Pavel Machek
2016-11-24 10:46       ` [PATCH] stmmac ethernet: unify locking Pavel Machek
2016-11-24 11:05         ` [PATCH] stmmac ethernet: remove cut & paste code Pavel Machek
2016-11-24 20:05           ` Joe Perches
2016-11-24 21:44             ` Pavel Machek
2016-11-24 22:27               ` Joe Perches
2016-11-28 11:50                 ` Pavel Machek
2016-11-28 14:24                   ` Joe Perches
2016-11-28 14:35                     ` Pavel Machek
2016-11-28 16:03                       ` Joe Perches
2016-11-24 16:04   ` stmmac ethernet in kernel 4.9-rc6: coalescing related pauses David Miller
2016-11-24 21:25     ` Pavel Machek
2016-12-02  8:24       ` Giuseppe CAVALLARO [this message]
2016-12-02  8:41         ` Giuseppe CAVALLARO
2016-12-02  8:45         ` Pavel Machek
2016-12-02  9:43           ` Giuseppe CAVALLARO
2016-12-02 12:32             ` Pavel Machek
2016-12-02 13:51               ` Giuseppe CAVALLARO
2016-12-02 14:26                 ` Alexandre Torgue
2016-12-02 15:19                   ` Giuseppe CAVALLARO
2016-12-05 12:14                     ` Pavel Machek
2016-12-05 12:01                 ` Pavel Machek
2016-12-05 10:15             ` Pavel Machek
2016-12-05 11:40               ` Lino Sanfilippo
2016-12-05 22:02                 ` Pavel Machek
2016-12-05 22:37                   ` Lino Sanfilippo
2016-12-05 22:40                     ` Pavel Machek
2016-12-05 22:54                       ` Lino Sanfilippo
2016-12-05 23:11                         ` Lino Sanfilippo
2016-12-02 14:05           ` Aw: " Lino Sanfilippo
2016-12-07 12:31             ` [RFC] " Pavel Machek
2016-12-07 13:18               ` Lino Sanfilippo
2016-12-05 11:56         ` Pavel Machek
2016-11-28 11:55     ` [PATCH] stmmac: fix comments, make debug output consistent Pavel Machek
2016-11-30  0:53       ` David Miller
2016-11-28 12:13     ` stmmac ethernet in kernel 4.9-rc6: coalescing related pauses Pavel Machek
2016-11-28 12:17     ` [PATCH] stmmac: reduce code duplication getting basic descriptors Pavel Machek
2016-11-28 15:25       ` kbuild test robot
2016-12-02 14:09       ` Alexandre Torgue
2016-11-30 11:44     ` [PATCH] stmmac: simplify flag assignment Pavel Machek
2016-12-01 20:23       ` David Miller
2016-12-01 22:48         ` stmmac: turn coalescing / NAPI off in stmmac Pavel Machek
2016-12-02  8:39           ` Giuseppe CAVALLARO
2016-12-02 10:42             ` Pavel Machek
2016-12-02 15:31               ` Giuseppe CAVALLARO
2016-12-05 11:45                 ` Pavel Machek
2016-12-02  8:27       ` [PATCH] stmmac: simplify flag assignment Giuseppe CAVALLARO
2016-12-01 10:32     ` [PATCH] stmmac: cleanup documenation, make it match reality Pavel Machek
2016-12-03 20:07       ` David Miller
2016-12-05 12:27     ` [PATCH] stmmac: disable tx coalescing Pavel Machek
2016-12-11 19:07       ` Pavel Machek
2016-12-11 19:31         ` David Miller
2016-12-11 19:57           ` Pavel Machek
2016-11-28 13:07 ` stmmac ethernet in kernel 4.4: coalescing related pauses? Lino Sanfilippo
2016-11-28 14:54   ` David Miller
2016-11-28 15:31     ` Eric Dumazet
2016-11-28 15:57       ` Lino Sanfilippo
2016-11-28 16:30         ` David Miller
2016-11-28 17:01           ` Lino Sanfilippo
2016-11-30 10:28       ` Pavel Machek
2016-11-28 15:33     ` Lino Sanfilippo

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=b6ac7a3c-6774-9568-1cc0-97074eaa928f@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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).