Merge "[qca-nss-drv] Added statistics for IPv4 drop rule"
diff --git a/exports/nss_ipv4.h b/exports/nss_ipv4.h
index bb6e61a..11ca415 100644
--- a/exports/nss_ipv4.h
+++ b/exports/nss_ipv4.h
@@ -654,6 +654,8 @@
uint32_t ipv4_connection_evictions; /**< Number of connection evictions. */
uint32_t ipv4_fragmentations;
/**< Number of successful IPv4 fragmentations performed. */
+ uint32_t ipv4_dropped_by_rule;
+ /**< Number of IPv4 packets dropped because of a drop rule. */
uint32_t ipv4_mc_connection_create_requests;
/**< Number of multicast connection create requests. */
uint32_t ipv4_mc_connection_update_requests;
diff --git a/nss_core.h b/nss_core.h
index 8b69250..3f5e0dc 100644
--- a/nss_core.h
+++ b/nss_core.h
@@ -297,6 +297,8 @@
/* Number of IPv4 connection evictions */
NSS_STATS_IPV4_FRAGMENTATIONS,
/* Number of successful IPv4 fragmentations performed */
+ NSS_STATS_IPV4_DROPPED_BY_RULE,
+ /* Number of IPv4 packets dropped because of a drop rule. */
NSS_STATS_IPV4_MC_CONNECTION_CREATE_REQUESTS,
/* Number of successful IPv4 Multicast create requests */
NSS_STATS_IPV4_MC_CONNECTION_UPDATE_REQUESTS,
diff --git a/nss_ipv4.c b/nss_ipv4.c
index d2ca05f..8b0e5cb 100644
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -169,6 +169,7 @@
nss_top->stats_ipv4[NSS_STATS_IPV4_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv4_mc_connection_destroy_requests;
nss_top->stats_ipv4[NSS_STATS_IPV4_MC_CONNECTION_DESTROY_MISSES] += nins->ipv4_mc_connection_destroy_misses;
nss_top->stats_ipv4[NSS_STATS_IPV4_MC_CONNECTION_FLUSHES] += nins->ipv4_mc_connection_flushes;
+ nss_top->stats_ipv4[NSS_STATS_IPV4_DROPPED_BY_RULE] += nins->ipv4_dropped_by_rule;
for (i = 0; i < NSS_EXCEPTION_EVENT_IPV4_MAX; i++) {
nss_top->stats_if_exception_ipv4[i] += nins->exception_events[i];
diff --git a/nss_stats.c b/nss_stats.c
index 5e4873e..9a2d2a8 100644
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -73,6 +73,7 @@
"flushes",
"evictions",
"fragmentations",
+ "dropped_by_rule",
"mc_create_requests",
"mc_update_requests",
"mc_create_invalid_interface",