From: Taehee Yoo <ap420073@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
irusskikh@marvell.com, epomozov@marvell.com,
netdev@vger.kernel.org
Cc: ap420073@gmail.com
Subject: [PATCH net-next v2 0/3] net: atlantic: Add XDP support
Date: Sat, 19 Mar 2022 14:04:40 +0000 [thread overview]
Message-ID: <20220319140443.6645-1-ap420073@gmail.com> (raw)
This patchset is to make atlantic to support multi-buffer XDP.
The first patch implement control plane of xdp.
The aq_xdp(), callback of .xdp_bpf is added.
The second patch implements data plane of xdp.
XDP_TX, XDP_DROP, and XDP_PASS is supported.
__aq_ring_xdp_clean() is added to receive and execute xdp program.
aq_nic_xmit_xdpf() is added to send packet by XDP.
The third patch implements callback of .ndo_xdp_xmit.
aq_xdp_xmit() is added to send redirected packets and it internally
calls aq_nic_xmit_xdpf().
Memory model is MEM_TYPE_PAGE_ORDER0 so it doesn't reuse rx page when
XDP_TX, XDP_PASS, XDP_REDIRECT.
Default the maximum rx frame size is 2K.
If xdp is attached, size is changed to about 3K.
It can be reused when XDP_DROP, XDP_ABORTED.
Atlantic driver has AQ_CFG_RX_PAGEORDER option and it will be always 0
if xdp is attached.
AQC chip supports 32 multi-queues and 8 vectors(irq).
There are two options.
1. under 8 cores and maximum 4 tx queues per core.
2. under 4 cores and maximum 8 tx queues per core.
Like other drivers, these tx queues can be used only for XDP_TX,
XDP_REDIRECT queue. If so, no tx_lock is needed.
But this patchset doesn't use this strategy because getting hardware tx
queue index cost is too high.
So, tx_lock is used in the aq_nic_xmit_xdpf().
single-core, single queue, 40% cpu utilization.
30.75% bpf_prog_xxx_xdp_prog_tx [k] bpf_prog_xxx_xdp_prog_tx
10.35% [kernel] [k] aq_hw_read_reg <---------- here
4.38% [kernel] [k] get_page_from_freelist
single-core, 8 queues, 100% cpu utilization, half PPS.
45.56% [kernel] [k] aq_hw_read_reg <---------- here
17.58% bpf_prog_xxx_xdp_prog_tx [k] bpf_prog_xxx_xdp_prog_tx
4.72% [kernel] [k] hw_atl_b0_hw_ring_rx_receive
Performance result(64 Byte)
1. XDP_TX
a. xdp_geieric, single core
- 2.5Mpps, 100% cpu
b. xdp_driver, single core
- 4.5Mpps, 40% cpu
c. xdp_generic, 8 core(hyper thread)
- 6.3Mpps, 5~10% cpu
d. xdp_driver, 8 core(hyper thread)
- 6.3Mpps, 5% cpu
2. XDP_REDIRECT
a. xdp_generic, single core
- 2.3Mpps
b. xdp_driver, single core
- 4.5Mpps
V2:
- Do not use inline in C file
Taehee Yoo (3):
net: atlantic: Implement xdp control plane
net: atlantic: Implement xdp data plane
net: atlantic: Implement .ndo_xdp_xmit handler
.../net/ethernet/aquantia/atlantic/aq_cfg.h | 1 +
.../ethernet/aquantia/atlantic/aq_ethtool.c | 8 +
.../net/ethernet/aquantia/atlantic/aq_main.c | 59 +++
.../net/ethernet/aquantia/atlantic/aq_main.h | 2 +
.../net/ethernet/aquantia/atlantic/aq_nic.c | 126 ++++--
.../net/ethernet/aquantia/atlantic/aq_nic.h | 7 +-
.../net/ethernet/aquantia/atlantic/aq_ptp.c | 2 +-
.../net/ethernet/aquantia/atlantic/aq_ring.c | 409 ++++++++++++++++--
.../net/ethernet/aquantia/atlantic/aq_ring.h | 17 +
.../net/ethernet/aquantia/atlantic/aq_vec.c | 23 +-
.../net/ethernet/aquantia/atlantic/aq_vec.h | 6 +
.../aquantia/atlantic/hw_atl/hw_atl_a0.c | 6 +-
.../aquantia/atlantic/hw_atl/hw_atl_b0.c | 10 +-
13 files changed, 595 insertions(+), 81 deletions(-)
--
2.17.1
next reply other threads:[~2022-03-19 14:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-19 14:04 Taehee Yoo [this message]
2022-03-19 14:04 ` [PATCH net-next v2 1/3] net: atlantic: Implement xdp control plane Taehee Yoo
2022-03-19 14:04 ` [PATCH net-next v2 2/3] net: atlantic: Implement xdp data plane Taehee Yoo
2022-03-21 14:18 ` Igor Russkikh
2022-03-21 16:36 ` Taehee Yoo
2022-03-19 14:04 ` [PATCH net-next v2 3/3] net: atlantic: Implement .ndo_xdp_xmit handler Taehee Yoo
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=20220319140443.6645-1-ap420073@gmail.com \
--to=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=epomozov@marvell.com \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).