From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id DDF331B027 for ; Mon, 18 Sep 2017 15:54:21 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 18 Sep 2017 06:54:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,413,1500966000"; d="scan'208";a="1220314806" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga002.fm.intel.com with ESMTP; 18 Sep 2017 06:54:20 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX106.ger.corp.intel.com ([169.254.8.36]) with mapi id 14.03.0319.002; Mon, 18 Sep 2017 14:54:19 +0100 From: "De Lara Guarch, Pablo" To: "Singh, Jasvinder" , "dev@dpdk.org" CC: "Dumitrescu, Cristian" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management forwarding mode Thread-Index: AQHTLU5zAW9Nt1FP3kCQvhigpzv1CqK6ruCg Date: Mon, 18 Sep 2017 13:54:18 +0000 Message-ID: References: <20170822170240.8059-1-jasvinder.singh@intel.com> <20170914115302.33995-1-jasvinder.singh@intel.com> In-Reply-To: <20170914115302.33995-1-jasvinder.singh@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTE3NWRiMTctZjlkOC00MGQ5LThmNGMtOGU0ZTBjM2UyZTE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNi41LjkuMyIsIlRydXN0ZWRMYWJlbEhhc2giOiJrelc5dXB5dEtIY1ZZcmtWXC9ocW9tWjJucGJSQzIyanRJcmFtSWIybG4xUT0ifQ== x-ctpclassification: CTP_PUBLIC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management forwarding mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2017 13:54:22 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jasvinder Singh > Sent: Thursday, September 14, 2017 12:53 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian ; Wu, Jingjing > > Subject: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management > forwarding mode >=20 > This commit extends the testpmd application with new forwarding engine > that demonstrates the use of ethdev traffic management APIs and softnic > PMD for QoS traffic management. >=20 > In this mode, 5-level hierarchical tree of the QoS scheduler is built wit= h the > help of ethdev TM APIs such as shaper profile add/delete, shared shaper > add/update, node add/delete, hierarchy commit, etc. > The hierarchical tree has following nodes; root node(x1, level 0), subpor= t > node(x1, level 1), pipe node(x4096, level 2), tc node(x16348, level 3), q= ueue > node(x65536, level 4). >=20 > During runtime, each received packet is first classified by mapping the > packet fields information to 5-tuples (HQoS subport, pipe, traffic class, > queue within traffic class, and color) and storing it in the packet mbuf = sched > field. After classification, each packet is sent to softnic port which pr= ioritizes > the transmission of the received packets, and accordingly sends them on t= o > the output interface. >=20 > To enable traffic management mode, following testpmd command is used; >=20 > $ ./testpmd -c c -n 4 --vdev > 'net_softnic0,hard_name=3D0000:06:00.1,soft_tm=3Don' -- -i > --forward-mode=3Dtm >=20 > This patchset has dependency on following patch series; > http://www.dpdk.org/dev/patchwork/patch/27517/ > http://www.dpdk.org/dev/patchwork/patch/27518/ > http://www.dpdk.org/dev/patchwork/patch/27519/ > http://www.dpdk.org/dev/patchwork/patch/27520/ >=20 > Signed-off-by: Jasvinder Singh > --- > v2 change: > - change file name softnictm.c to tm.c > - change forward mode name to "tm" > - code clean up >=20 > app/test-pmd/Makefile | 5 + > app/test-pmd/testpmd.c | 11 + > app/test-pmd/testpmd.h | 34 ++ > app/test-pmd/tm.c | 863 > +++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 913 insertions(+) > create mode 100644 app/test-pmd/tm.c >=20 > diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index > c36be19..925787f 100644 > --- a/app/test-pmd/Makefile > +++ b/app/test-pmd/Makefile > @@ -57,6 +57,7 @@ SRCS-y +=3D rxonly.c > SRCS-y +=3D txonly.c > SRCS-y +=3D csumonly.c > SRCS-y +=3D icmpecho.c > +SRCS-y +=3D tm.c > SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) +=3D ieee1588fwd.c >=20 > ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) > @@ -81,6 +82,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) > LDLIBS +=3D -lrte_pmd_xenvirt > endif >=20 > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC),y) > +LDLIBS +=3D -lrte_pmd_softnic > +endif > + > endif >=20 > CFLAGS_cmdline.o :=3D -D_GNU_SOURCE > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 7d40139..996e982 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -167,6 +167,8 @@ struct fwd_engine * fwd_engines[] =3D { > &tx_only_engine, > &csum_fwd_engine, > &icmp_echo_engine, > + &softnic_tm_engine, > + &softnic_tm_bypass_engine, > #ifdef RTE_LIBRTE_IEEE1588 > &ieee1588_fwd_engine, > #endif If SCHED library is not set, I think these two modes should be disabled. You can introduce the TM_MODE flag in testpmd.h, so you can use it everywhe= re. > @@ -2044,6 +2046,15 @@ init_port_config(void) > (rte_eth_devices[pid].data->dev_flags & > RTE_ETH_DEV_INTR_RMV)) > port->dev_conf.intr_conf.rmv =3D 1; > + > + /* Detect softnic port */ > + if (!strcmp(port->dev_info.driver_name, "net_softnic")) { > + memset(&port->softport, 0, sizeof(struct > softnic_port)); > + port->softport.enable =3D 1; > + > + if (!strcmp(cur_fwd_eng->fwd_mode_name, "tm")) > + port->softport.tm_flag =3D 1; > + } > } > } >=20 > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > c9d7739..c8fa180 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -163,6 +163,37 @@ struct port_flow { ... > struct rte_port { > @@ -195,6 +226,7 @@ struct rte_port { > uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool > */ > uint8_t slave_flag; /**< bonding slave port */ > struct port_flow *flow_list; /**< Associated flows. */ > + struct softnic_port softport; /**< softnic port params > */ Remove last ">". > }; >=20 > /**