[dpdk-dev] [PATCH v3 23/23] app/testpmd: rework softnic forward mode

Singh, Jasvinder jasvinder.singh at intel.com
Thu Jun 28 15:50:29 CEST 2018


< snip >

> >
> >  	p = &ports[port_id];
> >
> > -	/* Port tm flag */
> > -	if (p->softport.tm_flag == 0) {
> > -		printf("  tm not enabled on port %u (error)\n", port_id);
> > -		return;
> > -	}
> > -
> >  	/* Forward mode: tm */
> 
> Should "tm" be replaced by "softnic" in line above.
> 
> > -	if (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, "tm")) {
> > -		printf("  tm mode not enabled(error)\n");
> > +	if (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, "softnic")) {
> > +		printf("  softnicfwd mode not enabled(error)\n");
> >  		return;
> >  	}
> >
> >  	/* Set the default tm hierarchy */
> > -	p->softport.tm.default_hierarchy_enable = 1;
> > +	p->softport.default_tm_hierarchy_enable = 1;
> >  }
> >
> >  cmdline_parse_inst_t cmd_set_port_tm_hierarchy_default = { @@ -
> > 17543,15 +17540,50 @@ cmdline_read_from_file(const char *filename)
> > void
> >  prompt(void)
> >  {
> > +	int status;
> > +
> >  	/* initialize non-constant commands */
> >  	cmd_set_fwd_mode_init();
> >  	cmd_set_fwd_retry_mode_init();
> >
> > +#if defined RTE_LIBRTE_PMD_SOFTNIC
> > +	portid_t softnic_portid, pid;
> > +	uint8_t softnic_enable = 0;
> > +
> > +	if (strcmp(cur_fwd_eng->fwd_mode_name, "softnic") == 0) {
> > +		RTE_ETH_FOREACH_DEV(pid) {
> > +			struct rte_port *port = &ports[pid];
> > +			const char *driver = port->dev_info.driver_name;
> > +
> > +			if (strcmp(driver, "net_softnic") == 0) {
> > +				softnic_portid = pid;
> > +				softnic_enable = 1;
> > +				break;
> > +			}
> > +		}
> > +	}
> > +#endif
> > +
> >  	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
> >  	if (testpmd_cl == NULL)
> >  		return;
> > -	cmdline_interact(testpmd_cl);
> > -	cmdline_stdin_exit(testpmd_cl);
> > +
> > +	for (;;) {
> > +		status = cmdline_poll(testpmd_cl);
> > +		if (status < 0)
> > +			rte_panic("CLI poll error (%" PRId32 ")\n", status);
> > +		else if (status == RDLINE_EXITED) {
> > +			cmdline_stdin_exit(testpmd_cl);
> > +			rte_exit(0, "\n");
> > +		}
> > +
> > +#if defined RTE_LIBRTE_PMD_SOFTNIC
> > +
> > +	if ((softnic_enable == 1) &&
> > +		(strcmp(cur_fwd_eng->fwd_mode_name, "softnic") == 0))
> > +		rte_pmd_softnic_manage(softnic_portid);
> > +#endif
> > +	}
> >  }
> >
> <snip>
> 
> Should the testpmd help command be updated for the softnic, lines 125  to
> 1136 in cmdline.c ?
> 

There isn't anything changed in cli, so testpmd help commands should remain the same. Thanks.


More information about the dev mailing list