bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: netdev@vger.kernel.org
Cc: bpf@vger.kernel.org, lorenzo.bianconi@redhat.com,
	davem@davemloft.net, kuba@kernel.org, brouer@redhat.com,
	ilias.apalodimas@linaro.org
Subject: [PATCH net-next 3/4] net: mvpp2: add xdp tx return bulking support
Date: Tue, 27 Oct 2020 20:04:09 +0100	[thread overview]
Message-ID: <ea0343b52e83dd46a5082383aa59b9ea4d67a4e4.1603824486.git.lorenzo@kernel.org> (raw)
In-Reply-To: <cover.1603824486.git.lorenzo@kernel.org>

Convert mvpp2 driver to xdp_return_frame_bulk APIs.

XDP_REDIRECT (upstream codepath): 1.79Mpps
XDP_REDIRECT (upstream codepath + bulking APIs): 1.93Mpps

Tested-by: Matteo Croce <mcroce@microsoft.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index f6616c8933ca..04f24d1d72ab 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -2440,8 +2440,10 @@ static void mvpp2_txq_bufs_free(struct mvpp2_port *port,
 				struct mvpp2_tx_queue *txq,
 				struct mvpp2_txq_pcpu *txq_pcpu, int num)
 {
+	struct xdp_frame_bulk bq;
 	int i;
 
+	bq.xa = NULL;
 	for (i = 0; i < num; i++) {
 		struct mvpp2_txq_pcpu_buf *tx_buf =
 			txq_pcpu->buffs + txq_pcpu->txq_get_index;
@@ -2454,10 +2456,11 @@ static void mvpp2_txq_bufs_free(struct mvpp2_port *port,
 			dev_kfree_skb_any(tx_buf->skb);
 		else if (tx_buf->type == MVPP2_TYPE_XDP_TX ||
 			 tx_buf->type == MVPP2_TYPE_XDP_NDO)
-			xdp_return_frame(tx_buf->xdpf);
+			xdp_return_frame_bulk(tx_buf->xdpf, &bq);
 
 		mvpp2_txq_inc_get(txq_pcpu);
 	}
+	xdp_flush_frame_bulk(&bq);
 }
 
 static inline struct mvpp2_rx_queue *mvpp2_get_rx_queue(struct mvpp2_port *port,
-- 
2.26.2


  parent reply	other threads:[~2020-10-27 19:04 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 ` Lorenzo Bianconi [this message]
2020-10-27 19:04 ` [PATCH net-next 4/4] net: mlx5: add xdp tx return bulking support Lorenzo Bianconi
2020-10-29 11:42   ` Shay Agroskin
2020-10-29 13:15     ` Lorenzo Bianconi

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=ea0343b52e83dd46a5082383aa59b9ea4d67a4e4.1603824486.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --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).