From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by dpdk.org (Postfix) with ESMTP id 337C7592F for ; Sat, 19 Jul 2014 02:02:59 +0200 (CEST) Received: by mail-we0-f170.google.com with SMTP id w62so5172183wes.1 for ; Fri, 18 Jul 2014 17:04:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=MjQbiv13H2u8Ru6FVJnFtsCJ4d9Cl6PuKb6E3j4wlqk=; b=k1wve6o3AGszujhZaHBKpcjDr30CG2WM6Ons4GcA/mT7NRyX0rFB7sIOkZqZW+NvcX xnRzzi+9GYo3PNbyQHTg6MkXdBNgKHSKvUV4FhrUR0zPCgC/xSLsJCOiB6Q8VEL6xNw3 GeOyxcif5YzEwyB0AzGUDQnX3qivU+MJi2eQVxh0VOxImcSSLE8xuR3syyH4dKWPpyTa YeV1xivRxUaCm6L/7/SeaJmBTXzIEncbrDfYwJJOXcZnS+h5XH3Fk5X1OR6pgEz8BzHx 4Y6RHnjmvm0x0qCeJMuxlNo88QYolUJwJRBGrsdw/Jf6M9nMPqMKcM9ctpQP+BLw3otY qk4A== X-Gm-Message-State: ALoCoQm6ys3dn2kvvEo4u8ES/8VsOhfRsjEMMTXd9CLc9haiQN1WsSvhV+8qXYmvMnIWWeFI2MCa X-Received: by 10.194.24.2 with SMTP id q2mr802875wjf.91.1405728241808; Fri, 18 Jul 2014 17:04:01 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id de6sm17817832wjc.16.2014.07.18.17.04.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2014 17:04:00 -0700 (PDT) From: Thomas Monjalon To: Yao-Po Wang Date: Sat, 19 Jul 2014 02:03:53 +0200 Message-ID: <5714891.ieLfUKBjNN@xps13> Organization: 6WIND User-Agent: KMail/4.13.2 (Linux/3.15.5-2-ARCH; KDE/4.13.2; x86_64; ; ) In-Reply-To: References: <1405093044-3264-1-git-send-email-blue119@gmail.com> <2139993.JzhFVyBpua@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Sat, 19 Jul 2014 00:02:59 -0000 2014-07-17 15:24, Alex Markuze: > On Thu, Jul 17, 2014 at 3:02 PM, Thomas Monjalon > > 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. Thanks for confirmation. Assuming Acked-by: Alex Markuze Applied for version 1.7.1 Thanks -- Thomas