* [PATCH] net: wireless: mesh: Add multicast and unicast stat counters
@ 2009-08-18 14:02 Daniel Walker
2009-08-18 18:08 ` Javier Cardona
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2009-08-18 14:02 UTC (permalink / raw)
To: John W. Linville
Cc: Daniel Walker, Johannes Berg, David S. Miller, John W. Linville,
Luis R. Rodriguez, Andrey Yurovsky, Javier Cardona,
linux-wireless, Sven-Thorsten Dietrich
I added two new stat counters to count if each forwarded frame is
either multicast or unicast. 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".
CC: Johannes Berg <johannes@sipsolutions.net>
CC: David S. Miller <davem@davemloft.net>
CC: John W. Linville <linville@tuxdriver.com>
CC: Luis R. Rodriguez <lrodriguez@atheros.com>
CC: Andrey Yurovsky <andrey@cozybit.com>
CC: Javier Cardona <javier@cozybit.com>
CC: linux-wireless@vger.kernel.org
CC: Sven-Thorsten Dietrich <sven@thebigcorporation.com>
Signed-off-by: Daniel Walker <dwalker@fifo99.com>
---
net/mac80211/debugfs_netdev.c | 6 ++++++
net/mac80211/ieee80211_i.h | 6 +++++-
net/mac80211/mesh_hwmp.c | 4 ++++
net/mac80211/rx.c | 9 +++++++--
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index e9ec6ca..00f7c6e 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -116,6 +116,8 @@ IEEE80211_IF_FILE(peer, u.wds.remote_addr, MAC);
#ifdef CONFIG_MAC80211_MESH
/* 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(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
IEEE80211_IF_FILE(dropped_frames_no_route,
@@ -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->debugfsdir);
+ MESHSTATS_ADD(mcast_frames);
+ MESHSTATS_ADD(unicast_frames);
MESHSTATS_ADD(fwded_frames);
MESHSTATS_ADD(dropped_frames_ttl);
MESHSTATS_ADD(dropped_frames_no_route);
@@ -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)
{
+ MESHSTATS_DEL(mcast_frames);
+ MESHSTATS_DEL(unicast_frames);
MESHSTATS_DEL(fwded_frames);
MESHSTATS_DEL(dropped_frames_ttl);
MESHSTATS_DEL(dropped_frames_no_route);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index d6bd7dd..82c39d9 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -212,7 +212,9 @@ struct ieee80211_if_vlan {
};
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_no_route; /* Not transmitted, no route found */
atomic_t estab_plinks;
@@ -506,6 +508,8 @@ struct ieee80211_sub_if_data {
#ifdef CONFIG_MAC80211_MESH
struct dentry *mesh_stats_dir;
struct {
+ struct dentry *fwded_mcast;
+ struct dentry *fwded_unicast;
struct dentry *fwded_frames;
struct dentry *dropped_frames_ttl;
struct dentry *dropped_frames_no_route;
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index e1a763e..593ea64 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -478,6 +478,8 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
hopcount, ttl, cpu_to_le32(lifetime),
cpu_to_le32(metric), cpu_to_le32(preq_id),
sdata);
+
+ ifmsh->mshstats.fwded_mcast++;
ifmsh->mshstats.fwded_frames++;
}
}
@@ -536,6 +538,8 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
cpu_to_le32(lifetime), cpu_to_le32(metric),
0, sdata);
rcu_read_unlock();
+
+ sdata->u.mesh.mshstats.fwded_unicast++;
sdata->u.mesh.mshstats.fwded_frames++;
return;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 25a669c..cf21f57 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1543,16 +1543,21 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
info->control.vif = &rx->sdata->vif;
ieee80211_select_queue(local, fwd_skb);
- if (is_multicast_ether_addr(fwd_hdr->addr3))
+ if (is_multicast_ether_addr(fwd_hdr->addr3)) {
memcpy(fwd_hdr->addr1, fwd_hdr->addr3,
ETH_ALEN);
- else {
+ IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
+ fwded_mcast);
+ } else {
int err = mesh_nexthop_lookup(fwd_skb, sdata);
/* Failed to immediately resolve next hop:
* fwded frame was dropped or will be added
* later to the pending skb queue. */
if (err)
return RX_DROP_MONITOR;
+
+ IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
+ fwded_unicast);
}
IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
fwded_frames);
--
1.5.6.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] mac80211: New stat counters for multicast and unicast forwarded frames
2009-08-18 18:08 ` Javier Cardona
@ 2009-08-18 17:59 ` Javier Cardona
2009-08-18 18:19 ` Daniel Walker
0 siblings, 1 reply; 5+ messages in thread
From: Javier Cardona @ 2009-08-18 17:59 UTC (permalink / raw)
To: linux-wireless
Cc: Daniel Walker, Javier Cardona, andrey, johannes, linville, devel
From: Daniel Walker <dwalker@fifo99.com>
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>
---
net/mac80211/debugfs_netdev.c | 6 ++++++
net/mac80211/ieee80211_i.h | 6 +++++-
net/mac80211/mesh_hwmp.c | 3 +++
net/mac80211/rx.c | 8 +++++++-
4 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index e9ec6ca..61234e7 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -116,6 +116,8 @@ IEEE80211_IF_FILE(peer, u.wds.remote_addr, MAC);
#ifdef CONFIG_MAC80211_MESH
/* 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(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
IEEE80211_IF_FILE(dropped_frames_no_route,
@@ -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->debugfsdir);
+ MESHSTATS_ADD(fwded_mcast);
+ MESHSTATS_ADD(fwded_unicast);
MESHSTATS_ADD(fwded_frames);
MESHSTATS_ADD(dropped_frames_ttl);
MESHSTATS_ADD(dropped_frames_no_route);
@@ -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)
{
+ MESHSTATS_DEL(fwded_mcast);
+ MESHSTATS_DEL(fwded_unicast);
MESHSTATS_DEL(fwded_frames);
MESHSTATS_DEL(dropped_frames_ttl);
MESHSTATS_DEL(dropped_frames_no_route);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a07f017..93e618a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -212,7 +212,9 @@ struct ieee80211_if_vlan {
};
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_no_route; /* Not transmitted, no route found */
atomic_t estab_plinks;
@@ -506,6 +508,8 @@ struct ieee80211_sub_if_data {
#ifdef CONFIG_MAC80211_MESH
struct dentry *mesh_stats_dir;
struct {
+ struct dentry *fwded_mcast;
+ struct dentry *fwded_unicast;
struct dentry *fwded_frames;
struct dentry *dropped_frames_ttl;
struct dentry *dropped_frames_no_route;
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 7aeba00..e12a786 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -497,6 +497,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
hopcount, ttl, cpu_to_le32(lifetime),
cpu_to_le32(metric), cpu_to_le32(preq_id),
sdata);
+ ifmsh->mshstats.fwded_mcast++;
ifmsh->mshstats.fwded_frames++;
}
}
@@ -555,6 +556,8 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
cpu_to_le32(lifetime), cpu_to_le32(metric),
0, sdata);
rcu_read_unlock();
+
+ sdata->u.mesh.mshstats.fwded_unicast++;
sdata->u.mesh.mshstats.fwded_frames++;
return;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 4cd9e45..7065fd7 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1550,7 +1550,10 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
info->control.vif = &rx->sdata->vif;
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;
/*
* 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)
* later to the pending skb queue. */
if (err)
return RX_DROP_MONITOR;
+
+ IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
+ fwded_unicast);
}
IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
fwded_frames);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: wireless: mesh: Add multicast and unicast stat counters
2009-08-18 14:02 [PATCH] net: wireless: mesh: Add multicast and unicast stat counters Daniel Walker
@ 2009-08-18 18:08 ` Javier Cardona
2009-08-18 17:59 ` [PATCH] mac80211: New stat counters for multicast and unicast forwarded frames Javier Cardona
0 siblings, 1 reply; 5+ messages in thread
From: Javier Cardona @ 2009-08-18 18:08 UTC (permalink / raw)
To: Daniel Walker
Cc: John W. Linville, Johannes Berg, David S. Miller,
Luis R. Rodriguez, Andrey Yurovsky, linux-wireless,
Sven-Thorsten Dietrich
Daniel,
Thanks for the patch, that's useful.
I've reworked it so it can be applied to the HEAD of wireless-testing.
Comments in line and reworked patch in a follow-up email.
Cheers,
Javier
> ---
> net/mac80211/debugfs_netdev.c | 6 ++++++
> net/mac80211/ieee80211_i.h | 6 +++++-
> net/mac80211/mesh_hwmp.c | 4 ++++
> net/mac80211/rx.c | 9 +++++++--
> 4 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
> index e9ec6ca..00f7c6e 100644
> --- a/net/mac80211/debugfs_netdev.c
> +++ b/net/mac80211/debugfs_netdev.c
> @@ -116,6 +116,8 @@ IEEE80211_IF_FILE(peer, u.wds.remote_addr, MAC);
>
> #ifdef CONFIG_MAC80211_MESH
> /* 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(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
> IEEE80211_IF_FILE(dropped_frames_no_route,
> @@ -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->debugfsdir);
> + MESHSTATS_ADD(mcast_frames);
> + MESHSTATS_ADD(unicast_frames);
mcast_frames -> fwded_mcast
unicast_frames -> fwded_unicast
> MESHSTATS_ADD(fwded_frames);
> MESHSTATS_ADD(dropped_frames_ttl);
> MESHSTATS_ADD(dropped_frames_no_route);
> @@ -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)
> {
> + MESHSTATS_DEL(mcast_frames);
> + MESHSTATS_DEL(unicast_frames);
Same as previous comment.
> MESHSTATS_DEL(fwded_frames);
> MESHSTATS_DEL(dropped_frames_ttl);
> MESHSTATS_DEL(dropped_frames_no_route);
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index d6bd7dd..82c39d9 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -212,7 +212,9 @@ struct ieee80211_if_vlan {
> };
>
> 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_no_route; /* Not transmitted, no route found */
> atomic_t estab_plinks;
> @@ -506,6 +508,8 @@ struct ieee80211_sub_if_data {
> #ifdef CONFIG_MAC80211_MESH
> struct dentry *mesh_stats_dir;
> struct {
> + struct dentry *fwded_mcast;
> + struct dentry *fwded_unicast;
> struct dentry *fwded_frames;
> struct dentry *dropped_frames_ttl;
> struct dentry *dropped_frames_no_route;
> diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
> index e1a763e..593ea64 100644
> --- a/net/mac80211/mesh_hwmp.c
> +++ b/net/mac80211/mesh_hwmp.c
> @@ -478,6 +478,8 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
> hopcount, ttl, cpu_to_le32(lifetime),
> cpu_to_le32(metric), cpu_to_le32(preq_id),
> sdata);
> +
> + ifmsh->mshstats.fwded_mcast++;
> ifmsh->mshstats.fwded_frames++;
> }
> }
> @@ -536,6 +538,8 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
> cpu_to_le32(lifetime), cpu_to_le32(metric),
> 0, sdata);
> rcu_read_unlock();
> +
> + sdata->u.mesh.mshstats.fwded_unicast++;
> sdata->u.mesh.mshstats.fwded_frames++;
> return;
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 25a669c..cf21f57 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -1543,16 +1543,21 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
> info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
> info->control.vif = &rx->sdata->vif;
> ieee80211_select_queue(local, fwd_skb);
> - if (is_multicast_ether_addr(fwd_hdr->addr3))
> + if (is_multicast_ether_addr(fwd_hdr->addr3)) {
> memcpy(fwd_hdr->addr1, fwd_hdr->addr3,
> ETH_ALEN);
> - else {
> + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
> + fwded_mcast);
> + } else {
> int err = mesh_nexthop_lookup(fwd_skb, sdata);
> /* Failed to immediately resolve next hop:
> * fwded frame was dropped or will be added
> * later to the pending skb queue. */
> if (err)
> return RX_DROP_MONITOR;
> +
> + IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
> + fwded_unicast);
> }
> IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh,
> fwded_frames);
Hunk will fail due to recent changes to multicast frame format.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: New stat counters for multicast and unicast forwarded frames
2009-08-18 17:59 ` [PATCH] mac80211: New stat counters for multicast and unicast forwarded frames Javier Cardona
@ 2009-08-18 18:19 ` Daniel Walker
2009-08-18 18:25 ` Javier Cardona
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2009-08-18 18:19 UTC (permalink / raw)
To: Javier Cardona; +Cc: linux-wireless, andrey, johannes, linville, devel
On Tue, 2009-08-18 at 10:59 -0700, Javier Cardona wrote:
> From: Daniel Walker <dwalker@fifo99.com>
>
> 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>
> ---
Might have been nice for you to wait for me to review the new version
before adding my sign off , but it looks fine.
Signed-off-by: Daniel Walker <dwalker@fifo99.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: New stat counters for multicast and unicast forwarded frames
2009-08-18 18:19 ` Daniel Walker
@ 2009-08-18 18:25 ` Javier Cardona
0 siblings, 0 replies; 5+ messages in thread
From: Javier Cardona @ 2009-08-18 18:25 UTC (permalink / raw)
To: Daniel Walker; +Cc: linux-wireless, andrey, johannes, linville, devel
Daniel,
On Tue, Aug 18, 2009 at 11:19 AM, Daniel Walker<dwalker@fifo99.com> wrote:
> On Tue, 2009-08-18 at 10:59 -0700, Javier Cardona wrote:
>> From: Daniel Walker <dwalker@fifo99.com>
>>
>> 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>
>> ---
>
> Might have been nice for you to wait for me to review the new version
> before adding my sign off , but it looks fine.
You are right. Sorry for that.
Thanks,
Javier
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-18 18:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-18 14:02 [PATCH] net: wireless: mesh: Add multicast and unicast stat counters Daniel Walker
2009-08-18 18:08 ` Javier Cardona
2009-08-18 17:59 ` [PATCH] mac80211: New stat counters for multicast and unicast forwarded frames Javier Cardona
2009-08-18 18:19 ` Daniel Walker
2009-08-18 18:25 ` Javier Cardona
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).