mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-16 19:04:41 +08:00
net: mvpp2: Add xdp tx return bulking support
Convert mvpp2 driver to xdp_return_frame_bulk APIs. XDP_REDIRECT (upstream codepath): 1.79Mpps XDP_REDIRECT (upstream codepath + bulking APIs): 1.93Mpps Co-developed-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Matteo Croce <mcroce@microsoft.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Link: https://lore.kernel.org/bpf/0b38c295e58e8ce251ef6b4e2187a2f457f9f7a3.1605267335.git.lorenzo@kernel.org
This commit is contained in:
parent
2f9d09394d
commit
dbef19ccde
@ -2440,8 +2440,13 @@ 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;
|
||||
|
||||
xdp_frame_bulk_init(&bq);
|
||||
|
||||
rcu_read_lock(); /* need for xdp_return_frame_bulk */
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
struct mvpp2_txq_pcpu_buf *tx_buf =
|
||||
txq_pcpu->buffs + txq_pcpu->txq_get_index;
|
||||
@ -2454,10 +2459,13 @@ 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);
|
||||
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static inline struct mvpp2_rx_queue *mvpp2_get_rx_queue(struct mvpp2_port *port,
|
||||
|
Loading…
Reference in New Issue
Block a user