From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Shay Agroskin <shayagr@amazon.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
kuba@kernel.org, brouer@redhat.com, ilias.apalodimas@linaro.org
Subject: Re: [PATCH net-next 4/4] net: mlx5: add xdp tx return bulking support
Date: Thu, 29 Oct 2020 14:15:57 +0100 [thread overview]
Message-ID: <20201029131557.GD15697@lore-desk> (raw)
In-Reply-To: <pj41zl5z6tl0ln.fsf@u68c7b5b1d2d758.ant.amazon.com>
[-- Attachment #1: Type: text/plain, Size: 2594 bytes --]
>
> Lorenzo Bianconi <lorenzo@kernel.org> writes:
>
> > Convert mlx5 driver to xdp_return_frame_bulk APIs.
> >
> > XDP_REDIRECT (upstream codepath): 8.5Mpps
> > XDP_REDIRECT (upstream codepath + bulking APIs): 10.1Mpps
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> > index ae90d533a350..5fdfbf390d5c 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c
> > @@ -369,8 +369,10 @@ static void mlx5e_free_xdpsq_desc(struct
> > mlx5e_xdpsq *sq,
> > bool recycle)
> > {
> > struct mlx5e_xdp_info_fifo *xdpi_fifo = &sq->db.xdpi_fifo;
> > + struct xdp_frame_bulk bq;
> > u16 i;
> > + bq.xa = NULL;
> > for (i = 0; i < wi->num_pkts; i++) {
> > struct mlx5e_xdp_info xdpi = mlx5e_xdpi_fifo_pop(xdpi_fifo);
> > @@ -379,7 +381,7 @@ static void mlx5e_free_xdpsq_desc(struct
> > mlx5e_xdpsq *sq,
> > /* XDP_TX from the XSK RQ and XDP_REDIRECT */
> > dma_unmap_single(sq->pdev, xdpi.frame.dma_addr,
> > xdpi.frame.xdpf->len, DMA_TO_DEVICE);
> > - xdp_return_frame(xdpi.frame.xdpf);
> > + xdp_return_frame_bulk(xdpi.frame.xdpf, &bq);
> > break;
> > case MLX5E_XDP_XMIT_MODE_PAGE:
> > /* XDP_TX from the regular RQ */
> > @@ -393,6 +395,7 @@ static void mlx5e_free_xdpsq_desc(struct mlx5e_xdpsq
> > *sq,
> > WARN_ON_ONCE(true);
> > }
> > }
> > + xdp_flush_frame_bulk(&bq);
>
> While I understand the rational behind this patchset, using an intermediate
> buffer
> void *q[XDP_BULK_QUEUE_SIZE];
> means more pressure on the data cache.
>
> At the time I ran performance tests on mlx5 to see whether batching skbs
> before passing them to GRO would improve performance. On some flows I got
> worse performance.
> This function seems to have less Dcache contention than RX flow, but maybe
> some performance testing are needed here.
Hi Shay,
this codepath is only activated for "redirected" frames (not for packets
forwarded to networking stack). We run performance comparisons with the
upstream code for this particular use-case and we reported a nice
improvements (8.5Mpps vs 10.1Mpps).
Do you have in mind other possible performance tests to run?
Regards,
Lorenzo
>
> > }
> > bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq)
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2020-10-29 13:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 19:04 [PATCH net-next 0/4] xdp: introduce bulking for page_pool tx return path Lorenzo Bianconi
2020-10-27 19:04 ` [PATCH net-next 1/4] net: xdp: introduce bulking for xdp " Lorenzo Bianconi
2020-10-28 9:27 ` Ilias Apalodimas
2020-10-28 10:23 ` Lorenzo Bianconi
2020-10-28 10:59 ` Ilias Apalodimas
2020-10-28 11:28 ` Lorenzo Bianconi
2020-10-28 11:34 ` Jesper Dangaard Brouer
2020-10-28 11:43 ` Lorenzo Bianconi
2020-10-29 13:52 ` Jesper Dangaard Brouer
2020-10-29 14:02 ` Lorenzo Bianconi
2020-10-29 14:08 ` Ilias Apalodimas
2020-10-27 19:04 ` [PATCH net-next 2/4] net: page_pool: add bulk support for ptr_ring Lorenzo Bianconi
2020-10-29 7:08 ` Ilias Apalodimas
2020-10-29 10:36 ` Lorenzo Bianconi
2020-10-29 7:25 ` Ilias Apalodimas
2020-10-29 10:37 ` Lorenzo Bianconi
2020-10-29 10:13 ` Jesper Dangaard Brouer
2020-10-29 10:31 ` Lorenzo Bianconi
2020-10-29 13:40 ` Jesper Dangaard Brouer
2020-10-27 19:04 ` [PATCH net-next 3/4] net: mvpp2: add xdp tx return bulking support Lorenzo Bianconi
2020-10-27 19:04 ` [PATCH net-next 4/4] net: mlx5: " Lorenzo Bianconi
2020-10-29 11:42 ` Shay Agroskin
2020-10-29 13:15 ` Lorenzo Bianconi [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=20201029131557.GD15697@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shayagr@amazon.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).