batman-adv: Add get_ethtool_stats() support for DAT
Added additional counters for D.A.T.
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index c1a74a1..8e1d89d 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -601,9 +601,22 @@
send_status = batadv_send_skb_packet(tmp_skb,
neigh_node->if_incoming,
neigh_node->addr);
- if (send_status == NET_XMIT_SUCCESS)
+ if (send_status == NET_XMIT_SUCCESS) {
+ /* count the sent packet */
+ switch (packet_subtype) {
+ case BATADV_P_DAT_DHT_GET:
+ batadv_inc_counter(bat_priv,
+ BATADV_CNT_DAT_GET_TX);
+ break;
+ case BATADV_P_DAT_DHT_PUT:
+ batadv_inc_counter(bat_priv,
+ BATADV_CNT_DAT_PUT_TX);
+ break;
+ }
+
/* packet sent to a candidate: return true */
ret = true;
+ }
free_neigh:
batadv_neigh_node_free_ref(neigh_node);
free_orig:
@@ -909,8 +922,10 @@
else
err = batadv_unicast_send_skb(bat_priv, skb_new);
- if (!err)
+ if (!err) {
+ batadv_inc_counter(bat_priv, BATADV_CNT_DAT_CACHED_REPLY_TX);
ret = true;
+ }
out:
if (dat_entry)
batadv_dat_entry_free_ref(dat_entry);