[dpdk-dev] [PATCH v2 1/2] app/testpmd: add traffic management forwarding mode
Singh, Jasvinder
jasvinder.singh at intel.com
Tue Sep 19 17:04:42 CEST 2017
Hi Pablo,
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 += 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.
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 = 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 ">".
Will remove.
More information about the dev
mailing list