Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: zhou rui <zhourui.cn@gmail.com>
Cc: Tom Herbert <therbert@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: RPS will assign different smp_processor_id for the same packet?
Date: Sun, 24 Apr 2011 10:00:33 +0200	[thread overview]
Message-ID: <1303632033.2747.51.camel@edumazet-laptop> (raw)
In-Reply-To: <BANLkTikyntWG6YPUdVipHvwJ8yGuU_Vi4w@mail.gmail.com>

Le dimanche 24 avril 2011 à 10:00 +0800, zhou rui a écrit :
> On Sun, Apr 24, 2011 at 3:56 AM, Tom Herbert <therbert@google.com> wrote:
> > On Sat, Apr 23, 2011 at 8:31 AM, zhou rui <zhourui.cn@gmail.com> wrote:
> >> one more question is:
> >>
> >> in the function "int netif_receive_skb(struct sk_buff *skb)"
> >>
> >> cpu = get_rps_cpu(skb->dev, skb, &rflow);
> >> if (cpu >= 0) {
> >>  ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
> >> ....
> >>
> >> probably the cpu is different from the current processor id?(smp_processor_id)
> >> let's say: get_rps_cpu->cpu 0, smp_processor_id->cpu1
> >> when this happen, does it mean that cpu1 is handling the softirq but
> >> have to divert the packet to cpu0?(via a new softirq?)
> >>
> >> so for one packet it involve 2 softirqs?
> >>
> >> possible to get_rps_cpu in interrupt,then let the target cpu do only
> >> one softirq to hanle the packet?
> >>
> > Yes, this is what a non-NAPI driver would do.
> >
> > Tom
> >
> non-NAPI will get_rps_cpu in irq, but why NAPI will get_rps_cpu in
> softirq?(if I understand correctly netif_receive_skb executed in
> softirq?)

Thats hard to understand what your problem or question is.

All heavy Receive networking stuff is handled in softirq.

NAPI allows to reduce number of hardware IRQS in stress/load situations,
fetching several frames at once.




  reply	other threads:[~2011-04-24  8:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 15:50 RPS will assign different smp_processor_id for the same packet? zhou rui
2011-04-21 16:08 ` Eric Dumazet
2011-04-21 16:25   ` Eric Dumazet
2011-04-21 16:29     ` zhou rui
2011-04-23 15:31       ` zhou rui
2011-04-23 19:56         ` Tom Herbert
2011-04-24  2:00           ` zhou rui
2011-04-24  8:00             ` Eric Dumazet [this message]
2011-04-24  9:36               ` zhou rui
2011-04-24 10:53                 ` Eric Dumazet
2011-04-25 11:02                 ` Neil Horman
2011-04-21 16:27   ` zhou rui

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=1303632033.2747.51.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    --cc=zhourui.cn@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox