From: "Yanchao Yang (杨彦超)" <Yanchao.Yang@mediatek.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ryazanov.s.a@gmail.com" <ryazanov.s.a@gmail.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"loic.poulain@linaro.org" <loic.poulain@linaro.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"davem@davemloft.net" <davem@davemloft.net>
Cc: "Chris Feng (冯保林)" <Chris.Feng@mediatek.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Mingliang Xu (徐明亮)" <mingliang.xu@mediatek.com>,
"linuxwwan@mediatek.com" <linuxwwan@mediatek.com>,
"Min Dong (董敏)" <min.dong@mediatek.com>,
"m.chetan.kumar@intel.com" <m.chetan.kumar@intel.com>,
"linuxwwan@intel.com" <linuxwwan@intel.com>,
"Liang Lu (吕亮)" <liang.lu@mediatek.com>,
"Haijun Liu (刘海军)" <haijun.liu@mediatek.com>,
"Haozhe Chang (常浩哲)" <Haozhe.Chang@mediatek.com>,
"Hua Yang (杨华)" <Hua.Yang@mediatek.com>,
"Xiayu Zhang (张夏宇)" <Xiayu.Zhang@mediatek.com>,
"Aiden Wang (王咏麒)" <Aiden.Wang@mediatek.com>,
"Felix Chen (陈非)" <Felix.Chen@mediatek.com>,
"Ting Wang (王挺)" <ting.wang@mediatek.com>,
"Guohao Zhang (张国豪)" <Guohao.Zhang@mediatek.com>,
"Mingchuang Qiao (乔明闯)" <Mingchuang.Qiao@mediatek.com>,
"Lambert Wang (王伟)" <Lambert.Wang@mediatek.com>
Subject: Re: [PATCH net-next v1 02/13] net: wwan: tmi: Add buffer management
Date: Fri, 9 Dec 2022 10:26:09 +0000 [thread overview]
Message-ID: <a9d4eebb99d53224366c387ae314173b870d134c.camel@mediatek.com> (raw)
In-Reply-To: <14db8809-6144-1d10-59e7-298079b2e6e2@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2743 bytes --]
Hello Sergey,
On Sun, 2022-12-04 at 22:58 +0400, Sergey Ryazanov wrote:
> On 22.11.2022 15:11, Yanchao Yang wrote:
> > From: MediaTek Corporation <linuxwwan@mediatek.com>
> >
> > To malloc I/O memory as soon as possible, buffer management comes
> > into being.
> > It creates buffer pools that reserve some buffers through deferred
> > works when
> > the driver isn't busy.
> >
> > The buffer management provides unified memory allocation/de-
> > allocation
> > interfaces for other modules. It supports two buffer types of SKB
> > and page.
> > Two reload work queues with different priority values are provided
> > to meet
> > various requirements of the control plane and the data plane.
> >
> > When the reserved buffer count of the pool is less than a threshold
> > (default
> > is 2/3 of the pool size), the reload work will restart to allocate
> > buffers
> > from the OS until the buffer pool becomes full. When the buffer
> > pool fills,
> > the OS will recycle the buffer freed by the user.
> >
> > Signed-off-by: Mingliang Xu <mingliang.xu@mediatek.com>
> > Signed-off-by: MediaTek Corporation <linuxwwan@mediatek.com>
> > ---
> > drivers/net/wwan/mediatek/Makefile | 3 +-
> > drivers/net/wwan/mediatek/mtk_bm.c | 369
> > ++++++++++++++++++++++++++++
> > drivers/net/wwan/mediatek/mtk_bm.h | 79 ++++++
> > drivers/net/wwan/mediatek/mtk_dev.c | 11 +-
> > drivers/net/wwan/mediatek/mtk_dev.h | 1 +
> > 5 files changed, 461 insertions(+), 2 deletions(-)
> > create mode 100644 drivers/net/wwan/mediatek/mtk_bm.c
> > create mode 100644 drivers/net/wwan/mediatek/mtk_bm.h
>
> Yanchao, can you share some numbers, how this custom pool is
> outperform
> the regular kernel allocator?
Prepare 2 drivers *.ko for comparison.
Driver A (following named A): enable pre-allocate buffer pool.
Driver B (following named A): disenable pre-allocate buffer pool. It
uses kernel API directly (__dev_alloc_skb and netdev_alloc_frag)
Test Instrument: Keysight UXM TA
Iperf command:
Server Command: iperf3 -s -p 5002 -i 1
Client Command: iperf3 -c 192.168.2.1 -p 5002 -i 1 -w 8M -t 30 -R -P 5
Test result: Fig 1. A’s TCP DL throughput Fig 2. B’s TCP DL throughput
(Ref attachment)
From the results, it represents that the A’s IP packets throughput
reaches 7Gbits/sec, while B’s throughput is 4.7Gbits/sec. A’s
throughput is up about 50% compared with B.
In addition, from ftrace, it represents following results.
A: it takes 14.241828s for allocating 33211099 buffers. The average
time is about 0.4us.
B: it takes 7.677069s for allocating 10890789 buffers. The average time
is about 0.7us.
>
> --
> Sergey
many thanks.
Yanchao.Yang
[-- Attachment #2: fig1.jpg --]
[-- Type: image/jpeg, Size: 35073 bytes --]
[-- Attachment #3: fig2.jpg --]
[-- Type: image/jpeg, Size: 36156 bytes --]
next prev parent reply other threads:[~2022-12-09 10:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 11:11 [PATCH net-next v1 00/13] net: wwan: tmi: PCIe driver for MediaTek M.2 modem Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 01/13] net: wwan: tmi: Add PCIe core Yanchao Yang
2022-11-24 11:06 ` AngeloGioacchino Del Regno
2022-12-05 12:40 ` Yanchao Yang (杨彦超)
2022-12-05 12:47 ` AngeloGioacchino Del Regno
2022-12-26 1:43 ` Yanchao Yang (杨彦超)
2022-12-04 18:52 ` Sergey Ryazanov
2022-12-07 2:33 ` Yanchao Yang (杨彦超)
2022-12-16 20:40 ` Sergey Ryazanov
2023-01-11 13:33 ` Yanchao Yang (杨彦超)
2022-11-22 11:11 ` [PATCH net-next v1 02/13] net: wwan: tmi: Add buffer management Yanchao Yang
2022-12-04 18:58 ` Sergey Ryazanov
2022-12-09 10:26 ` Yanchao Yang (杨彦超) [this message]
2022-12-16 20:17 ` Sergey Ryazanov
2023-01-11 13:37 ` Yanchao Yang (杨彦超)
2022-11-22 11:11 ` [PATCH net-next v1 03/13] net: wwan: tmi: Add control plane transaction layer Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 04/13] net: wwan: tmi: Add control DMA interface Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 05/13] net: wwan: tmi: Add control port Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 06/13] net: wwan: tmi: Add FSM thread Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 07/13] net: wwan: tmi: Add AT & MBIM WWAN ports Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 08/13] net: wwan: tmi: Introduce data plane hardware interface Yanchao Yang
2022-11-22 11:11 ` [PATCH net-next v1 09/13] net: wwan: tmi: Add data plane transaction layer Yanchao Yang
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=a9d4eebb99d53224366c387ae314173b870d134c.camel@mediatek.com \
--to=yanchao.yang@mediatek.com \
--cc=Aiden.Wang@mediatek.com \
--cc=Chris.Feng@mediatek.com \
--cc=Felix.Chen@mediatek.com \
--cc=Guohao.Zhang@mediatek.com \
--cc=Haozhe.Chang@mediatek.com \
--cc=Hua.Yang@mediatek.com \
--cc=Lambert.Wang@mediatek.com \
--cc=Mingchuang.Qiao@mediatek.com \
--cc=Xiayu.Zhang@mediatek.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haijun.liu@mediatek.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=liang.lu@mediatek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linuxwwan@intel.com \
--cc=linuxwwan@mediatek.com \
--cc=loic.poulain@linaro.org \
--cc=m.chetan.kumar@intel.com \
--cc=min.dong@mediatek.com \
--cc=mingliang.xu@mediatek.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
--cc=ting.wang@mediatek.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®