]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mvpp2: refactor frame drop routine
authorMatteo Croce <mcroce@redhat.com>
Thu, 24 Oct 2019 17:24:56 +0000 (19:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Oct 2019 20:44:26 +0000 (13:44 -0700)
Move some code down to remove a backward goto.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index 5fea65256b9d4a0de14ba90ed53c83d1b708ee2c..b61e0ad0978afd2ca5dfb2ffc4c2e1f1633ebc44 100644 (file)
@@ -2956,14 +2956,8 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
                 * by the hardware, and the information about the buffer is
                 * comprised by the RX descriptor.
                 */
-               if (rx_status & MVPP2_RXD_ERR_SUMMARY) {
-err_drop_frame:
-                       dev->stats.rx_errors++;
-                       mvpp2_rx_error(port, rx_desc);
-                       /* Return the buffer to the pool */
-                       mvpp2_bm_pool_put(port, pool, dma_addr, phys_addr);
-                       continue;
-               }
+               if (rx_status & MVPP2_RXD_ERR_SUMMARY)
+                       goto err_drop_frame;
 
                if (bm_pool->frag_size > PAGE_SIZE)
                        frag_size = 0;
@@ -2994,6 +2988,13 @@ err_drop_frame:
                mvpp2_rx_csum(port, rx_status, skb);
 
                napi_gro_receive(napi, skb);
+               continue;
+
+err_drop_frame:
+               dev->stats.rx_errors++;
+               mvpp2_rx_error(port, rx_desc);
+               /* Return the buffer to the pool */
+               mvpp2_bm_pool_put(port, pool, dma_addr, phys_addr);
        }
 
        if (rcvd_pkts) {