From: Yunsheng Lin <linyunsheng@huawei.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, <davem@davemloft.net>,
<kuba@kernel.org>
Cc: <olteanv@gmail.com>, <ast@kernel.org>, <daniel@iogearbox.net>,
<andriin@fb.com>, <edumazet@google.com>, <weiwan@google.com>,
<cong.wang@bytedance.com>, <ap420073@gmail.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@openeuler.org>, <mkl@pengutronix.de>,
<linux-can@vger.kernel.org>, <jhs@mojatatu.com>,
<xiyou.wangcong@gmail.com>, <jiri@resnulli.us>,
<andrii@kernel.org>, <kafai@fb.com>, <songliubraving@fb.com>,
<yhs@fb.com>, <john.fastabend@gmail.com>, <kpsingh@kernel.org>,
<bpf@vger.kernel.org>, <jonas.bonn@netrounds.com>,
<pabeni@redhat.com>, <mzhivich@akamai.com>, <johunt@akamai.com>,
<albcamus@gmail.com>, <kehuan.feng@gmail.com>
Subject: Re: [RFC v3] net: sched: implement TCQ_F_CAN_BYPASS for lockless qdisc
Date: Tue, 23 Mar 2021 19:34:56 +0800 [thread overview]
Message-ID: <774fadf5-6383-f9e0-bbc6-e5862482a7d1@huawei.com> (raw)
In-Reply-To: <5bef912e-aa7d-8a27-4d18-ac8cf4f7afdf@pengutronix.de>
On 2021/3/23 14:37, Ahmad Fatoum wrote:
> Hi,
>
> On 22.03.21 10:09, Yunsheng Lin wrote:
>> Currently pfifo_fast has both TCQ_F_CAN_BYPASS and TCQ_F_NOLOCK
>> flag set, but queue discipline by-pass does not work for lockless
>> qdisc because skb is always enqueued to qdisc even when the qdisc
>> is empty, see __dev_xmit_skb().
>>
>> This patch calls sch_direct_xmit() to transmit the skb directly
>> to the driver for empty lockless qdisc too, which aviod enqueuing
>> and dequeuing operation. qdisc->empty is set to false whenever a
>> skb is enqueued, see pfifo_fast_enqueue(), and is set to true when
>> skb dequeuing return NULL, see pfifo_fast_dequeue().
>>
>> There is a data race between enqueue/dequeue and qdisc->empty
>> setting, qdisc->empty is only used as a hint, so we need to call
>> sch_may_need_requeuing() to see if the queue is really empty and if
>> there is requeued skb, which has higher priority than the current
>> skb.
>>
>> The performance for ip_forward test increases about 10% with this
>> patch.
>>
>> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
>> ---
>> Hi, Vladimir and Ahmad
>> Please give it a test to see if there is any out of order
>> packet for this patch, which has removed the priv->lock added in
>> RFC v2.
>
> Overnight test (10h, 64 mil frames) didn't see any out-of-order frames
> between 2 FlexCANs on a dual core machine:
>
> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>
> No performance measurements taken.
Thanks for the testing.
And I has done the performance measurement.
L3 forward testing improves from 1.09Mpps to 1.21Mpps, still about
10% improvement.
pktgen + dummy netdev:
threads without+this_patch with+this_patch delta
1 2.56Mpps 3.11Mpps +21%
2 3.76Mpps 4.31Mpps +14%
4 5.51Mpps 5.53Mpps +0.3%
8 2.81Mpps 2.72Mpps -3%
16 2.24Mpps 2.22Mpps -0.8%
>
>>
prev parent reply other threads:[~2021-03-23 11:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 6:53 [PATCH net] net: sched: fix packet stuck problem " Yunsheng Lin
2021-03-19 9:25 ` [Linuxarm] " Yunsheng Lin
2021-03-19 19:45 ` Cong Wang
2021-03-22 1:37 ` Yunsheng Lin
2021-03-19 19:40 ` Cong Wang
2021-03-22 1:31 ` Yunsheng Lin
2021-03-22 9:09 ` [RFC v3] net: sched: implement TCQ_F_CAN_BYPASS " Yunsheng Lin
2021-03-22 20:00 ` Vladimir Oltean
2021-03-23 11:39 ` Vladimir Oltean
2021-03-23 6:37 ` Ahmad Fatoum
2021-03-23 11:34 ` Yunsheng Lin [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=774fadf5-6383-f9e0-bbc6-e5862482a7d1@huawei.com \
--to=linyunsheng@huawei.com \
--cc=a.fatoum@pengutronix.de \
--cc=albcamus@gmail.com \
--cc=andrii@kernel.org \
--cc=andriin@fb.com \
--cc=ap420073@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cong.wang@bytedance.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=johunt@akamai.com \
--cc=jonas.bonn@netrounds.com \
--cc=kafai@fb.com \
--cc=kehuan.feng@gmail.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=mkl@pengutronix.de \
--cc=mzhivich@akamai.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=songliubraving@fb.com \
--cc=weiwan@google.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yhs@fb.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
all inboxes | Powered by JetHome®