diff options
author | Martin Hundebøll <martin@hundeboll.net> | 2012-04-20 15:02:45 (GMT) |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-11-07 19:00:23 (GMT) |
commit | 4046b24aface62f5647699e9af3260a486bc5f49 (patch) | |
tree | 82e7fe03be17690b109fb3fff82e83fb63ef28cd /net/batman-adv/distributed-arp-table.c | |
parent | 33af49ad8ae44de52c0ac30b1a9707dad5e4c418 (diff) | |
download | linux-4046b24aface62f5647699e9af3260a486bc5f49.tar.xz |
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>
Diffstat (limited to 'net/batman-adv/distributed-arp-table.c')
-rw-r--r-- | net/batman-adv/distributed-arp-table.c | 19 |
1 files changed, 17 insertions, 2 deletions
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 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv, 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 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv, 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); |