Commit 5f652bb2 authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

gro_cells: gro_cells_receive now return error code

so that the caller can update stats accordingly, if needed
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 276b8c77
...@@ -14,27 +14,26 @@ struct gro_cells { ...@@ -14,27 +14,26 @@ struct gro_cells {
struct gro_cell __percpu *cells; struct gro_cell __percpu *cells;
}; };
static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) static inline int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
{ {
struct gro_cell *cell; struct gro_cell *cell;
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO)) { if (!gcells->cells || skb_cloned(skb) || !(dev->features & NETIF_F_GRO))
netif_rx(skb); return netif_rx(skb);
return;
}
cell = this_cpu_ptr(gcells->cells); cell = this_cpu_ptr(gcells->cells);
if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) { if (skb_queue_len(&cell->napi_skbs) > netdev_max_backlog) {
atomic_long_inc(&dev->rx_dropped); atomic_long_inc(&dev->rx_dropped);
kfree_skb(skb); kfree_skb(skb);
return; return NET_RX_DROP;
} }
__skb_queue_tail(&cell->napi_skbs, skb); __skb_queue_tail(&cell->napi_skbs, skb);
if (skb_queue_len(&cell->napi_skbs) == 1) if (skb_queue_len(&cell->napi_skbs) == 1)
napi_schedule(&cell->napi); napi_schedule(&cell->napi);
return NET_RX_SUCCESS;
} }
/* called under BH context */ /* called under BH context */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment