lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1429101008-9464-7-git-send-email-dingtianhong@huawei.com>
Date:	Wed, 15 Apr 2015 20:30:08 +0800
From:	Ding Tianhong <dingtianhong@...wei.com>
To:	<arnd@...db.de>, <davem@...emloft.net>, <grant.likely@...aro.org>
CC:	<sergei.shtylyov@...entembedded.com>,
	<linux-arm-kernel@...ts.infradead.org>, <eric.dumazet@...il.com>,
	<zhangfei.gao@...aro.org>, <joe@...ches.com>,
	<netdev@...r.kernel.org>, <devicetree@...r.kernel.org>,
	<linux@....linux.org.uk>
Subject: [PATCH net-next 6/6] net: hip04: add ratelimit for rx/tx drops skb

There can be quite a lot of rx/tx drops message and affect
useful message, so need to ratelimit them to not overwhelm
logging.

Signed-off-by: Ding Tianhong <dingtianhong@...wei.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Eric Dumazet <eric.dumazet@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Zhangfei Gao <zhangfei.gao@...aro.org>
Cc: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Joe Perches <joe@...ches.com>
---
 drivers/net/ethernet/hisilicon/hip04_eth.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index a7ab1d9..b19830d 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -608,11 +608,15 @@ static irqreturn_t hip04_mac_interrupt(int irq, void *dev_id)
 		if (ists & (RCV_NOBUF | RCV_DROP)) {
 			stats->rx_errors++;
 			stats->rx_dropped++;
-			netdev_err(ndev, "rx drop\n");
+			if (net_ratelimit())
+				netdev_dbg(ndev, "rx drop: %lu\n",
+					   stats->rx_dropped);
 		}
 		if (ists & TX_DROP) {
 			stats->tx_dropped++;
-			netdev_err(ndev, "tx drop\n");
+			if (net_ratelimit())
+				netdev_dbg(ndev, "tx drop: %lu\n",
+					   stats->rx_dropped);
 		}
 	}
 
-- 
1.8.0


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ