DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ravi Kerur <rkerur@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v1] Modify and modularize l3fwd code
Date: Mon, 21 Dec 2015 15:11:51 -0800	[thread overview]
Message-ID: <1450739511-5868-1-git-send-email-rkerur@gmail.com> (raw)

Many thanks to Intel team (Konstantin, Bruce and Declan) for below proposal to
make changes to l3fwd code, their valuable inputs during interal review and help
in performance tests.

The main problem with l3fwd is that it is too monolithic with everything being
in one file, and the various options all controlled by compile time flags. This 
means that it's hard to read and understand, and when making any changes, you need
to go to a lot of work to try and ensure you cover all the code paths, since a 
compile of the app will not touch large parts of the l3fwd codebase.
 
Following changes were done to fix the issues mentioned above

	> Split out the various lpm and hash specific functionality into separate
	  files, so that l3fwd code has one file for common code e.g. args 
	  processing, mempool creation, and then individual files for the various
	  forwarding approaches.

	  Following are new file lists

	  main.c (Common code for args processing, memppol creation, etc)
	  l3fwd_em.c (Hash/Exact match aka 'EM' functionality)
	  l3fwd_em_sse.h (SSE4_1 buffer optimizated 'EM' code)
	  l3fwd_lpm.c (Longest Prefix Match aka 'LPM' functionality)
	  l3fwd_lpm_sse.h (SSE4_1 buffer optimizated 'LPM' code)
	  l3fwd.h (Common include for 'EM' and 'LPM')


	> The choosing of the lpm/hash path should be done at runtime, not
	  compile time, via a command-line argument. This will ensure that 
	  both code paths get compiled in a single go

	  Following examples show runtime options provided

	  Select 'LPM' or 'EM' based on run time selection f.e.
                > l3fwd -c 0x1 -n 1 -- -p 0x1 -E ... (EM)
                > l3fwd -c 0x1 -n 1 -- -p 0x1 -L ... (LPM)

	  Options "E" and "L" are mutualy-exclusive.

	  If none selected, "L" is default.

Ravi Kerur (1):
  Modify and modularize l3fwd code

 examples/l3fwd/Makefile        |    9 +-
 examples/l3fwd/l3fwd.h         |  209 ++++
 examples/l3fwd/l3fwd_em.c      |  773 ++++++++++++++
 examples/l3fwd/l3fwd_em_sse.h  |  479 +++++++++
 examples/l3fwd/l3fwd_lpm.c     |  414 ++++++++
 examples/l3fwd/l3fwd_lpm_sse.h |  610 +++++++++++
 examples/l3fwd/main.c          | 2202 ++++------------------------------------
 7 files changed, 2694 insertions(+), 2002 deletions(-)
 create mode 100644 examples/l3fwd/l3fwd.h
 create mode 100644 examples/l3fwd/l3fwd_em.c
 create mode 100644 examples/l3fwd/l3fwd_em_sse.h
 create mode 100644 examples/l3fwd/l3fwd_lpm.c
 create mode 100644 examples/l3fwd/l3fwd_lpm_sse.h

-- 
1.9.1

             reply	other threads:[~2015-12-21 23:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 23:11 Ravi Kerur [this message]
2015-12-21 23:12 ` Ravi Kerur
2016-01-18 13:30   ` Ananyev, Konstantin
2016-02-02 12:01   ` Kulasek, TomaszX
2016-02-04 21:55     ` Thomas Monjalon
2016-02-16 12:09       ` Azarewicz, PiotrX T
2016-02-16 13:04         ` Thomas Monjalon
2016-02-16 14:03   ` [dpdk-dev] [PATCH v2 1/1] examples/l3fwd: modify " Piotr Azarewicz
2016-02-18  9:08     ` [dpdk-dev] [PATCH v3 " Piotr Azarewicz
2016-02-24 13:16       ` Thomas Monjalon
2016-02-24 14:15         ` Azarewicz, PiotrX T
2016-02-25 10:24       ` [dpdk-dev] [PATCH v4 " Piotr Azarewicz
2016-02-28 20:50         ` 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=1450739511-5868-1-git-send-email-rkerur@gmail.com \
    --to=rkerur@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).