All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Yao-Po Wang <blue119-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH v2] kni: use netif_rx instead of netif_receive_skb in which ocurr deallock on userpace contex
Date: Sat, 19 Jul 2014 02:03:53 +0200	[thread overview]
Message-ID: <5714891.ieLfUKBjNN@xps13> (raw)
In-Reply-To: <CAKfHP0UixroQedaZVSFfnq0+fHWiRmyszYop+S0vPskpmkMJmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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 <blue119-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >
> >> --- 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 <alex-I7wstvAgZDk@public.gmane.org>

Applied for version 1.7.1

Thanks
-- 
Thomas

      parent reply	other threads:[~2014-07-19  0:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 15:37 [PATCH v2] kni: use netif_rx instead of netif_receive_skb in which ocurr deallock on userpace contex Yao-Po Wang
     [not found] ` <1405093044-3264-1-git-send-email-blue119-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-17 12:02   ` Thomas Monjalon
2014-07-17 12:24     ` Alex Markuze
     [not found]       ` <CAKfHP0UixroQedaZVSFfnq0+fHWiRmyszYop+S0vPskpmkMJmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-19  0:03         ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5714891.ieLfUKBjNN@xps13 \
    --to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=blue119-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.