Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Paolo Abeni and committed by
David S. Miller
5f652bb2 276b8c77

+5 -6
+5 -6
include/net/gro_cells.h
··· 14 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 19 struct gro_cell *cell; 20 20 struct net_device *dev = skb->dev; 21 21 22 - if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { 23 - netif_rx(skb); 24 - return; 25 - } 22 + if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) 23 + return netif_rx(skb); 26 24 27 25 cell = this_cpu_ptr(gcells->cells); 28 26 29 27 if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { 30 28 atomic_long_inc(&dev->rx_dropped); 31 29 kfree_skb(skb); 32 - return; 30 + return NET_RX_DROP; 33 31 } 34 32 35 33 __skb_queue_tail(&cell->napi_skbs, skb); 36 34 if (skb_queue_len(&cell->napi_skbs) == 1) 37 35 napi_schedule(&cell->napi); 36 + return NET_RX_SUCCESS; 38 37 } 39 38 40 39 /* called under BH context */