From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id C74BC1B202 for ; Thu, 19 Oct 2017 14:33:14 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 19 Oct 2017 05:33:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,401,1503385200"; d="scan'208";a="164501360" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga005.fm.intel.com with ESMTP; 19 Oct 2017 05:33:13 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Thu, 19 Oct 2017 13:33:12 +0100 From: "De Lara Guarch, Pablo" To: "Nicolau, Radu" , "dev@dpdk.org" CC: "Gonzalez Monroy, Sergio" , "Nicolau, Radu" Thread-Topic: [dpdk-dev] [PATCH] ipsec_secgw: added cmdline option for jumbo frames and switched to the new offload API. Thread-Index: AQHTSAirAwWFjFc4gUyt2MFmFV9J16LrFrHg Date: Thu, 19 Oct 2017 12:33:11 +0000 Message-ID: References: <1508327708-15090-1-git-send-email-radu.nicolau@intel.com> In-Reply-To: <1508327708-15090-1-git-send-email-radu.nicolau@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmIzYTc1OTYtZjJhNC00MWYwLWJjYTMtZmI3ZjRmZWExYjQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImdMY3BQWm9SeitlNThITGF3cnlMa284TGpQUHZJR3FrQWJDelwvM1NZMGc4PSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ipsec_secgw: added cmdline option for jumbo frames and switched to the new offload API. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 12:33:15 -0000 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 ; > Nicolau, Radu > Subject: [dpdk-dev] [PATCH] ipsec_secgw: added cmdline option for jumbo > frames and switched to the new offload API. >=20 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 th= e message. Also, add the new parameter in "print_usage()" function. > Signed-off-by: Radu Nicolau > --- > doc/guides/sample_app_ug/ipsec_secgw.rst | 6 +++++- > examples/ipsec-secgw/ipsec-secgw.c | 32 > +++++++++++++++++++++++++------- > 2 files changed, 30 insertions(+), 8 deletions(-) >=20 > 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:: >=20 >=20 > ./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: >=20 > * ``-u PORTMASK``: hexadecimal bitmask of unprotected ports >=20 > +* ``-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 whi= ch > queues > from which ports are mapped to which cores. >=20 > 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) >=20 > argvopt =3D argv; >=20 > - while ((opt =3D getopt_long(argc, argvopt, "p:Pu:f:", > + while ((opt =3D getopt_long(argc, argvopt, "p:Pu:f:j:", > lgopts, &option_index)) !=3D EOF) { >=20 > switch (opt) { > @@ -1022,6 +1021,17 @@ parse_args(int32_t argc, char **argv) > } > f_present =3D 1; > break; > + case 'j': > + { > + int32_t size =3D parse_decimal(optarg); > + if (size <=3D 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.=20 > + frame_size =3D 9000; > + } else { > + frame_size =3D 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);