diff options
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.c | 15 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | 12 |
2 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 55edca4..f0e7b15 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -1530,14 +1530,13 @@ void __hot _dpa_rx(struct net_device *net_dev, gro_result_t gro_result; gro_result = napi_gro_receive(&percpu_priv->napi, skb); - if (unlikely(gro_result == GRO_DROP)) { - percpu_priv->stats.rx_dropped++; + /* If frame is dropped by the stack, rx_dropped counter is + * incremented automatically, so no need for us to update it + */ + if (unlikely(gro_result == GRO_DROP)) goto packet_dropped; - } - } else if (unlikely(netif_receive_skb(skb) == NET_RX_DROP)) { - percpu_priv->stats.rx_dropped++; + } else if (unlikely(netif_receive_skb(skb) == NET_RX_DROP)) goto packet_dropped; - } percpu_priv->stats.rx_packets++; percpu_priv->stats.rx_bytes += skb_len; @@ -2343,9 +2342,7 @@ skb_copied: goto out; } - if (unlikely(netif_rx(skb) != NET_RX_SUCCESS)) - percpu_priv->stats.rx_dropped++; - else { + if (likely(netif_rx(skb) == NET_RX_SUCCESS)) { percpu_priv->stats.rx_packets++; percpu_priv->stats.rx_bytes += dpa_fd_length(fd); } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index f93c346..70ee1c1 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -479,17 +479,11 @@ void __hot _dpa_rx(struct net_device *net_dev, skb_len = skb->len; if (use_gro) { - gro_result_t gro_result; - - gro_result = napi_gro_receive(&percpu_priv->napi, skb); - if (unlikely(gro_result == GRO_DROP)) { - percpu_stats->rx_dropped++; + if (unlikely(napi_gro_receive(&percpu_priv->napi, skb) == + GRO_DROP)) goto packet_dropped; - } - } else if (unlikely(netif_receive_skb(skb) == NET_RX_DROP)) { - percpu_stats->rx_dropped++; + } else if (unlikely(netif_receive_skb(skb) == NET_RX_DROP)) goto packet_dropped; - } percpu_stats->rx_packets++; percpu_stats->rx_bytes += skb_len; |