net: stmmac: Only consider RX error when HW Timestamping is not enabled
authorJose Abreu <Jose.Abreu@synopsys.com>
Wed, 4 Sep 2019 13:17:00 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Sep 2019 10:19:54 +0000 (12:19 +0200)
Only consider that we have an error when HW Timestamping is not enabled
as this can give false positives due to the fact the RX Timestamping in
XGMAC and GMAC cores comes from context descriptors.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index c59c232..5271c61 100644 (file)
@@ -3511,9 +3511,10 @@ read_again:
                                        &priv->xstats, rx_q->dma_erx + entry);
                if (unlikely(status == discard_frame)) {
                        page_pool_recycle_direct(rx_q->page_pool, buf->page);
-                       priv->dev->stats.rx_errors++;
                        buf->page = NULL;
                        error = 1;
+                       if (!priv->hwts_rx_en)
+                               priv->dev->stats.rx_errors++;
                }
 
                if (unlikely(error && (status & rx_not_ls)))