Skip to content

Commit

Permalink
net: remove time limit in process_backlog()
Browse files Browse the repository at this point in the history
- There is no point to enforce a time limit in process_backlog(), since
other napi instances dont follow same rule. We can exit after only one
packet processed...
The normal quota of 64 packets per napi instance should be the norm, and
net_rx_action() already has its own time limit.
Note : /proc/net/core/dev_weight can be used to tune this 64 default
value.

- Use DEFINE_PER_CPU_ALIGNED for softnet_data definition.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Apr 18, 2010
1 parent 8770acf commit 9958da0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static RAW_NOTIFIER_HEAD(netdev_chain);
* queue in the local softnet handler.
*/

DEFINE_PER_CPU(struct softnet_data, softnet_data);
DEFINE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
EXPORT_PER_CPU_SYMBOL(softnet_data);

#ifdef CONFIG_LOCKDEP
Expand Down Expand Up @@ -3232,7 +3232,6 @@ static int process_backlog(struct napi_struct *napi, int quota)
{
int work = 0;
struct softnet_data *queue = &__get_cpu_var(softnet_data);
unsigned long start_time = jiffies;

napi->weight = weight_p;
do {
Expand All @@ -3252,7 +3251,7 @@ static int process_backlog(struct napi_struct *napi, int quota)
local_irq_enable();

__netif_receive_skb(skb);
} while (++work < quota && jiffies == start_time);
} while (++work < quota);

return work;
}
Expand Down

0 comments on commit 9958da0

Please sign in to comment.