Commit c8a61a7d authored by Daniel Walker's avatar Daniel Walker Committed by John W. Linville

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: default avatarDaniel Walker <dwalker@fifo99.com>
Signed-off-by: default avatarJavier Cardona <javier@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e5539bcb
...@@ -116,6 +116,8 @@ IEEE80211_IF_FILE(peer, u.wds.remote_addr, MAC); ...@@ -116,6 +116,8 @@ IEEE80211_IF_FILE(peer, u.wds.remote_addr, MAC);
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
/* Mesh stats attributes */ /* Mesh stats attributes */
IEEE80211_IF_FILE(fwded_mcast, u.mesh.mshstats.fwded_mcast, DEC);
IEEE80211_IF_FILE(fwded_unicast, u.mesh.mshstats.fwded_unicast, DEC);
IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC); IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC);
IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC); IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
IEEE80211_IF_FILE(dropped_frames_no_route, IEEE80211_IF_FILE(dropped_frames_no_route,
...@@ -205,6 +207,8 @@ static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) ...@@ -205,6 +207,8 @@ static void add_mesh_stats(struct ieee80211_sub_if_data *sdata)
{ {
sdata->mesh_stats_dir = debugfs_create_dir("mesh_stats", sdata->mesh_stats_dir = debugfs_create_dir("mesh_stats",
sdata->debugfsdir); sdata->debugfsdir);
MESHSTATS_ADD(fwded_mcast);
MESHSTATS_ADD(fwded_unicast);
MESHSTATS_ADD(fwded_frames); MESHSTATS_ADD(fwded_frames);
MESHSTATS_ADD(dropped_frames_ttl); MESHSTATS_ADD(dropped_frames_ttl);
MESHSTATS_ADD(dropped_frames_no_route); MESHSTATS_ADD(dropped_frames_no_route);
...@@ -327,6 +331,8 @@ static void del_monitor_files(struct ieee80211_sub_if_data *sdata) ...@@ -327,6 +331,8 @@ static void del_monitor_files(struct ieee80211_sub_if_data *sdata)
static void del_mesh_stats(struct ieee80211_sub_if_data *sdata) static void del_mesh_stats(struct ieee80211_sub_if_data *sdata)
{ {
MESHSTATS_DEL(fwded_mcast);
MESHSTATS_DEL(fwded_unicast);
MESHSTATS_DEL(fwded_frames); MESHSTATS_DEL(fwded_frames);
MESHSTATS_DEL(dropped_frames_ttl); MESHSTATS_DEL(dropped_frames_ttl);
MESHSTATS_DEL(dropped_frames_no_route); MESHSTATS_DEL(dropped_frames_no_route);
......
...@@ -212,7 +212,9 @@ struct ieee80211_if_vlan { ...@@ -212,7 +212,9 @@ struct ieee80211_if_vlan {
}; };
struct mesh_stats { struct mesh_stats {
__u32 fwded_frames; /* Mesh forwarded frames */ __u32 fwded_mcast; /* Mesh forwarded multicast frames */
__u32 fwded_unicast; /* Mesh forwarded unicast frames */
__u32 fwded_frames; /* Mesh total forwarded frames */
__u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/
__u32 dropped_frames_no_route; /* Not transmitted, no route found */ __u32 dropped_frames_no_route; /* Not transmitted, no route found */
atomic_t estab_plinks; atomic_t estab_plinks;
...@@ -506,6 +508,8 @@ struct ieee80211_sub_if_data { ...@@ -506,6 +508,8 @@ struct ieee80211_sub_if_data {
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
struct dentry *mesh_stats_dir; struct dentry *mesh_stats_dir;
struct { struct {
struct dentry *fwded_mcast;
struct dentry *fwded_unicast;
struct dentry *fwded_frames; struct dentry *fwded_frames;
struct dentry *dropped_frames_ttl; struct dentry *dropped_frames_ttl;
struct dentry *dropped_frames_no_route; struct dentry *dropped_frames_no_route;
......
...@@ -497,6 +497,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, ...@@ -497,6 +497,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
hopcount, ttl, cpu_to_le32(lifetime), hopcount, ttl, cpu_to_le32(lifetime),
cpu_to_le32(metric), cpu_to_le32(preq_id), cpu_to_le32(metric), cpu_to_le32(preq_id),
sdata); sdata);
ifmsh->mshstats.fwded_mcast++;
ifmsh->mshstats.fwded_frames++; ifmsh->mshstats.fwded_frames++;
} }
} }
...@@ -555,6 +556,8 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, ...@@ -555,6 +556,8 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
cpu_to_le32(lifetime), cpu_to_le32(metric), cpu_to_le32(lifetime), cpu_to_le32(metric),
0, sdata); 0, sdata);
rcu_read_unlock(); rcu_read_unlock();
sdata->u.mesh.mshstats.fwded_unicast++;
sdata->u.mesh.mshstats.fwded_frames++; sdata->u.mesh.mshstats.fwded_frames++;
return; return;
......
...@@ -1550,7 +1550,10 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) ...@@ -1550,7 +1550,10 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
info->control.vif = &rx->sdata->vif; info->control.vif = &rx->sdata->vif;
ieee80211_select_queue(local, fwd_skb); ieee80211_select_queue(local, fwd_skb);
if (!is_multicast_ether_addr(fwd_hdr->addr1)) { if (is_multicast_ether_addr(fwd_hdr->addr1))
IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
fwded_mcast);
else {
int err; int err;
/* /*
* Save TA to addr1 to send TA a path error if a * Save TA to addr1 to send TA a path error if a
...@@ -1564,6 +1567,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) ...@@ -1564,6 +1567,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
* later to the pending skb queue. */ * later to the pending skb queue. */
if (err) if (err)
return RX_DROP_MONITOR; return RX_DROP_MONITOR;
IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
fwded_unicast);
} }
IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
fwded_frames); fwded_frames);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment