All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: <devel@driverdev.osuosl.org>, <linux-mips@linux-mips.org>,
	David Daney <david.daney@cavium.com>, <richard@nod.at>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 1/2] staging: octeon-ethernet: don't assume that CPU 0 is special
Date: Mon, 30 Sep 2013 14:08:31 -0700	[thread overview]
Message-ID: <5249E84F.2070008@caviumnetworks.com> (raw)
In-Reply-To: <20130930195642.GF4572@blackmetal.musicnaut.iki.fi>

On 09/30/2013 12:56 PM, Aaro Koskinen wrote:
> Hi,
>
> On Mon, Sep 30, 2013 at 12:41:59PM -0700, David Daney wrote:
>> On 09/30/2013 12:35 PM, Aaro Koskinen wrote:
>>> No, the original logic was already broken. The code assumed that the
>>> NAPI scheduled by the driver init gets executed always on CPU 0. The
>>> IRQ got enabled just because we are lucky.
>>
>> No.  The default affinity for all irqs is CPU0 for just this reason.
>> So there was no luck involved.
>
> According the Kconfig, this driver can be compiled as a module:
>
>> config OCTEON_ETHERNET
>> 	tristate "Cavium Networks Octeon Ethernet support"
> [...]
>> 	To compile this driver as a module, choose M here.  The module
>> 	will be called octeon-ethernet.
>
> What guarantees that CPU0 is around (or the smp_affinity is at its
> default value) by the time user executes modprobe?

Nothing enforced by the kernel.  Just don't take CPU0 off-line and you 
should be good to go.

There is a lot of room for improvement in the driver.

Really this whole thing of starting NAPI on multiple CPUs for the same 
input queue is not good.  It leads to loss of packet ordering when 
forwarding.

What we really want is to have one POW group (input queue) per CPU and 
only run one CPU per group.  If we did that, we wouldn't have all these 
affinity issues.

David Daney

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: devel@driverdev.osuosl.org, linux-mips@linux-mips.org,
	David Daney <david.daney@cavium.com>,
	richard@nod.at, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 1/2] staging: octeon-ethernet: don't assume that CPU 0 is special
Date: Mon, 30 Sep 2013 14:08:31 -0700	[thread overview]
Message-ID: <5249E84F.2070008@caviumnetworks.com> (raw)
Message-ID: <20130930210831.iJKYyQPxIVqYAHWlQLnPDATs6Qu42xUfkn6nsnGZJFc@z> (raw)
In-Reply-To: <20130930195642.GF4572@blackmetal.musicnaut.iki.fi>

On 09/30/2013 12:56 PM, Aaro Koskinen wrote:
> Hi,
>
> On Mon, Sep 30, 2013 at 12:41:59PM -0700, David Daney wrote:
>> On 09/30/2013 12:35 PM, Aaro Koskinen wrote:
>>> No, the original logic was already broken. The code assumed that the
>>> NAPI scheduled by the driver init gets executed always on CPU 0. The
>>> IRQ got enabled just because we are lucky.
>>
>> No.  The default affinity for all irqs is CPU0 for just this reason.
>> So there was no luck involved.
>
> According the Kconfig, this driver can be compiled as a module:
>
>> config OCTEON_ETHERNET
>> 	tristate "Cavium Networks Octeon Ethernet support"
> [...]
>> 	To compile this driver as a module, choose M here.  The module
>> 	will be called octeon-ethernet.
>
> What guarantees that CPU0 is around (or the smp_affinity is at its
> default value) by the time user executes modprobe?

Nothing enforced by the kernel.  Just don't take CPU0 off-line and you 
should be good to go.

There is a lot of room for improvement in the driver.

Really this whole thing of starting NAPI on multiple CPUs for the same 
input queue is not good.  It leads to loss of packet ordering when 
forwarding.

What we really want is to have one POW group (input queue) per CPU and 
only run one CPU per group.  If we did that, we wouldn't have all these 
affinity issues.

David Daney

  reply	other threads:[~2013-09-30 21:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-28 19:50 [PATCH 1/2] staging: octeon-ethernet: don't assume that CPU 0 is special Aaro Koskinen
2013-09-28 19:50 ` [PATCH 2/2] staging: octeon-ethernet: allow to use only 1 CPU for packet processing Aaro Koskinen
2013-09-28 20:40 ` [PATCH 1/2] staging: octeon-ethernet: don't assume that CPU 0 is special Richard Weinberger
2013-09-28 21:12   ` Aaro Koskinen
2013-09-28 21:15 ` Richard Weinberger
2013-09-30 17:23 ` David Daney
2013-09-30 17:23   ` David Daney
2013-09-30 19:35   ` Aaro Koskinen
2013-09-30 19:41     ` David Daney
2013-09-30 19:41       ` David Daney
2013-09-30 19:56       ` Aaro Koskinen
2013-09-30 21:08         ` David Daney [this message]
2013-09-30 21:08           ` David Daney
2013-09-30 21:27           ` Aaro Koskinen
2013-10-03 20:36 ` Greg Kroah-Hartman

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=5249E84F.2070008@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=david.daney@cavium.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-mips@linux-mips.org \
    --cc=richard@nod.at \
    /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.