All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] Modify and modularize l3fwd code
@ 2015-12-21 23:11 Ravi Kerur
  2015-12-21 23:12 ` Ravi Kerur
  0 siblings, 1 reply; 13+ messages in thread
From: Ravi Kerur @ 2015-12-21 23:11 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-02-28 20:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21 23:11 [PATCH v1] Modify and modularize l3fwd code Ravi Kerur
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   ` [PATCH v2 1/1] examples/l3fwd: modify " Piotr Azarewicz
2016-02-18  9:08     ` [PATCH v3 " Piotr Azarewicz
2016-02-24 13:16       ` Thomas Monjalon
2016-02-24 14:15         ` Azarewicz, PiotrX T
2016-02-25 10:24       ` [PATCH v4 " Piotr Azarewicz
2016-02-28 20:50         ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.