Skip to content

Commit

Permalink
mvpp2: refactor frame drop routine
Browse files Browse the repository at this point in the history
Move some code down to remove a backward goto.

Signed-off-by: Matteo Croce <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
teknoraver authored and davem330 committed Oct 28, 2019
1 parent faf7b8b commit 7f7183a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -2994,6 +2988,13 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
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) {
Expand Down

0 comments on commit 7f7183a

Please sign in to comment.