From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5192A0613 for ; Thu, 26 Sep 2019 15:52:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 761C01B9BF; Thu, 26 Sep 2019 15:52:26 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 6912F1B9B5 for ; Thu, 26 Sep 2019 15:52:25 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 06:52:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,552,1559545200"; d="scan'208";a="189126628" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga008.fm.intel.com with ESMTP; 26 Sep 2019 06:52:22 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.26]) by irsmsx110.ger.corp.intel.com ([169.254.15.189]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 14:51:36 +0100 From: "Iremonger, Bernard" To: "Ananyev, Konstantin" , "dev@dpdk.org" , "akhil.goyal@nxp.com" Thread-Topic: [PATCH 1/2] examples/ipsec-secgw: set default to IPsec library mode Thread-Index: AQHVXkgbsuw2/qfzOEGHDlLCKdUH8ac+FJOAgAARVPA= Date: Thu, 26 Sep 2019 13:51:35 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260DFD44C@IRSMSX108.ger.corp.intel.com> References: <1567069173-10505-1-git-send-email-bernard.iremonger@intel.com> <1567069173-10505-2-git-send-email-bernard.iremonger@intel.com> <2601191342CEEE43887BDE71AB977258019196B20C@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258019196B20C@irsmsx105.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjRmODgxNjItOTA2YS00MmYzLTk0NmEtZTYzZDdhYjg4ODBhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZTlOd09RWk5tV25LWDc2ZFVLeVwvY0w0MlRVWmJCN2hReWhoQWQwcW8wblwvd20zbW0rbGxCXC8xXC9sS2RFbXlDZFUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/2] examples/ipsec-secgw: set default to IPsec library mode 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Konstantin, > > Set the default code path to librte_ipsec mode. > > Add parameter 0 | 1 to -l option > > Check for conflicting options, -w -a -e and reassembly options are not > > supported in legacy mode. > > Show fragment table size. > > Update print_usage. > > Update the ipsec-secgw guide. > > Update the release notes. > > > > Signed-off-by: Bernard Iremonger > > --- > > doc/guides/rel_notes/release_19_11.rst | 8 ++++++ > > doc/guides/sample_app_ug/ipsec_secgw.rst | 6 +++-- > > examples/ipsec-secgw/ipsec-secgw.c | 44 ++++++++++++++++++++--- > --------- > > 3 files changed, 40 insertions(+), 18 deletions(-) > > > > diff --git a/doc/guides/rel_notes/release_19_11.rst > > b/doc/guides/rel_notes/release_19_11.rst > > index 8490d89..70143c5 100644 > > --- a/doc/guides/rel_notes/release_19_11.rst > > +++ b/doc/guides/rel_notes/release_19_11.rst > > @@ -56,6 +56,14 @@ New Features > > Also, make sure to start the actual text at the margin. > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > > > +* **Updated the IPsec Security Gateway application.** > > + > > + The ``librte_ipsec`` code path is now the default code path in > > + ``ipsec-secgw`` > > + > > + * The ``-l`` command line option has been extended to take a 0 | 1 > argument. > > + 0 enables the code path that uses legacy code. > > + 1 enables the code path that uses ``librte_ipsec``. > > > > Removed Items > > ------------- > > diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst > > b/doc/guides/sample_app_ug/ipsec_secgw.rst > > index ad2d79e..17b00c0 100644 > > --- a/doc/guides/sample_app_ug/ipsec_secgw.rst > > +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst > > @@ -92,7 +92,7 @@ The application has a number of command line > options:: > > > > ./build/ipsec-secgw [EAL options] -- > > -p PORTMASK -P -u PORTMASK -j FRAMESIZE > > - -l -w REPLAY_WINOW_SIZE -e -a > > + -l 0 -w REPLAY_WINOW_SIZE -e -a > > --config (port,queue,lcore)[,(port,queue,lcore= ] > > --single-sa SAIDX > > --rxoffload MASK @@ -120,7 +120,9 @@ Where: > > Minimum value: RTE_MBUF_DEFAULT_BUF_SIZE (2176) > > Maximum value: UINT16_MAX (65535). > > > > -* ``-l``: enables code-path that uses librte_ipsec. > > +* ``-l 0 | 1``: Default is ``librte_ipsec`` code path. > > + 0 enables the code path that uses legacy code. > > + 1 enables the code path that uses ``librte_ipsec``. > > > > * ``-w REPLAY_WINOW_SIZE``: specifies the IPsec sequence number > replay window > > size for each Security Association (available only with > > librte_ipsec diff --git a/examples/ipsec-secgw/ipsec-secgw.c > > b/examples/ipsec-secgw/ipsec-secgw.c > > index 0d1fd6a..3e4b9e0 100644 > > --- a/examples/ipsec-secgw/ipsec-secgw.c > > +++ b/examples/ipsec-secgw/ipsec-secgw.c > > @@ -188,7 +188,7 @@ static uint32_t frame_buf_size =3D > > RTE_MBUF_DEFAULT_BUF_SIZE; static uint32_t mtu_size =3D > RTE_ETHER_MTU; > > > > /* application wide librte_ipsec/SA parameters */ -struct app_sa_prm > > app_sa_prm =3D {.enable =3D 0}; > > +struct app_sa_prm app_sa_prm =3D {.enable =3D 1}; > > > > struct lcore_rx_queue { > > uint16_t port_id; > > @@ -1259,7 +1259,7 @@ print_usage(const char *prgname) > > " [-P]" > > " [-u PORTMASK]" > > " [-j FRAMESIZE]" > > - " [-l]" > > + " [-l 0 | 1]" > > " [-w REPLAY_WINDOW_SIZE]" > > " [-e]" > > " [-a]" > > @@ -1277,7 +1277,8 @@ print_usage(const char *prgname) > > " -u PORTMASK: Hexadecimal bitmask of unprotected > ports\n" > > " -j FRAMESIZE: Data buffer size, minimum (and default)\n" > > " value: RTE_MBUF_DEFAULT_BUF_SIZE\n" > > - " -l enables code-path that uses librte_ipsec\n" > > + " -l 0 enables code-path that uses the legacy code\n" > > + " -l 1 enables code-path that uses librte_ipsec\n" > > " -w REPLAY_WINDOW_SIZE specifies IPsec SQN replay > window\n" > > " size for each SA\n" > > " -e enables ESN\n" > > @@ -1418,6 +1419,7 @@ print_app_sa_prm(const struct app_sa_prm > *prm) > > printf("replay window size: %u\n", prm->window_size); > > printf("ESN: %s\n", (prm->enable_esn =3D=3D 0) ? "disabled" : > "enabled"); > > printf("SA flags: %#" PRIx64 "\n", prm->flags); > > + printf("Fragment Table size %u\n", frag_tbl_sz); > > } > > > > static int32_t > > @@ -1431,7 +1433,7 @@ parse_args(int32_t argc, char **argv) > > > > argvopt =3D argv; > > > > - while ((opt =3D getopt_long(argc, argvopt, "aelp:Pu:f:j:w:", > > + while ((opt =3D getopt_long(argc, argvopt, "aep:Pu:f:j:w:l:", > > lgopts, &option_index)) !=3D EOF) { > > > > switch (opt) { > > @@ -1483,18 +1485,28 @@ parse_args(int32_t argc, char **argv) > > printf("Custom frame buffer size %u\n", > frame_buf_size); > > break; > > case 'l': > > - app_sa_prm.enable =3D 1; > > + ret =3D parse_decimal(optarg); > > + if (ret =3D=3D -1) { > > + printf("Invalid argument l %s\n", optarg); >=20 > Just as a nit, probably a bit better: > printf("Invalid argument: \'%s\' for: \'%c\' option\n", optarg, opt); Apa= rt from > that: > Acked-by: Konstantin Ananyev > Tested-by: Konstantin Ananyev I will send a v2. Regards, Bernard