Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197350
b: refs/heads/master
c: bd13b61
h: refs/heads/master
v: v3
  • Loading branch information
Marek Lindner authored and Greg Kroah-Hartman committed May 11, 2010
1 parent fb77c51 commit 4253ed3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f347b8736f176681fbfc666bf00165125a3274a5
refs/heads/master: bd13b616aa9d082dce760759b7473da5ed399452
12 changes: 12 additions & 0 deletions trunk/drivers/staging/batman-adv/aggregation.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ static bool can_aggregate_with(struct batman_packet *new_batman_packet,
*/

if (time_before(send_time, forw_packet->send_time) &&
time_after_eq(send_time + msecs_to_jiffies(MAX_AGGREGATION_MS),
forw_packet->send_time) &&
(aggregated_bytes <= MAX_AGGREGATION_BYTES)) {

/**
Expand Down Expand Up @@ -195,6 +197,16 @@ void add_bat_packet_to_list(unsigned char *packet_buff, int packet_len,
if (forw_packet_aggr == NULL) {
/* the following section can run without the lock */
spin_unlock_irqrestore(&forw_bat_list_lock, flags);

/**
* if we could not aggregate this packet with one of the others
* we hold it back for a while, so that it might be aggregated
* later on
*/
if ((!own_packet) &&
(atomic_read(&bat_priv->aggregation_enabled)))
send_time += msecs_to_jiffies(MAX_AGGREGATION_MS);

new_aggregated_packet(packet_buff, packet_len,
send_time, direct_link,
if_incoming, own_packet);
Expand Down
10 changes: 1 addition & 9 deletions trunk/drivers/staging/batman-adv/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@ static unsigned long own_send_time(void)
/* when do we schedule a forwarded packet to be sent */
static unsigned long forward_send_time(void)
{
unsigned long send_time = jiffies; /* Starting now plus... */

if (atomic_read(&aggregation_enabled))
send_time += (((MAX_AGGREGATION_MS - (JITTER/2) +
(random32() % JITTER)) * HZ) / 1000);
else
send_time += (((random32() % (JITTER/2)) * HZ) / 1000);

return send_time;
return jiffies + (((random32() % (JITTER/2)) * HZ) / 1000);
}

/* send out an already prepared packet to the given address via the
Expand Down

0 comments on commit 4253ed3

Please sign in to comment.