From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com [209.85.223.174]) by dpdk.org (Postfix) with ESMTP id 9EEC1590F for ; Thu, 17 Jul 2014 14:23:57 +0200 (CEST) Received: by mail-ie0-f174.google.com with SMTP id rp18so2742920iec.33 for ; Thu, 17 Jul 2014 05:24:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=gwsl9TuoeYqJKvHuVAfy0VLSbV6lSh16BZw7HSJb9rY=; b=fa8lMUQvHWHrwCCd3mBaf3V9LwH+Tr5oBRw9ThiMQGpO5hrW4hhITmcrNQy8xTs/o1 8sdJpkFblpCQp+T0PT5woHDn9tCJi98X9GD/UwaG+53AkIs/uvEDtPZhl/e8qbRbA1+k JXVl/UNn4YLxw6Sefs+a493OYMz5siHl9/J2Lx+++bs5wVK4EIa7CsfwCpJMO1lErgEy ONR9djll8CPXLawS0SGR33tq85Z974ARsYU5bkjZGhyXCU30lbyvxcgOz1F9KLNS0OkL 8SDMWOIHMzO9f5B9AqtTy70v5qpreL/s8Uni+NWvVjEjipOEMMuqRlcnwAcwfuPbXsZm cxVA== X-Gm-Message-State: ALoCoQmQwqIotoj25m676W5jhWMSdu/V5VeRDfdz91QetQYxYtGkS/RANdmIXIQBWUr0PsKX3d8L MIME-Version: 1.0 X-Received: by 10.60.44.162 with SMTP id f2mr3634797oem.84.1405599892709; Thu, 17 Jul 2014 05:24:52 -0700 (PDT) Received: by 10.202.65.131 with HTTP; Thu, 17 Jul 2014 05:24:52 -0700 (PDT) In-Reply-To: <2139993.JzhFVyBpua@xps13> References: <1405093044-3264-1-git-send-email-blue119@gmail.com> <2139993.JzhFVyBpua@xps13> Date: Thu, 17 Jul 2014 15:24:52 +0300 Message-ID: From: Alex Markuze To: Thomas Monjalon Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" Subject: Re: [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: Thu, 17 Jul 2014 12:23:58 -0000 On Thu, Jul 17, 2014 at 3:02 PM, Thomas Monjalon wrote: > Hi, > > 2014-07-11 23:37, Yao-Po Wang: >> 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 > >> --- a/lib/librte_eal/linuxapp/kni/kni_net.c >> +++ b/lib/librte_eal/linuxapp/kni/kni_net.c >> /* Call netif interface */ >> - netif_receive_skb(skb); >> + netif_rx(skb); > > Is there someone confident to approve this change? Yao-Po is correct. Please see this comment In Linux source code . http://lxr.free-electrons.com/source/net/core/dev.c#L3715 Context: All todays network drivers use(ixgbe is no exception) NAPI which is a soft irq context of the receive flow . This is the context in which netif_receive_skb should be called in. KNI is not soft IRQ context so the generic netif_rx is the right function. > > -- > Thomas