From: Hiroshi Shimamoto
Introduce memnic-tester which benchmarks MEMNIC PMD performance in guest.
It starts with two threads, one thread produces and consumes packets,
other thread receives packets and directly transmits the received
packets. This evaluates MEMNIC PMD running cost.
The master thread does rx_burst and tx_burst through MEMNIC PMD.
+-+
| master |
+-+
rx_burst ^ | tx_burst
| V
+--+--+
| up | down | MEMNIC shared memory
+--+--+
set flag ^ | unset flag
| V
+-+
| slave |
+-+
The slave thread emulates packet-in/out by setting flag on/off.
master |<- put packets ->| |<- get packets ->|
slave | |<- rx packets ->|<- tx packets ->| |
|<- set ->|
Measuring how many sets in the certain period, that represents
the MEMNIC PMD performance. The master workload must be very low.
It shows that throughputs in different frame size.
64, 128, 256, 512, 1024, 1280, 1518
Signed-off-by: Hiroshi Shimamoto
Reviewed-by: Hayato Momma
---
guest/Makefile| 20
guest/README.rst | 94 +
guest/memnic-tester.c | 281 ++
3 files changed, 395 insertions(+)
create mode 100644 guest/Makefile
create mode 100644 guest/README.rst
create mode 100644 guest/memnic-tester.c
diff --git a/guest/Makefile b/guest/Makefile
new file mode 100644
index 000..3c90350
--- /dev/null
+++ b/guest/Makefile
@@ -0,0 +1,20 @@
+ifeq ($(RTE_SDK),)
+$(error "Please define RTE_SDK environment variable")
+endif
+
+# Default target, can be overriden by command line or environment
+ifeq ($(RTE_TARGET),)
+$(error "Please define RTE_TARGET environment variable")
+endif
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+COMMON_INC_OPT = -I $(PWD)/../common
+
+APP = memnic-tester
+
+CFLAGS += -Wall -g -O3 $(COMMON_INC_OPT)
+
+SRCS-y := memnic-tester.c
+
+include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/guest/README.rst b/guest/README.rst
new file mode 100644
index 000..760014e
--- /dev/null
+++ b/guest/README.rst
@@ -0,0 +1,94 @@
+.. Copyright 2014 NEC
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+MEMNIC TESTER
+=
+
+DESCRIPTION
+---
+
+It is a simple benchmark test of MEMNIC PMD in guest.
+
+It have two threads, one thread produces and consumes packets,
+other thread receives packets and directly transmits the received
+packets back in MEMNIC interface. This evaluates MEMNIC PMD running cost.
+
+The master thread does rx_burst and tx_burst through MEMNIC PMD.
++-+
+| master |
++-+
+ rx_burst ^ | tx_burst
+ | V
+ +--+--+
+ | up | down | MEMNIC shared memory
+ +--+--+
+ set flag ^ | unset flag
+ | V
++-+
+| slave |
++-+
+The slave thread emulates packet-in/out by setting flag on/off.
+
+Measuring how many sets in the certain period, that represents
+the MEMNIC PMD performance. The master workload must be very low.
+
+ master |<- put packets ->| |<- get packets ->|
+ slave | |<- rx packets ->|<- tx packets ->| |
+|<- set ->|
+
+Like RFC2544, evaluations are performed the below frame size packets.
+ 64, 128, 256, 512, 1024, 1280, 1518
+
+It shows the result as packets per second number of each frame size.
+
+HOW TO BUILD
+
+
+DPDK and DPDK MEMNIC PMD must be built first like below::
+
+ cd