[dpdk-dev] [memnic PATCH 1/7] guest: memnic-tester: PMD benchmark in guest

2014-09-25 Thread Thomas Monjalon
> > >  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.
> > 
> > Sorry, I don't really understand this diagram and the associated 
> > explanation.
> > Could you try to reword it?
> 
> sure, will make more understandable description.
> Could you please help me to do that?
> 
> The purpose of this program is measuring the performance of MEMNIC PMD itself.
> It means that we'd like to know how much the PMD takes in rx and tx API.
> The program does rx and tx in the slave thread and the PMD performance could
> be measured how much packets are handled in certain period. By the way we
> need to fill and clear MEMNIC packet buffer for enabling to work the PMD rx/tx
> in the slave thread. Then, I made the master thread which fills and clears
> MEMNIC packet buffer in the lightest way, and it should be with the least 
> jitter.
> If we generate a real packet out of VM, that may cause increasing jitter
> outside of the MEMNIC PMD, it means we will not see the precise performance
> of MEMNIC PMD itself.
> 
> Can you see the concept of this benchmark with the above?

Yes. But I think master and slave roles are confused.
I try to reword it with less words:

memnic-tester is a benchmark tool to measure performance of MEMNIC PMD itself.
The master thread forward packets with Rx and Tx bursts. 
The slave thread fills and clears packets in the lightest way. It doesn't get
packet out of VM because it would increase jitter and hide PMD performance.
Throughput (number of forwarded packets per second) is given for each frame 
size.

-- 
Thomas


[dpdk-dev] [memnic PATCH 1/7] guest: memnic-tester: PMD benchmark in guest

2014-09-24 Thread Thomas Monjalon
Hi Hiroshi,

2014-09-11 07:46, Hiroshi Shimamoto:
>  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.

Sorry, I don't really understand this diagram and the associated explanation.
Could you try to reword it?

Thanks
-- 
Thomas


[dpdk-dev] [memnic PATCH 1/7] guest: memnic-tester: PMD benchmark in guest

2014-09-11 Thread Hiroshi Shimamoto
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