dpaa_eth: fix SG frame cleanup
authorLaurentiu Tudor <laurentiu.tudor@nxp.com>
Fri, 3 May 2019 13:03:11 +0000 (16:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:42:33 +0000 (19:42 +0200)
[ Upstream commit 17170e6570c082717c142733d9a638bcd20551f8 ]

Fix issue with the entry indexing in the sg frame cleanup code being
off-by-1. This problem showed up when doing some basic iperf tests and
manifested in traffic coming to a halt.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

index a202c50d6fc7659d87e6d0763442caed78f96254..d5f8bf87519ac284e62d3bf071ac4d235c7b1fa1 100644 (file)
@@ -1639,7 +1639,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
                                 qm_sg_entry_get_len(&sgt[0]), dma_dir);
 
                /* remaining pages were mapped with skb_frag_dma_map() */
-               for (i = 1; i < nr_frags; i++) {
+               for (i = 1; i <= nr_frags; i++) {
                        WARN_ON(qm_sg_entry_is_ext(&sgt[i]));
 
                        dma_unmap_page(dev, qm_sg_addr(&sgt[i]),