DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jun Han <junhanece@gmail.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] l3fwd LPM lookup - issue when measuring latency
Date: Sun, 23 Mar 2014 17:29:36 +0100	[thread overview]
Message-ID: <CAGeT4P+pERW_snn5rP4+GOKWcqVsxpXbycpiG4UXNwxvwK28YQ@mail.gmail.com> (raw)

Hi all,

I've been trying to measure possible performance penalties of performing
LPM table lookup on l3fwd code (as opposed to a simple forwarding without
lookup, i.e., forwarding back to the ingress port).

I perform two sets of experiments -- (1) generate a fixed dst IP address
from DPDK pktgen; (2) generate random dst IP address from DPDK pktgen. My
hypothesis is that for case (1), upon receiving many packets with same dst
IP, DPDK l3fwd should only need to fetch LPM table from the cache. However,
case (2) would generate more cache misses, hence requiring fetches from
memory, which should increase the latency. (My current machine has 20MB of
L3 cache.)

However, when I measure the average cycles it takes to perform a lookup
indexed by the received dst IP address, the two cases yield almost similar
results of around 34 cycles. I am using rdtsc to measure the cycles in the
rte_lpm_lookup() function in rte_lpm.h (under lib/librte_lpm). I am not
sure if this is due to rte_rdtsc problem, or if I am misunderstanding
something.

tsc1 = rte_rdtsc();
tbl_entry = *(const uint16_t *)&lpm->tbl24[tbl24_index];
tscdif = rte_rdtsc() - tsc1;
aggreg_dif += tscdif;

I would appreciate it if someone could provide their opinion on this
phenomenon.

Thanks in advance!
Jun

                 reply	other threads:[~2014-03-23 16:28 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=CAGeT4P+pERW_snn5rP4+GOKWcqVsxpXbycpiG4UXNwxvwK28YQ@mail.gmail.com \
    --to=junhanece@gmail.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).