[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190327203540.1884-3-aaro.koskinen@iki.fi>
Date: Wed, 27 Mar 2019 22:35:36 +0200
From: Aaro Koskinen <aaro.koskinen@....fi>
To: "David S. Miller" <davem@...emloft.net>,
Jose Abreu <joabreu@...opsys.com>,
Alexandre Torgue <alexandre.torgue@...com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Aaro Koskinen <aaro.koskinen@...ia.com>
Subject: [PATCH 2/6] net: stmmac: ratelimit RX error logs
From: Aaro Koskinen <aaro.koskinen@...ia.com>
Ratelimit RX error logs.
Signed-off-by: Aaro Koskinen <aaro.koskinen@...ia.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4e496cf655f2..392d94cede17 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3433,9 +3433,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
* ignored
*/
if (frame_len > priv->dma_buf_sz) {
- netdev_err(priv->dev,
- "len %d larger than size (%d)\n",
- frame_len, priv->dma_buf_sz);
+ if (net_ratelimit())
+ netdev_err(priv->dev,
+ "len %d larger than size (%d)\n",
+ frame_len, priv->dma_buf_sz);
priv->dev->stats.rx_length_errors++;
break;
}
@@ -3492,9 +3493,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
} else {
skb = rx_q->rx_skbuff[entry];
if (unlikely(!skb)) {
- netdev_err(priv->dev,
- "%s: Inconsistent Rx chain\n",
- priv->dev->name);
+ if (net_ratelimit())
+ netdev_err(priv->dev,
+ "%s: Inconsistent Rx chain\n",
+ priv->dev->name);
priv->dev->stats.rx_dropped++;
break;
}
--
2.17.0
Powered by blists - more mailing lists