kni: fix deadlock in netif_receive_skb
authorYao-Po Wang <blue119@gmail.com>
Fri, 11 Jul 2014 15:37:24 +0000 (23:37 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 18 Jul 2014 23:54:41 +0000 (01:54 +0200)
Per netif_receive_skb function description, it may only be called from
interrupt contex, but KNI is run on kthread that like as user-space
context. It may occur deadlock, if netif_receive_skb called from kthread,
so it should be repleaced by netif_rx or adding local_bh_disable/enable
around netif_receive_skb.

Signed-off-by: Yao-Po Wang <blue119@gmail.com>
Acked-by: Alex Markuze <alex@weka.io>
lib/librte_eal/linuxapp/kni/kni_net.c

index d3c0190..28cc5ab 100644 (file)
@@ -179,7 +179,7 @@ kni_net_rx_normal(struct kni_dev *kni)
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
 
                        /* Call netif interface */
-                       netif_receive_skb(skb);
+                       netif_rx(skb);
 
                        /* Update statistics */
                        kni->stats.rx_bytes += len;