DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Kamraan Nasim <knasim@sidebandnetworks.com>
Cc: dev@dpdk.org, Yuanzhang Hu <YHu@sidebandnetworks.com>
Subject: Re: [dpdk-dev] Load-balancing position field in DPDK load_balancer sample app vs. Hash table
Date: Fri, 14 Nov 2014 10:53:25 +0000	[thread overview]
Message-ID: <20141114105325.GB13232@bricha3-MOBL3> (raw)
In-Reply-To: <CAPrTskioYqu_aad7EeepyuYb-9wDZWDOWXQpdCrD5Yofom__vA@mail.gmail.com>

On Thu, Nov 13, 2014 at 01:29:32PM -0500, Kamraan Nasim wrote:
> Hello,
> 
> So i've borrowed some code from the DPDK Load balancer sample application,
> specifically the load balancing position(byte 29th) to determine which
> worker lcore to forward the packet to.
> 
> The idea is that flow affinity should be maintained and all packets from
> the same flow would have the same checksum/5-tuple value
> 
> worker_id = packet[load_balancing_field] % n_workers
> 
> Question is that how reliable is this load balancing position? I am tempted
> to use Hash tables but I think this position based mechanism may be faster.
> 
> How have people's experience with this been in general?
>

Using a modulus "%" operation will be far, far faster than doing a hash table
lookup, though obviously it is not as flexible. [If you have a power-of-two
number of workers, you can replace the "%" by "&", if you like to shave off
another few cycles].
As for reliability, I'm afraid it depends entirely on your application and what
field you pick as to whether it works for load balancing or not. 

/Bruce

  reply	other threads:[~2014-11-14 10:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 18:29 Kamraan Nasim
2014-11-14 10:53 ` Bruce Richardson [this message]
2014-11-14 14:44 ` Ananyev, Konstantin
2014-11-14 16:23   ` Yerden Zhumabekov
2014-11-14 16:50     ` Ananyev, Konstantin
2014-11-14 16:55       ` Yerden Zhumabekov
2014-11-14 16:57       ` Chilikin, Andrey
2014-11-14 17:20         ` Yerden Zhumabekov
2014-11-17 10:15           ` Chilikin, Andrey
2014-11-14 18:49         ` Matt Laswell
2014-11-15  7:10           ` Yerden Zhumabekov
2014-11-15 15:28             ` Matt Laswell
2014-11-17  0:48         ` Zhang, Helin

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=20141114105325.GB13232@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=YHu@sidebandnetworks.com \
    --cc=dev@dpdk.org \
    --cc=knasim@sidebandnetworks.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;
as well as URLs for NNTP newsgroup(s).