Skip to content

Commit

Permalink
net: mvneta: rely on page_pool_recycle_direct in mvneta_run_xdp
Browse files Browse the repository at this point in the history
Rely on page_pool_recycle_direct and not on xdp_return_buff in
mvneta_run_xdp. This is a preliminary patch to limit the dma sync len
to the one strictly necessary

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lorenzo Bianconi authored and David S. Miller committed Nov 20, 2019
1 parent cec2975 commit f383b29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
err = xdp_do_redirect(pp->dev, xdp, prog);
if (err) {
ret = MVNETA_XDP_DROPPED;
xdp_return_buff(xdp);
page_pool_recycle_direct(rxq->page_pool,
virt_to_head_page(xdp->data));
} else {
ret = MVNETA_XDP_REDIR;
}
Expand All @@ -2106,7 +2107,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
case XDP_TX:
ret = mvneta_xdp_xmit_back(pp, xdp);
if (ret != MVNETA_XDP_TX)
xdp_return_buff(xdp);
page_pool_recycle_direct(rxq->page_pool,
virt_to_head_page(xdp->data));
break;
default:
bpf_warn_invalid_xdp_action(act);
Expand Down

0 comments on commit f383b29

Please sign in to comment.