DPDK patches and discussions
 help / color / mirror / Atom feed
From: 최익성 <pnk003@naver.com>
To: dev@dpdk.org
Subject: [dpdk-dev] Question about worker assignment in load balancer implementaion in DPDK library example.
Date: Wed, 27 May 2015 23:04:40 +0900 (KST)	[thread overview]
Message-ID: <77fdb0de301eb5b1da1dd7aea32e5826@cweb11.nm.nhnsystem.com> (raw)

Dear DPDK experts.
 
I have a question about load balancer implementaion in DPDK library example.
(dpdk-2.0.0/examples/load_balancer)
 
I read from load balancer application user guide that The worker lcore to handle the current packet is determined by reading a predefined 1 byte field from the input packet.
 
worker_id = packet[load_balancing_field(pos_lb)] % n_workers .
 
However I found its implementaion of the above function in the source code.
 
worker_0 = data_0_0[pos_lb] &amp; (n_workers - 1);
worker_1 = data_0_1[pos_lb] &amp; (n_workers - 1);
 
Does this implementation works?
 
If the n_workers = 3, the worker_0 and worker_1 have only values of 0 or 2.
 
I will appreciate if I can be given any advice or information.
 
Thank you very much.
 
Sincerely Yours,
 
Ick-Sung Choi.


                 reply	other threads:[~2015-05-27 14:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=77fdb0de301eb5b1da1dd7aea32e5826@cweb11.nm.nhnsystem.com \
    --to=pnk003@naver.com \
    --cc=dev@dpdk.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).