diff options
| author | Changli Gao <xiaosuo@gmail.com> | 2010-04-27 18:07:33 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-04-27 18:11:49 -0400 |
| commit | 6e7676c1a76aed6e957611d8d7a9e5592e23aeba (patch) | |
| tree | 0cd14260745f755c885466c59182452f637e92e3 /include/linux/netdevice.h | |
| parent | c58dc01babfd58ec9e71a6ce080150dc27755d88 (diff) | |
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>
Diffstat (limited to 'include/linux/netdevice.h')
| -rw-r--r-- | include/linux/netdevice.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c04ca246395..40d4c20d034 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1388,6 +1388,7 @@ struct softnet_data { | |||
| 1388 | struct Qdisc **output_queue_tailp; | 1388 | struct Qdisc **output_queue_tailp; |
| 1389 | struct list_head poll_list; | 1389 | struct list_head poll_list; |
| 1390 | struct sk_buff *completion_queue; | 1390 | struct sk_buff *completion_queue; |
| 1391 | struct sk_buff_head process_queue; | ||
| 1391 | 1392 | ||
| 1392 | #ifdef CONFIG_RPS | 1393 | #ifdef CONFIG_RPS |
| 1393 | struct softnet_data *rps_ipi_list; | 1394 | struct softnet_data *rps_ipi_list; |
| @@ -1402,10 +1403,11 @@ struct softnet_data { | |||
| 1402 | struct napi_struct backlog; | 1403 | struct napi_struct backlog; |
| 1403 | }; | 1404 | }; |
| 1404 | 1405 | ||
| 1405 | static inline void input_queue_head_incr(struct softnet_data *sd) | 1406 | static inline void input_queue_head_add(struct softnet_data *sd, |
| 1407 | unsigned int len) | ||
| 1406 | { | 1408 | { |
| 1407 | #ifdef CONFIG_RPS | 1409 | #ifdef CONFIG_RPS |
| 1408 | sd->input_queue_head++; | 1410 | sd->input_queue_head += len; |
| 1409 | #endif | 1411 | #endif |
| 1410 | } | 1412 | } |
| 1411 | 1413 | ||
