net: batch skb dequeueing from softnet input_pkt_queue

batch skb dequeueing from softnet input_pkt_queue to reduce potential lock
contention when RPS is enabled.

Note: in the worst case, the number of packets in a softnet_data may
be double of netdev_max_backlog.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Changli Gao
2010-04-27 15:07:33 -07:00
committed by David S. Miller
parent c58dc01bab
commit 6e7676c1a7
2 changed files with 44 additions and 21 deletions

View File

@ -1388,6 +1388,7 @@ struct softnet_data {
struct Qdisc **output_queue_tailp;
struct list_head poll_list;
struct sk_buff *completion_queue;
struct sk_buff_head process_queue;
#ifdef CONFIG_RPS
struct softnet_data *rps_ipi_list;
@ -1402,10 +1403,11 @@ struct softnet_data {
struct napi_struct backlog;
};
static inline void input_queue_head_incr(struct softnet_data *sd)
static inline void input_queue_head_add(struct softnet_data *sd,
unsigned int len)
{
#ifdef CONFIG_RPS
sd->input_queue_head++;
sd->input_queue_head += len;
#endif
}