aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/soft-interface.c
diff options
context:
space:
mode:
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>2010-05-07 15:47:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-11 16:42:39 -0400
commit19dae340d2af3074abad5b4c7306ae240068f89f (patch)
tree9385aecaa12be34f9669515f18c205022d726470 /drivers/staging/batman-adv/soft-interface.c
parentf94cee241099b31732460c255c6af24979ec778e (diff)
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/soft-interface.c')
-rw-r--r--drivers/staging/batman-adv/soft-interface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/batman-adv/soft-interface.c b/drivers/staging/batman-adv/soft-interface.c
index 681a0ad7cb8..14b5ccaeaca 100644
--- a/drivers/staging/batman-adv/soft-interface.c
+++ b/drivers/staging/batman-adv/soft-interface.c
@@ -216,10 +216,10 @@ int interface_tx(struct sk_buff *skb, struct net_device *dev)
216 /* set broadcast sequence number */ 216 /* set broadcast sequence number */
217 bcast_packet->seqno = htons(bcast_seqno); 217 bcast_packet->seqno = htons(bcast_seqno);
218 218
219 bcast_seqno++; 219 /* broadcast packet. on success, increase seqno. */
220 if (add_bcast_packet_to_list(skb) == NETDEV_TX_OK)
221 bcast_seqno++;
220 222
221 /* broadcast packet */
222 add_bcast_packet_to_list(skb);
223 /* a copy is stored in the bcast list, therefore removing 223 /* a copy is stored in the bcast list, therefore removing
224 * the original skb. */ 224 * the original skb. */
225 kfree_skb(skb); 225 kfree_skb(skb);