wlan: Rate limit error log.
Due to excessive error logging while nl brdcast
message, watchdog bite is observed. As a part of fix,
rate limit error message so that watchdog is pet regularly.
Change-Id: Ibd5c78369b377f0b5c3c0fe08affd6136414988e
CRs-Fixed: 859655
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
index 8383d40..3260f91 100755
--- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c
+++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
@@ -60,6 +60,13 @@
#define LOGGER_MAX_DATA_MGMT_PKT_Q_LEN (8)
#define LOGGER_MAX_FW_LOG_PKT_Q_LEN (16)
+#define NL_BDCAST_RATELIMIT_INTERVAL 5*HZ
+#define NL_BDCAST_RATELIMIT_BURST 1
+
+static DEFINE_RATELIMIT_STATE(errCnt, \
+ NL_BDCAST_RATELIMIT_INTERVAL, \
+ NL_BDCAST_RATELIMIT_BURST);
+
struct log_msg {
struct list_head node;
unsigned int radio;
@@ -673,8 +680,12 @@
ret = nl_srv_bcast(skb);
if (ret < 0) {
- pr_err("%s: Send Failed %d drop_count = %u\n",
- __func__, ret, ++gwlan_logging.drop_count);
+ if (__ratelimit(&errCnt))
+ {
+ pr_info("%s: Send Failed %d drop_count = %u\n",
+ __func__, ret, gwlan_logging.drop_count);
+ }
+ gwlan_logging.drop_count++;
skb = NULL;
break;
} else {