DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Singh, Jasvinder" <jasvinder.singh@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management	forwarding mode
Date: Mon, 18 Sep 2017 13:54:18 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8976CC1EAC3@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20170914115302.33995-1-jasvinder.singh@intel.com>



> -----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 <cristian.dumitrescu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Subject: [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management
> forwarding mode
> 
> 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.
> 
> In this mode, 5-level hierarchical tree of the QoS scheduler is built with 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), subport
> node(x1, level 1), pipe node(x4096, level 2), tc node(x16348, level 3), queue
> node(x65536, level 4).
> 
> 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 prioritizes
> the transmission of the received packets, and accordingly sends them on to
> the output interface.
> 
> To enable traffic management mode, following testpmd command is used;
> 
> $ ./testpmd -c c -n 4 --vdev
> 	'net_softnic0,hard_name=0000:06:00.1,soft_tm=on' -- -i
> 	--forward-mode=tm
> 
> 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/
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---
> v2 change:
> - change file name softnictm.c to tm.c
> - change forward mode name to "tm"
> - code clean up
> 
>  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 += rxonly.c
>  SRCS-y += txonly.c
>  SRCS-y += csumonly.c
>  SRCS-y += icmpecho.c
> +SRCS-y += tm.c
>  SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
> 
>  ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> @@ -81,6 +82,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y)
>  LDLIBS += -lrte_pmd_xenvirt
>  endif
> 
> +ifeq ($(CONFIG_RTE_LIBRTE_PMD_SOFTNIC),y)
> +LDLIBS += -lrte_pmd_softnic
> +endif
> +
>  endif
> 
>  CFLAGS_cmdline.o := -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[] = {
>  	&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 everywhere.

> @@ -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 = 1;
> +
> +		/* Detect softnic port */
> +		if (!strcmp(port->dev_info.driver_name, "net_softnic")) {
> +			memset(&port->softport, 0, sizeof(struct
> softnic_port));
> +				port->softport.enable = 1;
> +
> +			if (!strcmp(cur_fwd_eng->fwd_mode_name, "tm"))
> +				port->softport.tm_flag = 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 {

...

>  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 ">".

>  };
> 
>  /**

  parent reply	other threads:[~2017-09-18 13:54 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 17:02 [dpdk-dev] [PATCH " Jasvinder Singh
2017-08-22 17:02 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add CLI for tm mode Jasvinder Singh
2017-09-14 11:53 ` [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management forwarding mode Jasvinder Singh
2017-09-14 11:53   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add CLI for tm mode Jasvinder Singh
2017-09-18 14:03     ` De Lara Guarch, Pablo
2017-09-19 15:06       ` Singh, Jasvinder
2017-09-18 13:54   ` De Lara Guarch, Pablo [this message]
2017-09-19 15:04     ` [dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management forwarding mode Singh, Jasvinder
2017-09-20  9:56   ` [dpdk-dev] [PATCH v3 1/5] " Jasvinder Singh
2017-09-20  9:56     ` [dpdk-dev] [PATCH v3 2/5] app/test-pmd: add CLI for TM capability and stats Jasvinder Singh
2017-09-20  9:56     ` [dpdk-dev] [PATCH v3 3/5] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-09-20  9:56     ` [dpdk-dev] [PATCH v3 4/5] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-09-20  9:56     ` [dpdk-dev] [PATCH v3 5/5] app/test-pmd: add CLI for TM packet classification Jasvinder Singh
2017-09-22 16:35     ` [dpdk-dev] [PATCH v4 1/5] app/testpmd: add traffic management forwarding mode Jasvinder Singh
2017-09-22 16:35       ` [dpdk-dev] [PATCH v4 2/5] app/test-pmd: add CLI for TM capability and stats Jasvinder Singh
2017-09-29 12:38         ` [dpdk-dev] [PATCH v5 1/3] " Jasvinder Singh
2017-09-29 12:38           ` [dpdk-dev] [PATCH v5 2/3] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-09-29 12:38           ` [dpdk-dev] [PATCH v5 3/3] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-10-09 19:07           ` [dpdk-dev] [PATCH v6 1/3] app/test-pmd: add CLI for TM capability and stats Jasvinder Singh
2017-10-09 19:07             ` [dpdk-dev] [PATCH v6 2/3] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-10-09 19:07             ` [dpdk-dev] [PATCH v6 3/3] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-10-11  8:40               ` Pei, Yulong
2017-10-11  8:51                 ` Singh, Jasvinder
2017-10-11  9:26             ` [dpdk-dev] [PATCH v7 1/3] app/test-pmd: add CLI for TM capability and stats Jasvinder Singh
2017-10-11  9:26               ` [dpdk-dev] [PATCH v7 2/3] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-10-13  2:33                 ` Wu, Jingjing
2017-10-13  8:58                   ` Singh, Jasvinder
2017-10-11  9:26               ` [dpdk-dev] [PATCH v7 3/3] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-10-13  2:58                 ` Wu, Jingjing
2017-10-13 10:50                   ` Singh, Jasvinder
2017-10-12 20:55               ` [dpdk-dev] [PATCH v7 1/3] app/test-pmd: add CLI for TM capability and stats Thomas Monjalon
2017-10-13  2:34               ` Wu, Jingjing
2017-10-13  6:22               ` Pei, Yulong
2017-10-13 16:59               ` [dpdk-dev] [PATCH v8 " Jasvinder Singh
2017-10-13 16:59                 ` [dpdk-dev] [PATCH v8 2/3] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-10-13 17:00                 ` [dpdk-dev] [PATCH v8 3/3] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-10-14 10:20                 ` [dpdk-dev] [PATCH v9 1/3] app/test-pmd: add CLI for TM capability and stats Jasvinder Singh
2017-10-14 10:20                   ` [dpdk-dev] [PATCH v9 2/3] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-10-14 10:20                   ` [dpdk-dev] [PATCH v9 3/3] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-10-16 10:18                     ` Wu, Jingjing
2017-10-16 18:18                       ` Singh, Jasvinder
2017-10-16 18:55                   ` [dpdk-dev] [PATCH v10 1/3] app/test-pmd: add CLI for TM capability and stats Jasvinder Singh
2017-10-16 18:55                     ` [dpdk-dev] [PATCH v10 2/3] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-10-16 18:55                     ` [dpdk-dev] [PATCH v10 3/3] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-10-17  8:44                     ` [dpdk-dev] [PATCH v10 1/3] app/test-pmd: add CLI for TM capability and stats Wu, Jingjing
2017-10-20 14:08                       ` Dumitrescu, Cristian
2017-09-22 16:35       ` [dpdk-dev] [PATCH v4 3/5] app/test-pmd: add CLI for shaper and wred profiles Jasvinder Singh
2017-09-22 16:35       ` [dpdk-dev] [PATCH v4 4/5] app/test-pmd: add CLI for TM nodes and hierarchy commit Jasvinder Singh
2017-09-22 16:35       ` [dpdk-dev] [PATCH v4 5/5] app/test-pmd: add CLI for TM packet classification Jasvinder Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E115CCD9D858EF4F90C690B0DCB4D8976CC1EAC3@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=jingjing.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).