diff options
author | Paolo Abeni <pabeni@redhat.com> | 2016-07-20 12:11:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-22 00:50:41 -0400 |
commit | 5f652bb2eb3eb38f97194ce5c41da1fa12e914b8 (patch) | |
tree | da586a6359ddf65f17d178bbbbf1e9a82934d1ca | |
parent | 276b8c77c3e4838f574d37e25ec8ba52d0418475 (diff) |
gro_cells: gro_cells_receive now return error code
so that the caller can update stats accordingly, if needed
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/gro_cells.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h index cf6c74550baa..d15214d673b2 100644 --- a/include/net/gro_cells.h +++ b/include/net/gro_cells.h | |||
@@ -14,27 +14,26 @@ struct gro_cells { | |||
14 | struct gro_cell __percpu *cells; | 14 | struct gro_cell __percpu *cells; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) | 17 | static inline int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) |
18 | { | 18 | { |
19 | struct gro_cell *cell; | 19 | struct gro_cell *cell; |
20 | struct net_device *dev = skb->dev; | 20 | struct net_device *dev = skb->dev; |
21 | 21 | ||
22 | if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { | 22 | if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) |
23 | netif_rx(skb); | 23 | return netif_rx(skb); |
24 | return; | ||
25 | } | ||
26 | 24 | ||
27 | cell = this_cpu_ptr(gcells->cells); | 25 | cell = this_cpu_ptr(gcells->cells); |
28 | 26 | ||
29 | if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { | 27 | if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { |
30 | atomic_long_inc(&dev->rx_dropped); | 28 | atomic_long_inc(&dev->rx_dropped); |
31 | kfree_skb(skb); | 29 | kfree_skb(skb); |
32 | return; | 30 | return NET_RX_DROP; |
33 | } | 31 | } |
34 | 32 | ||
35 | __skb_queue_tail(&cell->napi_skbs, skb); | 33 | __skb_queue_tail(&cell->napi_skbs, skb); |
36 | if (skb_queue_len(&cell->napi_skbs) == 1) | 34 | if (skb_queue_len(&cell->napi_skbs) == 1) |
37 | napi_schedule(&cell->napi); | 35 | napi_schedule(&cell->napi); |
36 | return NET_RX_SUCCESS; | ||
38 | } | 37 | } |
39 | 38 | ||
40 | /* called under BH context */ | 39 | /* called under BH context */ |