From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jasvinder.singh@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 6F38F1B1C0
 for <dev@dpdk.org>; Tue, 19 Sep 2017 17:06:56 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 19 Sep 2017 08:04:44 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.42,418,1500966000"; d="scan'208";a="1196790379"
Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155])
 by fmsmga001.fm.intel.com with ESMTP; 19 Sep 2017 08:04:43 -0700
Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by
 IRSMSX102.ger.corp.intel.com ([169.254.2.180]) with mapi id 14.03.0319.002;
 Tue, 19 Sep 2017 16:04:42 +0100
From: "Singh, Jasvinder" <jasvinder.singh@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>
CC: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>, "Wu, Jingjing"
 <jingjing.wu@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management
 forwarding mode
Thread-Index: AQHTLU5scVI7oTqvrESwLa0kqWiOj6K6n90AgAG2O3A=
Date: Tue, 19 Sep 2017 15:04:42 +0000
Message-ID: <54CBAA185211B4429112C315DA58FF6D33254AFA@IRSMSX103.ger.corp.intel.com>
References: <20170822170240.8059-1-jasvinder.singh@intel.com>
 <20170914115302.33995-1-jasvinder.singh@intel.com>
 <E115CCD9D858EF4F90C690B0DCB4D8976CC1EAC3@IRSMSX108.ger.corp.intel.com>
In-Reply-To: <E115CCD9D858EF4F90C690B0DCB4D8976CC1EAC3@IRSMSX108.ger.corp.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.180]
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Sep 2017 15:06:58 -0000

Hi Pablo,=20

Thanks for feedback and review.

<snip>
> >  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
> >
> > 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
> >
> >  ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> > @@ -81,6 +82,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y)
> >  LDLIBS +=3D -lrte_pmd_xenvirt
> >  endif
> >
> > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC),y)
> > +LDLIBS +=3D -lrte_pmd_softnic
> > +endif
> > +
> >  endif
> >
> >  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
>=20
> 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
> everywhere.

Ok. Will change this.

> > @@ -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;
> > +		}
> >  	}
> >  }
> >
> > 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 {
>=20
> ...
>=20
> >  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 > */
>=20
> Remove last ">".

Will remove.