From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id A9533B3A3 for ; Fri, 11 Jul 2014 17:37:09 +0200 (CEST) Received: by mail-pa0-f44.google.com with SMTP id rd3so1669451pab.17 for ; Fri, 11 Jul 2014 08:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=x+rJW/ZeP+g4sTCl7zQmB7cZTqJabs5sm/SHSACxRUQ=; b=aE56bYBA2vsyymRY5bZgq5qAOaVbWBT7hoHNJ1hnsxmvXraL4lk56qNB4eu3L/GF+B M9AOPAon9EMFLNcRlU+3rNsdXHPpcuu9ZiJximw8miY08XfZOaEwNi7EMlzIDrzP9J0D MnBO49zxbHHdGcFz/7tbbYJKgC7elcvHta2D4E6w9xQhEntNxMgXdwV/YjAEhm5Pc7Kq oMuRSdvcrnNTF3iACLogs8FIK1u7x1aoNLkMsymvEBX891IXBY37GCy5xILQuaGXOWvw tRiMqa3aqyXRCtGDr486pCpBQ62Q6RaxIcXacREOfHaT8uT7xn/ZMNynkiUmtbjvmLUT gfuQ== X-Received: by 10.66.66.166 with SMTP id g6mr29163818pat.108.1405093057591; Fri, 11 Jul 2014 08:37:37 -0700 (PDT) Received: from ypwang-nb.ypwang.info ([59.105.180.111]) by mx.google.com with ESMTPSA id np6sm3467257pdb.86.2014.07.11.08.37.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Jul 2014 08:37:36 -0700 (PDT) From: Yao-Po Wang To: dev@dpdk.org Date: Fri, 11 Jul 2014 23:37:24 +0800 Message-Id: <1405093044-3264-1-git-send-email-blue119@gmail.com> X-Mailer: git-send-email 2.0.0 Subject: [dpdk-dev] [PATCH v2] kni: use netif_rx instead of netif_receive_skb in which ocurr deallock on userpace contex X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 15:37:10 -0000 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 contex. It may occur deallock, 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 --- lib/librte_eal/linuxapp/kni/kni_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index d3c0190..28cc5ab 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -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; -- 2.0.0