DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Added Spinlock to l3fwd-vf example to prevent race conditioning
Date: Wed, 10 Dec 2014 19:34:16 -0500	[thread overview]
Message-ID: <20141211003416.GB24240@localhost.localdomain> (raw)
In-Reply-To: <20141210153837.1f30eed8@urahara>

On Wed, Dec 10, 2014 at 03:38:37PM -0800, Stephen Hemminger wrote:
> On Wed, 10 Dec 2014 11:16:46 -0500
> Neil Horman <nhorman@tuxdriver.com> wrote:
> 
> > This really seems like a false savings to me.  If an application intends to use
> > multiple processes (which by all rights it seems like the use case that the dpdk
> > is mostly designed for) then you need locking one way or another, and you've
> > just made application coding harder, because the application now needs to know
> > which functions might have internal critical sections that they need to provide
> > locking for.
> 
> The DPDK is not Linux.
I never indicated that it was.

> See the examples of how to route without using locks by doing asymmetric multiprocessing.
> I.e queues are only serviced by one CPU.
> 
Yes, I've seen it.

> The cost of a locked operation (even uncontended) is often enough to drop
> packet performance by several million PPS.
Please re-read my note, I clearly stated that a single process use case was a
valid one, but that didn't preclude the need to provide mutual exclusion
internally to the api.  Theres no reason that this locking can't be moved into
the api, and the spinlock api itself either be defined to do locking at compile
time, or defined out as empty macros based on a build variable
(CONFIG_SINGLE_ACCESSOR or some such).  That way you save the application the
headache of having to guess which api calls need locking around them, and you
still get maximal performance if the application being written can guarantee
single accessor status to the dpdk library.

Neil

  reply	other threads:[~2014-12-11  0:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 11:16 [dpdk-dev] [PATCH] " Daniel Mrzyglod
2014-07-23  8:33 ` Thomas Monjalon
2014-11-11 22:56   ` Thomas Monjalon
2014-11-11 23:18     ` Xie, Huawei
2014-12-08 14:45 ` [dpdk-dev] " Neil Horman
2014-12-10  8:18   ` Wodkowski, PawelX
2014-12-10 14:47     ` Neil Horman
2014-12-10 14:54       ` Bruce Richardson
2014-12-10 15:53         ` Mrzyglod, DanielX T
2014-12-10 16:16         ` Neil Horman
2014-12-10 23:38           ` Stephen Hemminger
2014-12-11  0:34             ` Neil Horman [this message]
2014-12-10 10:53   ` Thomas Monjalon
2014-12-11  1:08   ` Thomas Monjalon

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=20141211003416.GB24240@localhost.localdomain \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).