DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Nicolau, Radu" <radu.nicolau@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>,
	"Nicolau, Radu" <radu.nicolau@intel.com>
Subject: Re: [dpdk-dev] [PATCH] ipsec_secgw: added cmdline option for jumbo	frames and switched to the new offload API.
Date: Thu, 19 Oct 2017 12:33:11 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8976CC36A6C@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1508327708-15090-1-git-send-email-radu.nicolau@intel.com>

Hi Radu,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Radu Nicolau
> Sent: Wednesday, October 18, 2017 12:55 PM
> To: dev@dpdk.org
> Cc: Gonzalez Monroy, Sergio <sergio.gonzalez.monroy@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>
> Subject: [dpdk-dev] [PATCH] ipsec_secgw: added cmdline option for jumbo
> frames and switched to the new offload API.
> 

The commit title is too long and partially incorrect (run check-git-log.sh script to detect this).
It should start with "examples/ipsec_secgw: " and I think part of it should go into the message.
I think something like: "examples/ipsec_secgw: support jumbo frames" would be better and
then adding the command line option and using the new API should go into the message.

Also, add the new parameter in "print_usage()" function.

> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
>  doc/guides/sample_app_ug/ipsec_secgw.rst |  6 +++++-
>  examples/ipsec-secgw/ipsec-secgw.c       | 32
> +++++++++++++++++++++++++-------
>  2 files changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst
> b/doc/guides/sample_app_ug/ipsec_secgw.rst
> index b675cba..dd9bad2 100644
> --- a/doc/guides/sample_app_ug/ipsec_secgw.rst
> +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst
> @@ -119,7 +119,7 @@ The application has a number of command line
> options::
> 
> 
>     ./build/ipsec-secgw [EAL options] --
> -                        -p PORTMASK -P -u PORTMASK
> +                        -p PORTMASK -P -u PORTMASK -j FRAMESIZE
>                          --config (port,queue,lcore)[,(port,queue,lcore]
>                          --single-sa SAIDX
>                          -f CONFIG_FILE_PATH @@ -135,6 +135,10 @@ Where:
> 
>  *   ``-u PORTMASK``: hexadecimal bitmask of unprotected ports
> 
> +*   ``-j FRAMESIZE``: *optional*. Enables jumbo frames with the maximum
> size
> +    specified as FRAMESIZE. If FRAMESIZE is missing or invalid a default
> value
> +    of 9000 is used.

When running the app with just "-j", it says:
option requires an argument -- 'j'

So, FRAMESIZE is mandatory, right?

> +
>  *   ``--config (port,queue,lcore)[,(port,queue,lcore)]``: determines which
> queues
>      from which ports are mapped to which cores.
> 
> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-
> secgw/ipsec-secgw.c
> index d451b3d..a7e4bd1 100644
> --- a/examples/ipsec-secgw/ipsec-secgw.c
> +++ b/examples/ipsec-secgw/ipsec-secgw.c

...

> @@ -983,7 +982,7 @@ parse_args(int32_t argc, char **argv)
> 
>  	argvopt = argv;
> 
> -	while ((opt = getopt_long(argc, argvopt, "p:Pu:f:",
> +	while ((opt = getopt_long(argc, argvopt, "p:Pu:f:j:",
>  				lgopts, &option_index)) != EOF) {
> 
>  		switch (opt) {
> @@ -1022,6 +1021,17 @@ parse_args(int32_t argc, char **argv)
>  			}
>  			f_present = 1;
>  			break;
> +		case 'j':
> +			{
> +			int32_t size = parse_decimal(optarg);
> +				if (size <= 0) {
> +					printf("Invalid jumbo frame size\n");

Since you are not exiting the app due to this invalid size,
and your defaulting to 9000 instead, I would add a notification
to the user that Frame size is defaulting to 9000. 
> +					frame_size = 9000;
> +				} else {
> +					frame_size = size;
> +				}

Should it check for a minimum (1518?) or a maximum size?

> +			}
> +			printf("Enabled jumbo frames size %d\n",
> frame_size);

Use %u instead of %d, as it is an unsigned int variable.

>  		case 0:
>  			if (parse_args_long_options(lgopts, option_index)) {
>  				print_usage(prgname);

  reply	other threads:[~2017-10-19 12:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 11:55 Radu Nicolau
2017-10-19 12:33 ` De Lara Guarch, Pablo [this message]
2017-10-19 15:26 ` [dpdk-dev] [PATCH v2] examples/ipsec_secgw: support jumbo frames Radu Nicolau
2017-10-19 15:40   ` De Lara Guarch, Pablo
2017-10-19 15:42     ` Nicolau, Radu
2017-10-19 15:58   ` [dpdk-dev] [PATCH v3] " Radu Nicolau
2017-10-19 16:15     ` Aviad Yehezkel
2017-10-20  9:28     ` [dpdk-dev] [PATCH v4] examples/ipsec_secgw: added jumbo frames support Radu Nicolau
2017-10-20  9:30     ` [dpdk-dev] [PATCH v4 1/2] examples/ipsec_secgw: switched to new offload API Radu Nicolau
2017-10-20  9:30       ` [dpdk-dev] [PATCH v4 2/2] examples/ipsec_secgw: added jumbo frames support Radu Nicolau
2017-10-20 10:28         ` De Lara Guarch, Pablo
2017-10-20 10:27       ` [dpdk-dev] [PATCH v4 1/2] examples/ipsec_secgw: switched to new offload API De Lara Guarch, Pablo
2017-10-20 15:52       ` De Lara Guarch, Pablo

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=E115CCD9D858EF4F90C690B0DCB4D8976CC36A6C@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    --cc=radu.nicolau@intel.com \
    --cc=sergio.gonzalez.monroy@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).