Skip to content

Commit

Permalink
net: mvneta: recycle the page in case of out-of-order
Browse files Browse the repository at this point in the history
Recycle the received page into the page_pool cache if the dma descriptors
arrived in a wrong order

Fixes: ca0e014 ("net: mvneta: move skb build after descriptors processing")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lorenzo Bianconi authored and David S. Miller committed Sep 20, 2020
1 parent 769f508 commit b6e1178
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -2383,8 +2383,12 @@ static int mvneta_rx_swbm(struct napi_struct *napi,
mvneta_swbm_rx_frame(pp, rx_desc, rxq, &xdp_buf,
&size, page, &ps);
} else {
if (unlikely(!xdp_buf.data_hard_start))
if (unlikely(!xdp_buf.data_hard_start)) {
rx_desc->buf_phys_addr = 0;
page_pool_put_full_page(rxq->page_pool, page,
true);
continue;
}

mvneta_swbm_add_rx_fragment(pp, rx_desc, rxq, &xdp_buf,
&size, page);
Expand Down

0 comments on commit b6e1178

Please sign in to comment.