All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ong Boon Leong <boon.leong.ong@intel.com>
To: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	Ong Boon Leong <boon.leong.ong@intel.com>
Subject: [PATCH net-next 0/7] stmmac: add XDP ZC support
Date: Mon, 12 Apr 2021 23:41:23 +0800	[thread overview]
Message-ID: <20210412154130.20742-1-boon.leong.ong@intel.com> (raw)

Hi,

This is the v1 patch series to add XDP ZC support to stmmac driver and
the changes are as listed in below summary:-

1-4/7: Refactor RX & TX buffer allocation and initialization to prepare
       stmmac driver for XSK RX & TX pool enabling and disabling.

5/7: Refactor stmmac_xdp_run_prog() for XDP ZC use which does not need
     to check for XDP program loaded.

6-7/7: XDP ZC RX and TX enabling.

The above patch series have been tested using xdpsock app in samples/bpf
directory on Intel mGbE controller. The DUT receives burst traffic
packets generated by using pktgen_sample03_burst_single_flow.sh in
samples/pktgen.

########################################################################

==========
A) RX-Only
==========

root@intel-corei7-64:~ $ ./xdpsock  -i eth0 -r -S

 sock0@eth0:0 rxdrop xdp-skb
                   pps            pkts           1.00
rx                 112161         12229475
tx                 0              0

 sock0@eth0:0 rxdrop xdp-skb
                   pps            pkts           1.00
rx                 112280         12341779
tx                 0              0

 sock0@eth0:0 rxdrop xdp-skb
                   pps            pkts           1.00
rx                 112358         12454155
tx                 0              0

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock  -i eth0 -r -N -c

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 681082         2616133
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 681205         3297415
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 681386         3978873
tx                 0              0

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock  -i eth0 -r -z

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 703915         19579779
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 703766         20283768
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 703383         20987229
tx                 0              0

==========
B) TX-Only
==========

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -t -S

 sock0@eth0:0 txonly xdp-skb
                   pps            pkts           1.00
rx                 0              0
tx                 140269         4326720

 sock0@eth0:0 txonly xdp-skb
                   pps            pkts           1.00
rx                 0              0
tx                 140514         4467264

 sock0@eth0:0 txonly xdp-skb
                   pps            pkts           1.00
rx                 0              0
tx                 140009         4607296

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -t -N -c

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 138222         3108160

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 139629         3247872

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 139821         3387712

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -t -z

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 447382         13390848

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 447384         13838272

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 447384         14285696

================
C) L2 Forwarding
================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -l -S

 sock0@eth0:0 l2fwd xdp-skb
                   pps            pkts           1.00
rx                 85021          7363434
tx                 85021          7363434

 sock0@eth0:0 l2fwd xdp-skb
                   pps            pkts           1.00
rx                 85003          7448446
tx                 85003          7448446

 sock0@eth0:0 l2fwd xdp-skb
                   pps            pkts           1.00
rx                 84946          7533403
tx                 84946          7533403

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -l -N -c

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 132136         1092673
tx                 132072         1092609

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 132428         1225118
tx                 132428         1225054

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 132623         1357757
tx                 132623         1357693

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -l -z

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 468476         43619530
tx                 468476         43619466

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 468633         44088218
tx                 468633         44088154

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 468439         44556775
tx                 468439         44556711

 ########################################################################

Based on the results obtained from above using xdpsock test cases, the
result looks promising. It will be great if community can help to review
and test the above patch series on your respective platform and provide
me feedback for any improvement.

Thank you very much,
Boon Leong

Ong Boon Leong (7):
  net: stmmac: rearrange RX buffer allocation and free functions
  net: stmmac: introduce dma_recycle_rx_skbufs for
    stmmac_reinit_rx_buffers
  net: stmmac: refactor stmmac_init_rx_buffers for
    stmmac_reinit_rx_buffers
  net: stmmac: rearrange RX and TX desc init into per-queue basis
  net: stmmac: Refactor __stmmac_xdp_run_prog for XDP ZC
  net: stmmac: Enable RX via AF_XDP zero-copy
  net: stmmac: Add TX via XDP zero-copy socket

 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |   24 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 1698 +++++++++++++----
 .../net/ethernet/stmicro/stmmac/stmmac_xdp.c  |   94 +
 .../net/ethernet/stmicro/stmmac/stmmac_xdp.h  |    3 +
 4 files changed, 1396 insertions(+), 423 deletions(-)

-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Ong Boon Leong <boon.leong.ong@intel.com>
To: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	Ong Boon Leong <boon.leong.ong@intel.com>
Subject: [PATCH net-next 0/7] stmmac: add XDP ZC support
Date: Mon, 12 Apr 2021 23:41:23 +0800	[thread overview]
Message-ID: <20210412154130.20742-1-boon.leong.ong@intel.com> (raw)

Hi,

This is the v1 patch series to add XDP ZC support to stmmac driver and
the changes are as listed in below summary:-

1-4/7: Refactor RX & TX buffer allocation and initialization to prepare
       stmmac driver for XSK RX & TX pool enabling and disabling.

5/7: Refactor stmmac_xdp_run_prog() for XDP ZC use which does not need
     to check for XDP program loaded.

6-7/7: XDP ZC RX and TX enabling.

The above patch series have been tested using xdpsock app in samples/bpf
directory on Intel mGbE controller. The DUT receives burst traffic
packets generated by using pktgen_sample03_burst_single_flow.sh in
samples/pktgen.

########################################################################

==========
A) RX-Only
==========

root@intel-corei7-64:~ $ ./xdpsock  -i eth0 -r -S

 sock0@eth0:0 rxdrop xdp-skb
                   pps            pkts           1.00
rx                 112161         12229475
tx                 0              0

 sock0@eth0:0 rxdrop xdp-skb
                   pps            pkts           1.00
rx                 112280         12341779
tx                 0              0

 sock0@eth0:0 rxdrop xdp-skb
                   pps            pkts           1.00
rx                 112358         12454155
tx                 0              0

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock  -i eth0 -r -N -c

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 681082         2616133
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 681205         3297415
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 681386         3978873
tx                 0              0

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock  -i eth0 -r -z

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 703915         19579779
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 703766         20283768
tx                 0              0

 sock0@eth0:0 rxdrop xdp-drv
                   pps            pkts           1.00
rx                 703383         20987229
tx                 0              0

==========
B) TX-Only
==========

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -t -S

 sock0@eth0:0 txonly xdp-skb
                   pps            pkts           1.00
rx                 0              0
tx                 140269         4326720

 sock0@eth0:0 txonly xdp-skb
                   pps            pkts           1.00
rx                 0              0
tx                 140514         4467264

 sock0@eth0:0 txonly xdp-skb
                   pps            pkts           1.00
rx                 0              0
tx                 140009         4607296

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -t -N -c

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 138222         3108160

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 139629         3247872

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 139821         3387712

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -t -z

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 447382         13390848

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 447384         13838272

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           1.00
rx                 0              0
tx                 447384         14285696

================
C) L2 Forwarding
================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -l -S

 sock0@eth0:0 l2fwd xdp-skb
                   pps            pkts           1.00
rx                 85021          7363434
tx                 85021          7363434

 sock0@eth0:0 l2fwd xdp-skb
                   pps            pkts           1.00
rx                 85003          7448446
tx                 85003          7448446

 sock0@eth0:0 l2fwd xdp-skb
                   pps            pkts           1.00
rx                 84946          7533403
tx                 84946          7533403

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -l -N -c

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 132136         1092673
tx                 132072         1092609

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 132428         1225118
tx                 132428         1225054

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 132623         1357757
tx                 132623         1357693

 ====================================================

root@intel-corei7-64:~ $ ./xdpsock -i eth0 -l -z

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 468476         43619530
tx                 468476         43619466

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 468633         44088218
tx                 468633         44088154

 sock0@eth0:0 l2fwd xdp-drv
                   pps            pkts           1.00
rx                 468439         44556775
tx                 468439         44556711

 ########################################################################

Based on the results obtained from above using xdpsock test cases, the
result looks promising. It will be great if community can help to review
and test the above patch series on your respective platform and provide
me feedback for any improvement.

Thank you very much,
Boon Leong

Ong Boon Leong (7):
  net: stmmac: rearrange RX buffer allocation and free functions
  net: stmmac: introduce dma_recycle_rx_skbufs for
    stmmac_reinit_rx_buffers
  net: stmmac: refactor stmmac_init_rx_buffers for
    stmmac_reinit_rx_buffers
  net: stmmac: rearrange RX and TX desc init into per-queue basis
  net: stmmac: Refactor __stmmac_xdp_run_prog for XDP ZC
  net: stmmac: Enable RX via AF_XDP zero-copy
  net: stmmac: Add TX via XDP zero-copy socket

 drivers/net/ethernet/stmicro/stmmac/stmmac.h  |   24 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 1698 +++++++++++++----
 .../net/ethernet/stmicro/stmmac/stmmac_xdp.c  |   94 +
 .../net/ethernet/stmicro/stmmac/stmmac_xdp.h  |    3 +
 4 files changed, 1396 insertions(+), 423 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2021-04-12 15:37 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 15:41 Ong Boon Leong [this message]
2021-04-12 15:41 ` [PATCH net-next 0/7] stmmac: add XDP ZC support Ong Boon Leong
2021-04-12 15:41 ` [PATCH net-next 1/7] net: stmmac: rearrange RX buffer allocation and free functions Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong
2021-04-13  0:58   ` kernel test robot
2021-04-12 15:41 ` [PATCH net-next 2/7] net: stmmac: introduce dma_recycle_rx_skbufs for stmmac_reinit_rx_buffers Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong
2021-04-12 15:41 ` [PATCH net-next 3/7] net: stmmac: refactor stmmac_init_rx_buffers " Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong
2021-04-12 15:41 ` [PATCH net-next 4/7] net: stmmac: rearrange RX and TX desc init into per-queue basis Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong
2021-04-12 15:41 ` [PATCH net-next 5/7] net: stmmac: Refactor __stmmac_xdp_run_prog for XDP ZC Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong
2021-04-12 15:41 ` [PATCH net-next 6/7] net: stmmac: Enable RX via AF_XDP zero-copy Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong
2021-04-12 21:19   ` David Miller
2021-04-12 21:19     ` David Miller
2021-04-13  7:58     ` Ong, Boon Leong
2021-04-13  7:58       ` Ong, Boon Leong
2021-04-12 15:41 ` [PATCH net-next 7/7] net: stmmac: Add TX via XDP zero-copy socket Ong Boon Leong
2021-04-12 15:41   ` Ong Boon Leong

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=20210412154130.20742-1-boon.leong.ong@intel.com \
    --to=boon.leong.ong@intel.com \
    --cc=alexandre.torgue@st.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=joabreu@synopsys.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=songliubraving@fb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.