DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Iremonger, Bernard" <bernard.iremonger@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP parameters
Date: Mon, 18 Jun 2018 12:31:05 -0700	[thread overview]
Message-ID: <20180618123105.10bed42d@xeon-e3> (raw)
In-Reply-To: <8CEF83825BEC744B83065625E567D7C260CB34E5@IRSMSX108.ger.corp.intel.com>

On Thu, 14 Jun 2018 10:30:21 +0000
"Iremonger, Bernard" <bernard.iremonger@intel.com> wrote:

> Hi Stephen,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen
> > Hemminger
> > Sent: Monday, June 11, 2018 7:25 PM
> > To: dev@dpdk.org
> > Cc: Stephen Hemminger <stephen@networkplumber.org>
> > Subject: [dpdk-dev] [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP
> > parameters
> > 
> > Allow user to override the hard coded IP address and UDP port values in Tx
> > only test.
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >  app/test-pmd/parameters.c             | 49 +++++++++++++++++++++++++++
> >  app/test-pmd/testpmd.h                |  6 ++++
> >  app/test-pmd/txonly.c                 | 16 ++++-----
> >  doc/guides/testpmd_app_ug/run_app.rst |  9 +++++
> >  4 files changed, 72 insertions(+), 8 deletions(-)
> > 
> > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index
> > 75807623c719..6d666e088fd9 100644
> > --- a/app/test-pmd/parameters.c
> > +++ b/app/test-pmd/parameters.c
> > @@ -19,6 +19,7 @@
> >  #include <stdint.h>
> >  #include <unistd.h>
> >  #include <inttypes.h>
> > +#include <arpa/inet.h>
> > 
> >  #include <rte_common.h>
> >  #include <rte_byteorder.h>
> > @@ -65,6 +66,7 @@ usage(char* progname)
> >  #ifdef RTE_LIBRTE_CMDLINE
> >  	       "--eth-peers-configfile= | "
> >  	       "--eth-peer=X,M:M:M:M:M:M | "
> > +	       "--tx-ip=SRC,DST | --tx-udp=PORT | "
> >  #endif
> >  	       "--pkt-filter-mode= |"
> >  	       "--rss-ip | --rss-udp | "
> > @@ -625,6 +627,8 @@ launch_args_parse(int argc, char** argv)
> >  		{ "vxlan-gpe-port",		1, 0, 0 },
> >  		{ "mlockall",			0, 0, 0 },
> >  		{ "no-mlockall",		0, 0, 0 },
> > +		{ "tx-ip",			1, 0, 0 },
> > +		{ "tx-udp",			1, 0, 0 },
> >  		{ 0, 0, 0, 0 },
> >  	};
> > 
> > @@ -717,6 +721,51 @@ launch_args_parse(int argc, char** argv)
> >  				nb_peer_eth_addrs++;
> >  			}
> >  #endif
> > +			if (!strcmp(lgopts[opt_idx].name, "tx-ip")) {
> > +				struct in_addr in;
> > +				char *end;
> > +
> > +				end = strchr(optarg, ',');
> > +				if (end == optarg || !end)
> > +					rte_exit(EXIT_FAILURE,
> > +						 "Invalid tx-ip: %s", optarg);
> > +
> > +				*end++ = 0;
> > +				if (inet_aton(optarg, &in) == 0)
> > +					rte_exit(EXIT_FAILURE,
> > +						 "Invalid source IP address:
> > %s\n", optarg);  
> 
> Line over 80 characters should be fixed.
> 
> > +				tx_ip_src_addr =
> > rte_be_to_cpu_32(in.s_addr);
> > +
> > +				if (inet_aton(end, &in) == 0)
> > +					rte_exit(EXIT_FAILURE,
> > +						 "Invalid destination IP
> > address: %s\n", optarg);  
> 
> Line over 80 characters should be fixed.
> 
> > +				tx_ip_dst_addr =
> > rte_be_to_cpu_32(in.s_addr);
> > +			}
> > +			if (!strcmp(lgopts[opt_idx].name, "tx-udp")) {
> > +				char *end = NULL;
> > +
> > +				errno = 0;
> > +				n = strtoul(optarg, &end, 10);
> > +				if (errno != 0 || end == optarg || n >
> > UINT16_MAX ||  
> 
> Line over 80 characters should be fixed.

I don't want to get into major code restructuring, just to deal with existing parsing.
The 80 limit is really too small.

  reply	other threads:[~2018-06-18 19:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 18:25 [dpdk-dev] [PATCH v2 0/2] testpmd: allow configure of Tx IP parameters Stephen Hemminger
2018-06-11 18:25 ` [dpdk-dev] [PATCH v2 1/2] testpmd: use RFC values for Tx address and port Stephen Hemminger
2018-06-14 10:17   ` Iremonger, Bernard
2018-06-14 15:56     ` Stephen Hemminger
2018-06-11 18:25 ` [dpdk-dev] [PATCH v2 2/2] testpmd: add ability to set tx IP and UDP parameters Stephen Hemminger
2018-06-14 10:30   ` Iremonger, Bernard
2018-06-18 19:31     ` Stephen Hemminger [this message]
2018-06-18 19:29   ` Stephen Hemminger

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=20180618123105.10bed42d@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    /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).