Commit c8a61a7d33350eeec668fc6230ad55f5fa93209b

Authored by Daniel Walker
Committed by John W. Linville
1 parent e5539bcbf6

mac80211: New stat counters for multicast and unicast forwarded frames

This expands on the current fwded_frames stat counter which should be equal to
the total of these two new counters.  The new counters are called "fwded_mcast"
and "fwded_unicast".

Signed-off-by: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 4 changed files with 21 additions and 2 deletions Side-by-side Diff

net/mac80211/debugfs_netdev.c
... ... @@ -116,6 +116,8 @@
116 116  
117 117 #ifdef CONFIG_MAC80211_MESH
118 118 /* Mesh stats attributes */
  119 +IEEE80211_IF_FILE(fwded_mcast, u.mesh.mshstats.fwded_mcast, DEC);
  120 +IEEE80211_IF_FILE(fwded_unicast, u.mesh.mshstats.fwded_unicast, DEC);
119 121 IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC);
120 122 IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
121 123 IEEE80211_IF_FILE(dropped_frames_no_route,
... ... @@ -205,6 +207,8 @@
205 207 {
206 208 sdata->mesh_stats_dir = debugfs_create_dir("mesh_stats",
207 209 sdata->debugfsdir);
  210 + MESHSTATS_ADD(fwded_mcast);
  211 + MESHSTATS_ADD(fwded_unicast);
208 212 MESHSTATS_ADD(fwded_frames);
209 213 MESHSTATS_ADD(dropped_frames_ttl);
210 214 MESHSTATS_ADD(dropped_frames_no_route);
... ... @@ -327,6 +331,8 @@
327 331  
328 332 static void del_mesh_stats(struct ieee80211_sub_if_data *sdata)
329 333 {
  334 + MESHSTATS_DEL(fwded_mcast);
  335 + MESHSTATS_DEL(fwded_unicast);
330 336 MESHSTATS_DEL(fwded_frames);
331 337 MESHSTATS_DEL(dropped_frames_ttl);
332 338 MESHSTATS_DEL(dropped_frames_no_route);
net/mac80211/ieee80211_i.h
... ... @@ -212,7 +212,9 @@
212 212 };
213 213  
214 214 struct mesh_stats {
215   - __u32 fwded_frames; /* Mesh forwarded frames */
  215 + __u32 fwded_mcast; /* Mesh forwarded multicast frames */
  216 + __u32 fwded_unicast; /* Mesh forwarded unicast frames */
  217 + __u32 fwded_frames; /* Mesh total forwarded frames */
216 218 __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/
217 219 __u32 dropped_frames_no_route; /* Not transmitted, no route found */
218 220 atomic_t estab_plinks;
... ... @@ -506,6 +508,8 @@
506 508 #ifdef CONFIG_MAC80211_MESH
507 509 struct dentry *mesh_stats_dir;
508 510 struct {
  511 + struct dentry *fwded_mcast;
  512 + struct dentry *fwded_unicast;
509 513 struct dentry *fwded_frames;
510 514 struct dentry *dropped_frames_ttl;
511 515 struct dentry *dropped_frames_no_route;
net/mac80211/mesh_hwmp.c
... ... @@ -497,6 +497,7 @@
497 497 hopcount, ttl, cpu_to_le32(lifetime),
498 498 cpu_to_le32(metric), cpu_to_le32(preq_id),
499 499 sdata);
  500 + ifmsh->mshstats.fwded_mcast++;
500 501 ifmsh->mshstats.fwded_frames++;
501 502 }
502 503 }
... ... @@ -555,6 +556,8 @@
555 556 cpu_to_le32(lifetime), cpu_to_le32(metric),
556 557 0, sdata);
557 558 rcu_read_unlock();
  559 +
  560 + sdata->u.mesh.mshstats.fwded_unicast++;
558 561 sdata->u.mesh.mshstats.fwded_frames++;
559 562 return;
560 563  
... ... @@ -1550,7 +1550,10 @@
1550 1550 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1551 1551 info->control.vif = &rx->sdata->vif;
1552 1552 ieee80211_select_queue(local, fwd_skb);
1553   - if (!is_multicast_ether_addr(fwd_hdr->addr1)) {
  1553 + if (is_multicast_ether_addr(fwd_hdr->addr1))
  1554 + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
  1555 + fwded_mcast);
  1556 + else {
1554 1557 int err;
1555 1558 /*
1556 1559 * Save TA to addr1 to send TA a path error if a
... ... @@ -1564,6 +1567,9 @@
1564 1567 * later to the pending skb queue. */
1565 1568 if (err)
1566 1569 return RX_DROP_MONITOR;
  1570 +
  1571 + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
  1572 + fwded_unicast);
1567 1573 }
1568 1574 IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
1569 1575 fwded_frames);