]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: mvneta: recycle the page in case of out-of-order
authorLorenzo Bianconi <lorenzo@kernel.org>
Fri, 18 Sep 2020 21:25:56 +0000 (23:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 Sep 2020 21:12:24 +0000 (14:12 -0700)
Recycle the received page into the page_pool cache if the dma descriptors
arrived in a wrong order

Fixes: a6b60a7151f3f ("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>
drivers/net/ethernet/marvell/mvneta.c

index 69a9000811652bd2feba573d246c46a02cea2e31..c4345e3d616f78589c2b5f59acb0eddb64a177c4 100644 (file)
@@ -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);