From: biao huang <biao.huang@mediatek.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net: stmmac: Fix RX Coalesce IOC always true issue
Date: Wed, 10 Jun 2020 09:30:16 +0800 [thread overview]
Message-ID: <1591752616.29387.26.camel@mhfsdcap03> (raw)
In-Reply-To: <BN6PR12MB1779E6EF20FD8F5F3255CCE8D3820@BN6PR12MB1779.namprd12.prod.outlook.com>
On Tue, 2020-06-09 at 14:20 +0000, Jose Abreu wrote:
> From: Biao Huang <biao.huang@mediatek.com>
> Date: Jun/09/2020, 10:41:33 (UTC+00:00)
>
> > - rx_q->rx_count_frames += priv->rx_coal_frames;
> > - if (rx_q->rx_count_frames > priv->rx_coal_frames)
> > + if (rx_q->rx_count_frames >= priv->rx_coal_frames)
>
> This is no right. If you want to RX IC bit to not always be set you need
> to change coalesce parameters using ethtool.
let's take look at these lines:
1. rx_q->rx_count_frames += priv->rx_coal_frames;
2. if (rx_q->rx_count_frames > priv->rx_coal_frames)
3. rx_q->rx_count_frames = 0;
before the if condition(line 2 above), there is "rx_q->rx_count_frames
+= priv->rx_coal_frames"(line 1 above) sentence; so the if condition
always true, and the assignment rx_q->rx_count_frames = 0 happens.
Here is the result on our platform, all desc3[30] = 1; you can also
check it on your platform. no matter what rx-frames you set with
"ethtool -C eth0 rx-frames", desc3[30] always true.
# ethtool -c eth0
Coalesce parameters for eth0:
Adaptive RX: off TX: off
stats-block-usecs: 0
sample-interval: 0
pkt-rate-low: 0
pkt-rate-high: 0
rx-usecs: 301
rx-frames: 25
rx-usecs-irq: 0
rx-frames-irq: 0
#cd /sys/kernel/debug/stmmaceth/eth0
# cat descriptors_status
RX Queue 0:
Descriptor ring:
0 [0x5038b000]: 0xa8541a82 0x0 0x0 0xc1000000
1 [0x5038b010]: 0xa8541202 0x0 0x0 0xc1000000
2 [0x5038b020]: 0xa8540982 0x0 0x0 0xc1000000
3 [0x5038b030]: 0xa8540102 0x0 0x0 0xc1000000
4 [0x5038b040]: 0xa658f802 0x0 0x0 0xc1000000
5 [0x5038b050]: 0xa658ef82 0x0 0x0 0xc1000000
6 [0x5038b060]: 0xa658e702 0x0 0x0 0xc1000000
7 [0x5038b070]: 0xa658de82 0x0 0x0 0xc1000000
8 [0x5038b080]: 0xa658d602 0x0 0x0 0xc1000000
9 [0x5038b090]: 0xa658cd82 0x0 0x0 0xc1000000
10 [0x5038b0a0]: 0xa658c502 0x0 0x0 0xc1000000
11 [0x5038b0b0]: 0xa658bc82 0x0 0x0 0xc1000000
12 [0x5038b0c0]: 0xa658b402 0x0 0x0 0xc1000000
13 [0x5038b0d0]: 0xa658ab82 0x0 0x0 0xc1000000
14 [0x5038b0e0]: 0xa658a302 0x0 0x0 0xc1000000
15 [0x5038b0f0]: 0xa6589a82 0x0 0x0 0xc1000000
16 [0x5038b100]: 0xa6589202 0x0 0x0 0xc1000000
17 [0x5038b110]: 0xa6588982 0x0 0x0 0xc1000000
18 [0x5038b120]: 0xa6588102 0x0 0x0 0xc1000000
19 [0x5038b130]: 0xa46df802 0x0 0x0 0xc1000000
20 [0x5038b140]: 0xa46def82 0x0 0x0 0xc1000000
21 [0x5038b150]: 0xa46de702 0x0 0x0 0xc1000000
22 [0x5038b160]: 0xa46dde82 0x0 0x0 0xc1000000
23 [0x5038b170]: 0xa46dd602 0x0 0x0 0xc1000000
24 [0x5038b180]: 0xa46dcd82 0x0 0x0 0xc1000000
25 [0x5038b190]: 0xa46dc502 0x0 0x0 0xc1000000
26 [0x5038b1a0]: 0xa46dbc82 0x0 0x0 0xc1000000
27 [0x5038b1b0]: 0xa46db402 0x0 0x0 0xc1000000
28 [0x5038b1c0]: 0xa46dab82 0x0 0x0 0xc1000000
29 [0x5038b1d0]: 0xa46da302 0x0 0x0 0xc1000000
30 [0x5038b1e0]: 0xa46d9a82 0x0 0x0 0xc1000000
...
> ---
> Thanks,
> Jose Miguel Abreu
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2020-06-10 1:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 9:41 [PATCH] net: stmmac: Fix RX Coalesce IOC always true issue Biao Huang
2020-06-09 14:20 ` Jose Abreu
2020-06-10 1:30 ` biao huang [this message]
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=1591752616.29387.26.camel@mhfsdcap03 \
--to=biao.huang@mediatek.com \
--cc=Jose.Abreu@synopsys.com \
--cc=alexandre.torgue@st.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
/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