diff options
author | Tom Herbert <therbert@google.com> | 2010-05-20 14:37:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-21 03:38:33 -0400 |
commit | 76cc8b13a6e41b537fd262b600da1571314add62 (patch) | |
tree | a8a25a4f23be5c0eeed77dd9fcb30dc9b315e519 /include/linux/netdevice.h | |
parent | 1f01bfd202bc539bccd282befa2bbdb8d6ad80ee (diff) |
net: fix problem in dequeuing from input_pkt_queue
Fix some issues introduced in batch skb dequeuing for input_pkt_queue.
The primary issue it that the queue head must be incremented only
after a packet has been processed, that is only after
__netif_receive_skb has been called. This is needed for the mechanism
to prevent OOO packet in RFS. Also when flushing the input_pkt_queue
and process_queue, the process queue should be done first to prevent
OOO packets.
Because the input_pkt_queue has been effectively split into two queues,
the calculation of the tail ptr is no longer correct. The correct value
would be head+input_pkt_queue->len+process_queue->len. To avoid
this calculation we added an explict input_queue_tail in softnet_data.
The tail value is simply incremented when queuing to input_pkt_queue.
Signed-off-by: Tom Herbert <therbert@google.com>
Acked-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 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a1bff6518166..256419583d9d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1407,17 +1407,25 @@ struct softnet_data { | |||
1407 | struct softnet_data *rps_ipi_next; | 1407 | struct softnet_data *rps_ipi_next; |
1408 | unsigned int cpu; | 1408 | unsigned int cpu; |
1409 | unsigned int input_queue_head; | 1409 | unsigned int input_queue_head; |
1410 | unsigned int input_queue_tail; | ||
1410 | #endif | 1411 | #endif |
1411 | unsigned dropped; | 1412 | unsigned dropped; |
1412 | struct sk_buff_head input_pkt_queue; | 1413 | struct sk_buff_head input_pkt_queue; |
1413 | struct napi_struct backlog; | 1414 | struct napi_struct backlog; |
1414 | }; | 1415 | }; |
1415 | 1416 | ||
1416 | static inline void input_queue_head_add(struct softnet_data *sd, | 1417 | static inline void input_queue_head_incr(struct softnet_data *sd) |
1417 | unsigned int len) | ||
1418 | { | 1418 | { |
1419 | #ifdef CONFIG_RPS | 1419 | #ifdef CONFIG_RPS |
1420 | sd->input_queue_head += len; | 1420 | sd->input_queue_head++; |
1421 | #endif | ||
1422 | } | ||
1423 | |||
1424 | static inline void input_queue_tail_incr_save(struct softnet_data *sd, | ||
1425 | unsigned int *qtail) | ||
1426 | { | ||
1427 | #ifdef CONFIG_RPS | ||
1428 | *qtail = ++sd->input_queue_tail; | ||
1421 | #endif | 1429 | #endif |
1422 | } | 1430 | } |
1423 | 1431 | ||