diff options
author | Simon Wunderlich <siwu@hrz.tu-chemnitz.de> | 2010-05-07 21:47:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 13:42:39 -0700 |
commit | 19dae340d2af3074abad5b4c7306ae240068f89f (patch) | |
tree | 9385aecaa12be34f9669515f18c205022d726470 /drivers/staging/batman-adv/main.h | |
parent | f94cee241099b31732460c255c6af24979ec778e (diff) | |
download | blackbird-obmc-linux-19dae340d2af3074abad5b4c7306ae240068f89f.tar.gz blackbird-obmc-linux-19dae340d2af3074abad5b4c7306ae240068f89f.zip |
Staging: batman-adv: Limit queue lengths for batman and broadcast packets
This patch limits the queue lengths of batman and broadcast packets. BATMAN
packets are held back for aggregation and jittered to avoid interferences.
Broadcast packets are stored to be sent out multiple times to increase
the probability to be received by other nodes in lossy environments.
Especially in extreme cases like broadcast storms, the queues have been seen
to run full, eating up all the memory and triggering the infamous OOM killer.
With the queue length limits introduced in this patch, this problem is
avoided.
Each queue is limited to 256 entries for now, resulting in 1 MB of maximum
space available in total for typical setups (assuming one packet including
overhead does not require more than 2000 byte). This should also be reasonable
for smaller routers, otherwise the defines can be tweaked later.
This third version of the patch does not increase the local broadcast
sequence number when the queue is already full.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/main.h')
-rw-r--r-- | drivers/staging/batman-adv/main.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/batman-adv/main.h b/drivers/staging/batman-adv/main.h index 58c1ec167412..6749ce036b91 100644 --- a/drivers/staging/batman-adv/main.h +++ b/drivers/staging/batman-adv/main.h @@ -69,6 +69,8 @@ #define MODULE_ACTIVE 1 #define MODULE_DEACTIVATING 2 +#define BCAST_QUEUE_LEN 256 +#define BATMAN_QUEUE_LE 256 /* * Debug Messages @@ -132,6 +134,8 @@ extern spinlock_t forw_bat_list_lock; extern spinlock_t forw_bcast_list_lock; extern atomic_t vis_interval; +extern atomic_t bcast_queue_left; +extern atomic_t batman_queue_left; extern int16_t num_hna; extern struct net_device *soft_device; |