From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B18CAA0353;
	Mon, 11 Nov 2019 00:11:32 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 1C9F3E07;
	Mon, 11 Nov 2019 00:11:32 +0100 (CET)
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id B9258235
 for <dev@dpdk.org>; Mon, 11 Nov 2019 00:11:30 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 10 Nov 2019 15:11:29 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.68,290,1569308400"; d="scan'208";a="228765993"
Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66])
 by fmsmga004.fm.intel.com with ESMTP; 10 Nov 2019 15:11:27 -0800
Received: from irsmsx104.ger.corp.intel.com ([169.254.5.252]) by
 IRSMSX152.ger.corp.intel.com ([169.254.6.76]) with mapi id 14.03.0439.000;
 Sun, 10 Nov 2019 23:11:25 +0000
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Dekel Peled <dekelp@mellanox.com>, "Mcnamara, John"
 <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
 "nhorman@tuxdriver.com" <nhorman@tuxdriver.com>, "ajit.khaparde@broadcom.com"
 <ajit.khaparde@broadcom.com>, "somnath.kotur@broadcom.com"
 <somnath.kotur@broadcom.com>, "Burakov, Anatoly" <anatoly.burakov@intel.com>, 
 "xuanziyang2@huawei.com" <xuanziyang2@huawei.com>,
 "cloud.wangxiaoyun@huawei.com" <cloud.wangxiaoyun@huawei.com>,
 "zhouguoyang@huawei.com" <zhouguoyang@huawei.com>, "Lu, Wenzhuo"
 <wenzhuo.lu@intel.com>, "matan@mellanox.com" <matan@mellanox.com>,
 "shahafs@mellanox.com" <shahafs@mellanox.com>, "viacheslavo@mellanox.com"
 <viacheslavo@mellanox.com>, "rmody@marvell.com" <rmody@marvell.com>,
 "shshaikh@marvell.com" <shshaikh@marvell.com>, "maxime.coquelin@redhat.com"
 <maxime.coquelin@redhat.com>, "Bie, Tiwei" <tiwei.bie@intel.com>, "Wang,
 Zhihong" <zhihong.wang@intel.com>, "yongwang@vmware.com"
 <yongwang@vmware.com>, "thomas@monjalon.net" <thomas@monjalon.net>, "Yigit,
 Ferruh" <ferruh.yigit@intel.com>, "arybchenko@solarflare.com"
 <arybchenko@solarflare.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
 "Iremonger, Bernard" <bernard.iremonger@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v5 3/3] app/testpmd: use API to set max LRO packet size
Thread-Index: AQHVllPT2I/ipvGLSk+LH7XruIg6y6eFCq0Q
Date: Sun, 10 Nov 2019 23:11:25 +0000
Message-ID: <2601191342CEEE43887BDE71AB97725801A8C8579F@IRSMSX104.ger.corp.intel.com>
References: <cover.1573129825.git.dekelp@mellanox.com>
 <cover.1573231010.git.dekelp@mellanox.com>
 <bc417e5e77234be5bde30a75b24fe89d40e37f67.1573231011.git.dekelp@mellanox.com>
In-Reply-To: <bc417e5e77234be5bde30a75b24fe89d40e37f67.1573231011.git.dekelp@mellanox.com>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzg1NThhNTAtMGI1NC00NTFmLTk3ZDItZDUyZmUyMThjYTZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTHFGbFlGcmxSS2dvQ09FVXgxeXR0T09DOFppNEppUk53MU15dGZSd3RYVVk3VUVqVEJtOWhwamd2ZUtOc1BjSSJ9
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.2.0.6
dlp-reaction: no-action
x-originating-ip: [163.33.239.181]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v5 3/3] app/testpmd: use API to set max LRO
	packet size
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>


>=20
> This patch implements use of the API for LRO aggregated packet
> max size.
> It adds command-line and runtime commands to configure this value,
> and adds option to show the supported value.
> Documentation is updated accordingly.
>=20
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  app/test-pmd/cmdline.c                      | 76 +++++++++++++++++++++++=
++++++
>  app/test-pmd/config.c                       |  2 +
>  app/test-pmd/parameters.c                   |  7 +++
>  app/test-pmd/testpmd.c                      |  1 +
>  doc/guides/testpmd_app_ug/run_app.rst       |  5 ++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  9 ++++
>  6 files changed, 100 insertions(+)
>=20
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 78c6899..2206a70 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -777,6 +777,9 @@ static void cmd_help_long_parsed(void *parsed_result,
>  			"port config all max-pkt-len (value)\n"
>  			"    Set the max packet length.\n\n"
>=20
> +			"port config all max-lro-pkt-size (value)\n"
> +			"    Set the max LRO aggregated packet size.\n\n"
> +
>  			"port config all drop-en (on|off)\n"
>  			"    Enable or disable packet drop on all RX queues of all ports when=
 no "
>  			"receive buffers available.\n\n"
> @@ -2040,6 +2043,78 @@ struct cmd_config_max_pkt_len_result {
>  	},
>  };
>=20
> +/* *** config max LRO aggregated packet size *** */
> +struct cmd_config_max_lro_pkt_size_result {
> +	cmdline_fixed_string_t port;
> +	cmdline_fixed_string_t keyword;
> +	cmdline_fixed_string_t all;
> +	cmdline_fixed_string_t name;
> +	uint32_t value;
> +};
> +
> +static void
> +cmd_config_max_lro_pkt_size_parsed(void *parsed_result,
> +				__attribute__((unused)) struct cmdline *cl,
> +				__attribute__((unused)) void *data)
> +{
> +	struct cmd_config_max_lro_pkt_size_result *res =3D parsed_result;
> +	portid_t pid;
> +
> +	if (!all_ports_stopped()) {
> +		printf("Please stop all ports first\n");
> +		return;
> +	}
> +
> +	RTE_ETH_FOREACH_DEV(pid) {
> +		struct rte_port *port =3D &ports[pid];
> +
> +		if (!strcmp(res->name, "max-lro-pkt-size")) {
> +			if (res->value =3D=3D
> +					port->dev_conf.rxmode.max_lro_pkt_size)
> +				return;
> +
> +			port->dev_conf.rxmode.max_lro_pkt_size =3D res->value;
> +		} else {
> +			printf("Unknown parameter\n");
> +			return;
> +		}
> +	}
> +
> +	init_port_config();
> +
> +	cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
> +}
> +
> +cmdline_parse_token_string_t cmd_config_max_lro_pkt_size_port =3D
> +	TOKEN_STRING_INITIALIZER(struct cmd_config_max_lro_pkt_size_result,
> +				 port, "port");
> +cmdline_parse_token_string_t cmd_config_max_lro_pkt_size_keyword =3D
> +	TOKEN_STRING_INITIALIZER(struct cmd_config_max_lro_pkt_size_result,
> +				 keyword, "config");
> +cmdline_parse_token_string_t cmd_config_max_lro_pkt_size_all =3D
> +	TOKEN_STRING_INITIALIZER(struct cmd_config_max_lro_pkt_size_result,
> +				 all, "all");
> +cmdline_parse_token_string_t cmd_config_max_lro_pkt_size_name =3D
> +	TOKEN_STRING_INITIALIZER(struct cmd_config_max_lro_pkt_size_result,
> +				 name, "max-lro-pkt-size");
> +cmdline_parse_token_num_t cmd_config_max_lro_pkt_size_value =3D
> +	TOKEN_NUM_INITIALIZER(struct cmd_config_max_lro_pkt_size_result,
> +			      value, UINT32);
> +
> +cmdline_parse_inst_t cmd_config_max_lro_pkt_size =3D {
> +	.f =3D cmd_config_max_lro_pkt_size_parsed,
> +	.data =3D NULL,
> +	.help_str =3D "port config all max-lro-pkt-size <value>",
> +	.tokens =3D {
> +		(void *)&cmd_config_max_lro_pkt_size_port,
> +		(void *)&cmd_config_max_lro_pkt_size_keyword,
> +		(void *)&cmd_config_max_lro_pkt_size_all,
> +		(void *)&cmd_config_max_lro_pkt_size_name,
> +		(void *)&cmd_config_max_lro_pkt_size_value,
> +		NULL,
> +	},
> +};
> +
>  /* *** configure port MTU *** */
>  struct cmd_config_mtu_result {
>  	cmdline_fixed_string_t port;
> @@ -19124,6 +19199,7 @@ struct cmd_show_rx_tx_desc_status_result {
>  	(cmdline_parse_inst_t *)&cmd_config_rx_tx,
>  	(cmdline_parse_inst_t *)&cmd_config_mtu,
>  	(cmdline_parse_inst_t *)&cmd_config_max_pkt_len,
> +	(cmdline_parse_inst_t *)&cmd_config_max_lro_pkt_size,
>  	(cmdline_parse_inst_t *)&cmd_config_rx_mode_flag,
>  	(cmdline_parse_inst_t *)&cmd_config_rss,
>  	(cmdline_parse_inst_t *)&cmd_config_rxtx_ring_size,
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index b603974..e1e5cf7 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -616,6 +616,8 @@ static int bus_match_all(const struct rte_bus *bus, c=
onst void *data)
>  	printf("Minimum size of RX buffer: %u\n", dev_info.min_rx_bufsize);
>  	printf("Maximum configurable length of RX packet: %u\n",
>  		dev_info.max_rx_pktlen);
> +	printf("Maximum configurable size of LRO aggregated packet: %u\n",
> +		dev_info.max_lro_pkt_size);
>  	if (dev_info.max_vfs)
>  		printf("Maximum number of VFs: %u\n", dev_info.max_vfs);
>  	if (dev_info.max_vmdq_pools)
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 9ea87c1..eda395b 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -107,6 +107,8 @@
>  	printf("  --total-num-mbufs=3DN: set the number of mbufs to be allocate=
d "
>  	       "in mbuf pools.\n");
>  	printf("  --max-pkt-len=3DN: set the maximum size of packet to N bytes.=
\n");
> +	printf("  --max-lro-pkt-size=3DN: set the maximum LRO aggregated packet=
 "
> +	       "size to N bytes.\n");
>  #ifdef RTE_LIBRTE_CMDLINE
>  	printf("  --eth-peers-configfile=3Dname: config file with ethernet addr=
esses "
>  	       "of peer ports.\n");
> @@ -592,6 +594,7 @@
>  		{ "mbuf-size",			1, 0, 0 },
>  		{ "total-num-mbufs",		1, 0, 0 },
>  		{ "max-pkt-len",		1, 0, 0 },
> +		{ "max-lro-pkt-size",		1, 0, 0 },
>  		{ "pkt-filter-mode",            1, 0, 0 },
>  		{ "pkt-filter-report-hash",     1, 0, 0 },
>  		{ "pkt-filter-size",            1, 0, 0 },
> @@ -888,6 +891,10 @@
>  						 "Invalid max-pkt-len=3D%d - should be > %d\n",
>  						 n, RTE_ETHER_MIN_LEN);
>  			}
> +			if (!strcmp(lgopts[opt_idx].name, "max-lro-pkt-size")) {
> +				n =3D atoi(optarg);
> +				rx_mode.max_lro_pkt_size =3D (uint32_t) n;
> +			}
>  			if (!strcmp(lgopts[opt_idx].name, "pkt-filter-mode")) {
>  				if (!strcmp(optarg, "signature"))
>  					fdir_conf.mode =3D
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 5ba9741..3fe694f 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -419,6 +419,7 @@ struct fwd_engine * fwd_engines[] =3D {
>  struct rte_eth_rxmode rx_mode =3D {
>  	.max_rx_pkt_len =3D RTE_ETHER_MAX_LEN,
>  		/**< Default maximum frame length. */
> +	.max_lro_pkt_size =3D RTE_ETHER_MAX_LEN,

That looks like a change in current testpmd behavior, correct?
If so, is there real need for that?
Can't we have either some value for max_lro_pktlen, that would
indicate PMD to use the default value it prefers?
Or probably better to let have a separate function to set max lro size.
Then by default PMD will always use its preferred value,
and when needed user can change it via special function call.=20

>  };
>=20
>  struct rte_eth_txmode tx_mode =3D {
> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_a=
pp_ug/run_app.rst
> index 00e0c2a..721f740 100644
> --- a/doc/guides/testpmd_app_ug/run_app.rst
> +++ b/doc/guides/testpmd_app_ug/run_app.rst
> @@ -112,6 +112,11 @@ The command line options are:
>=20
>      Set the maximum packet size to N bytes, where N >=3D 64. The default=
 value is 1518.
>=20
> +*   ``--max-lro-pkt-size=3DN``
> +
> +    Set the maximum LRO aggregated packet size to N bytes, where N >=3D =
64.
> +    The default value is 1518.
> +
>  *   ``--eth-peers-configfile=3Dname``
>=20
>      Use a configuration file containing the Ethernet addresses of the pe=
er ports.
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/tes=
tpmd_app_ug/testpmd_funcs.rst
> index 9a5e5cb..9cfc82a 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -2147,6 +2147,15 @@ Set the maximum packet length::
>=20
>  This is equivalent to the ``--max-pkt-len`` command-line option.
>=20
> +port config - max-lro-pkt-size
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Set the maximum LRO aggregated packet size::
> +
> +   testpmd> port config all max-lro-pkt-size (value)
> +
> +This is equivalent to the ``--max-lro-pkt-size`` command-line option.
> +
>  port config - Drop Packets
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>=20
> --
> 1.8.3.1