File tree 1 file changed +18
-4
lines changed 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -13,22 +13,36 @@ int gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
13
13
{
14
14
struct net_device * dev = skb -> dev ;
15
15
struct gro_cell * cell ;
16
+ int res ;
16
17
17
- if (!gcells -> cells || skb_cloned (skb ) || netif_elide_gro (dev ))
18
- return netif_rx (skb );
18
+ rcu_read_lock ();
19
+ if (unlikely (!(dev -> flags & IFF_UP )))
20
+ goto drop ;
21
+
22
+ if (!gcells -> cells || skb_cloned (skb ) || netif_elide_gro (dev )) {
23
+ res = netif_rx (skb );
24
+ goto unlock ;
25
+ }
19
26
20
27
cell = this_cpu_ptr (gcells -> cells );
21
28
22
29
if (skb_queue_len (& cell -> napi_skbs ) > netdev_max_backlog ) {
30
+ drop :
23
31
atomic_long_inc (& dev -> rx_dropped );
24
32
kfree_skb (skb );
25
- return NET_RX_DROP ;
33
+ res = NET_RX_DROP ;
34
+ goto unlock ;
26
35
}
27
36
28
37
__skb_queue_tail (& cell -> napi_skbs , skb );
29
38
if (skb_queue_len (& cell -> napi_skbs ) == 1 )
30
39
napi_schedule (& cell -> napi );
31
- return NET_RX_SUCCESS ;
40
+
41
+ res = NET_RX_SUCCESS ;
42
+
43
+ unlock :
44
+ rcu_read_unlock ();
45
+ return res ;
32
46
}
33
47
EXPORT_SYMBOL (gro_cells_receive );
34
48
You can’t perform that action at this time.
0 commit comments