From: Matteo Croce Date: Thu, 24 Oct 2019 17:24:56 +0000 (+0200) Subject: mvpp2: refactor frame drop routine X-Git-Tag: v5.15~5092^2~303^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f7183af448ac55da9cc72bdbef6d140909fee83;p=platform%2Fkernel%2Flinux-starfive.git mvpp2: refactor frame drop routine Move some code down to remove a backward goto. Signed-off-by: Matteo Croce Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 5fea652..b61e0ad 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -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) {