From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 51AE5B494 for ; Wed, 18 Feb 2015 14:41:59 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 18 Feb 2015 05:36:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,512,1418112000"; d="scan'208";a="529240354" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga003.jf.intel.com with ESMTP; 18 Feb 2015 05:33:19 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.218]) by IRSMSX106.ger.corp.intel.com ([169.254.8.235]) with mapi id 14.03.0195.001; Wed, 18 Feb 2015 13:41:55 +0000 From: "De Lara Guarch, Pablo" To: "Wodkowski, PawelX" , "dev@dpdk.org" Thread-Topic: [PATCH v4 2/2] examples: introduce new l2fwd-headroom example Thread-Index: AQHQStFR50rITN2ghkyr3W40wNd5xZz2ah4g Date: Wed, 18 Feb 2015 13:41:54 +0000 Message-ID: References: <1424189986-26219-1-git-send-email-pawelx.wodkowski@intel.com> <1424191340-26451-1-git-send-email-pawelx.wodkowski@intel.com> <1424191340-26451-3-git-send-email-pawelx.wodkowski@intel.com> In-Reply-To: <1424191340-26451-3-git-send-email-pawelx.wodkowski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 2/2] examples: introduce new l2fwd-headroom example X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2015 13:42:00 -0000 Hi Pawel, A few things to fix: > -----Original Message----- > From: Wodkowski, PawelX > Sent: Tuesday, February 17, 2015 4:42 PM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo > Subject: [PATCH v4 2/2] examples: introduce new l2fwd-headroom example >=20 > This app demonstrate usage of new headroom library. > It is basicaly orginal l2fwd with following modificantions to met Typo: Basically the original, modifications > headroom library requirements: > - main_loop() was split into two jobs: forward job and flush job. Logic > for those jobs is almost the same as in orginal application. original > - stats is moved to rte_alarm callbac to not introduce overhead of callback > printing. > - stats are expanded to show headroom statistics. > - added new parameter '-l' to automatic thousands separator. >=20 > Comparing orginal l2fwd and l2fwd-headroom apps will show approach what original > is needed to properly write own application with headroom measurements. >=20 > New available statistics: > - Total and % of fwd and flush execution time > - management time - overhead of rte_timer + overhead of headroom library > - Idle time and % of time spent waiting for fwd or flush to be ready to > execute. > - per job execution time and period. >=20 >=20 > Signed-off-by: Pawel Wodkowski > --- > examples/Makefile | 1 + > examples/l2fwd-headroom/Makefile | 51 ++ > examples/l2fwd-headroom/main.c | 1039 > ++++++++++++++++++++++++++++++++++++++ > mk/rte.app.mk | 4 + > 4 files changed, 1095 insertions(+) > create mode 100644 examples/l2fwd-headroom/Makefile > create mode 100644 examples/l2fwd-headroom/main.c >=20 > diff --git a/examples/Makefile b/examples/Makefile > index 81f1d2f..8a459b7 100644 > --- a/examples/Makefile > +++ b/examples/Makefile > @@ -50,6 +50,7 @@ DIRS-$(CONFIG_RTE_MBUF_REFCNT) +=3D > ip_fragmentation > DIRS-$(CONFIG_RTE_MBUF_REFCNT) +=3D ipv4_multicast > DIRS-$(CONFIG_RTE_LIBRTE_KNI) +=3D kni > DIRS-y +=3D l2fwd > +DIRS-y +=3D l2fwd-headroom > DIRS-$(CONFIG_RTE_LIBRTE_IVSHMEM) +=3D l2fwd-ivshmem > DIRS-y +=3D l3fwd > DIRS-$(CONFIG_RTE_LIBRTE_ACL) +=3D l3fwd-acl > diff --git a/examples/l2fwd-headroom/Makefile b/examples/l2fwd- > headroom/Makefile > new file mode 100644 > index 0000000..07da286 > --- /dev/null > +++ b/examples/l2fwd-headroom/Makefile > @@ -0,0 +1,51 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# 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 copyrigh= t > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# 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. > + > +ifeq ($(RTE_SDK),) > +$(error "Please define RTE_SDK environment variable") > +endif > + > +# Default target, can be overriden by command line or environment overridden > +RTE_TARGET ?=3D x86_64-native-linuxapp-gcc > + > +include $(RTE_SDK)/mk/rte.vars.mk > + > +# binary name > +APP =3D l2fwd-headroom > + > +# all source are stored in SRCS-y > +SRCS-y :=3D main.c > + > + > +CFLAGS +=3D -O3 > +CFLAGS +=3D $(WERROR_FLAGS) > + > +include $(RTE_SDK)/mk/rte.extapp.mk > diff --git a/examples/l2fwd-headroom/main.c b/examples/l2fwd- > headroom/main.c [...] > + if (qconf->n_rx_port > 0) { > + job =3D &qconf->flush_job; > + printf("\n\nJob %" PRIu32 ": %-20s " > + "\n%-18s %'14" PRIu64 > + "\n%-18s %'14.0f" > + STAT_FMT, > + i, job->name, > + "Exec count:", flush_exec_cnt, > + "Exec period: ", cycles_to_ns(flush_period), > + "Exec time", > + cycles_to_ns(flush_exec), flush_exec * 100.0 > / stats_period , Remove space before last comma. > + cycles_to_ns(flush_exec_cnt ? flush_exec / > flush_exec_cnt : 0), > + cycles_to_ns(flush_exec_min), > + cycles_to_ns(flush_exec_max)); > + } > +} > +