diff options
author | Javier Cardona <javier@cozybit.com> | 2011-09-06 16:05:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-14 13:56:17 -0400 |
commit | cfee66b0f9891fc2b79a238e737308a2732365d2 (patch) | |
tree | 61eaebffc363a5eb28cf0712a74a8628704f1254 /net/mac80211 | |
parent | 2157fdd6ae3f760a95c5c50072a1b4ac656eb9f5 (diff) |
mac80211: Stop forwarding mesh traffic when tx queues are full
Tx flow control for non-mesh modes of operation only needs to act on the
net device queues: when the hardware queues are full we stop accepting
traffic from the net device. In mesh, however, we also need to stop
forwarding traffic. This patch checks the hardware queues before
attempting to forward a mesh frame.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/rx.c | 6 |
3 files changed, 10 insertions, 0 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 6e8eab7919e2..dd0462917518 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -340,6 +340,8 @@ IEEE80211_IF_FILE(fwded_mcast, u.mesh.mshstats.fwded_mcast, DEC); | |||
340 | IEEE80211_IF_FILE(fwded_unicast, u.mesh.mshstats.fwded_unicast, DEC); | 340 | IEEE80211_IF_FILE(fwded_unicast, u.mesh.mshstats.fwded_unicast, DEC); |
341 | IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC); | 341 | IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC); |
342 | IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC); | 342 | IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC); |
343 | IEEE80211_IF_FILE(dropped_frames_congestion, | ||
344 | u.mesh.mshstats.dropped_frames_congestion, DEC); | ||
343 | IEEE80211_IF_FILE(dropped_frames_no_route, | 345 | IEEE80211_IF_FILE(dropped_frames_no_route, |
344 | u.mesh.mshstats.dropped_frames_no_route, DEC); | 346 | u.mesh.mshstats.dropped_frames_no_route, DEC); |
345 | IEEE80211_IF_FILE(estab_plinks, u.mesh.mshstats.estab_plinks, ATOMIC); | 347 | IEEE80211_IF_FILE(estab_plinks, u.mesh.mshstats.estab_plinks, ATOMIC); |
@@ -463,6 +465,7 @@ static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) | |||
463 | MESHSTATS_ADD(fwded_frames); | 465 | MESHSTATS_ADD(fwded_frames); |
464 | MESHSTATS_ADD(dropped_frames_ttl); | 466 | MESHSTATS_ADD(dropped_frames_ttl); |
465 | MESHSTATS_ADD(dropped_frames_no_route); | 467 | MESHSTATS_ADD(dropped_frames_no_route); |
468 | MESHSTATS_ADD(dropped_frames_congestion); | ||
466 | MESHSTATS_ADD(estab_plinks); | 469 | MESHSTATS_ADD(estab_plinks); |
467 | #undef MESHSTATS_ADD | 470 | #undef MESHSTATS_ADD |
468 | } | 471 | } |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a37da74de023..5e636bc3551f 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -261,6 +261,7 @@ struct mesh_stats { | |||
261 | __u32 fwded_frames; /* Mesh total forwarded frames */ | 261 | __u32 fwded_frames; /* Mesh total forwarded frames */ |
262 | __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ | 262 | __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ |
263 | __u32 dropped_frames_no_route; /* Not transmitted, no route found */ | 263 | __u32 dropped_frames_no_route; /* Not transmitted, no route found */ |
264 | __u32 dropped_frames_congestion;/* Not forwarded due to congestion */ | ||
264 | atomic_t estab_plinks; | 265 | atomic_t estab_plinks; |
265 | }; | 266 | }; |
266 | 267 | ||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index d479d48e8d18..811e3ade8c74 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1844,6 +1844,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1844 | /* illegal frame */ | 1844 | /* illegal frame */ |
1845 | return RX_DROP_MONITOR; | 1845 | return RX_DROP_MONITOR; |
1846 | 1846 | ||
1847 | if (ieee80211_queue_stopped(&local->hw, skb_get_queue_mapping(skb))) { | ||
1848 | IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.mesh, | ||
1849 | dropped_frames_congestion); | ||
1850 | return RX_DROP_MONITOR; | ||
1851 | } | ||
1852 | |||
1847 | if (mesh_hdr->flags & MESH_FLAGS_AE) { | 1853 | if (mesh_hdr->flags & MESH_FLAGS_AE) { |
1848 | struct mesh_path *mppath; | 1854 | struct mesh_path *mppath; |
1849 | char *proxied_addr; | 1855 | char *proxied_addr; |