From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
lorenzo.bianconi@redhat.com, davem@davemloft.net,
kuba@kernel.org, ilias.apalodimas@linaro.org, brouer@redhat.com
Subject: Re: [PATCH v4 net-next 5/5] net: mlx5: add xdp tx return bulking support
Date: Tue, 10 Nov 2020 11:48:58 +0100 [thread overview]
Message-ID: <20201110114858.400101e8@carbon> (raw)
In-Reply-To: <652d803bf1ffab08ff947da5e915add9fb737846.1604686496.git.lorenzo@kernel.org>
On Fri, 6 Nov 2020 19:19:11 +0100
Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> 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(-)
This patch is not 100% correct. The bulking need to happen at another
level. I have already fixed this up in the patches I'm currently
benchmarking with. (Lorenzo is informed and aware)
Too many details, but all avail in[1].
[1] https://github.com/xdp-project/xdp-project/blob/master/areas/mem/xdp_bulk_return01.org
> 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);
> }
>
> bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq)
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
prev parent reply other threads:[~2020-11-10 10:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 18:19 [PATCH v4 net-next 0/5] xdp: introduce bulking for page_pool tx return path Lorenzo Bianconi
2020-11-06 18:19 ` [PATCH v4 net-next 1/5] net: xdp: introduce bulking for xdp " Lorenzo Bianconi
2020-11-10 10:53 ` Jesper Dangaard Brouer
2020-11-10 11:18 ` Jesper Dangaard Brouer
2020-11-06 18:19 ` [PATCH v4 net-next 2/5] net: page_pool: add bulk support for ptr_ring Lorenzo Bianconi
2020-11-06 20:02 ` Jesper Dangaard Brouer
2020-11-07 14:29 ` Lorenzo Bianconi
2020-11-10 11:00 ` Jesper Dangaard Brouer
2020-11-06 18:19 ` [PATCH v4 net-next 3/5] net: mvneta: add xdp tx return bulking support Lorenzo Bianconi
2020-11-06 18:19 ` [PATCH v4 net-next 4/5] net: mvpp2: " Lorenzo Bianconi
2020-11-06 18:19 ` [PATCH v4 net-next 5/5] net: mlx5: " Lorenzo Bianconi
2020-11-10 10:48 ` Jesper Dangaard Brouer [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=20201110114858.400101e8@carbon \
--to=brouer@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
/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).