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 E5866A0353; Mon, 11 Nov 2019 08:40:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF0E42B83; Mon, 11 Nov 2019 08:40:43 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10067.outbound.protection.outlook.com [40.107.1.67]) by dpdk.org (Postfix) with ESMTP id 509EE2A6C for ; Mon, 11 Nov 2019 08:40:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DudCSHiHVnJbjuRGfsrmF1RDz8d7oylYgPWqdXvvazZpzfWq2Aj8XHlAUf/CKKeJxhNrYeo9WkmZ3CcXhWnl3nmdkUVmSWIPR/WBMHBQUlIIOYHBrtP8wRYd5mPOkZQfOfeCP0Gvu/pyX2mDwJrg8+k6O3PouURR87N+6tz61hTEddd8NkyDHU8lcOeCap9fOXNc3DbnReRfIBNHt9rjGXKDciJCvITgC4+pUETlH+R2soB2tbEBtgT3eSF1GWFPeEXIz0kLj9oVTVint+nC0BDYWrZLQ+nALvVIaSN9jvaDbfYJ0PVUYy9WIbicmb5KEd3FmZS+p6D3WBdPmp3s2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uVkZFIQYhudMqv17kwcgiW64G/xRWNYyAo3TcQNGXQI=; b=bKL0gvlG0JltQgFnndVh8aUoBUXp8CNe+sobMpNzZWPkw+IhkeHz0r0s/kQ58P1UkLVmFid7ANIPw6Gehx0sV1DTQ10YqY5q8pbCeFw9g3IIvX9fDlNMQbooKXCUJ0Lpel0yruk7tLfZjulf9rIJGX4uak7w+othZkeEEkzZTJ7RT2RwecmslgdyzbeoxaDth2PY7Nt+3wsB4pUjGWl+uw9Z8pyVdR0j5olpPAeFc1zIuLVhPA3Uidp4ru8lv9GK3eC52PDZZjW3xFMlenMbHOMnwnH6cwjKPwPLi0LRAbmA64+qzjZBtvq7QBOwGL3rZ/dwvM8Hu1ip0sLP2XfCLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uVkZFIQYhudMqv17kwcgiW64G/xRWNYyAo3TcQNGXQI=; b=NrG7ac/Pnwi5ELSYPKkk1yEm0CPS/CHdRlgcyqCa7FJgowOVlBhy+QvtRY+WRhqT+w7XLOoRfSNNTUDWSZ3WJpS693v/On7UdVuTRhtq/itZerfLWIRTzdFCNw+C3MMRw4gM2CMlOvE1BGDRC+aBAnFlbjBeqzTIqaPvndABB0k= Received: from AM4PR05MB3460.eurprd05.prod.outlook.com (10.171.187.153) by AM4PR05MB3140.eurprd05.prod.outlook.com (10.171.186.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.24; Mon, 11 Nov 2019 07:40:41 +0000 Received: from AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::117b:8dc0:905e:d154]) by AM4PR05MB3460.eurprd05.prod.outlook.com ([fe80::117b:8dc0:905e:d154%4]) with mapi id 15.20.2430.027; Mon, 11 Nov 2019 07:40:41 +0000 From: Dekel Peled To: "Ananyev, Konstantin" , "Mcnamara, John" , "Kovacevic, Marko" , "nhorman@tuxdriver.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , "Burakov, Anatoly" , "xuanziyang2@huawei.com" , "cloud.wangxiaoyun@huawei.com" , "zhouguoyang@huawei.com" , "Lu, Wenzhuo" , Matan Azrad , Shahaf Shuler , Slava Ovsiienko , "rmody@marvell.com" , "shshaikh@marvell.com" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "Wang, Zhihong" , "yongwang@vmware.com" , Thomas Monjalon , "Yigit, Ferruh" , "arybchenko@solarflare.com" , "Wu, Jingjing" , "Iremonger, Bernard" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5 3/3] app/testpmd: use API to set max LRO packet size Thread-Index: AQHVllPR2SV1LL+XxU+yrNGhBe58AKeFC7GAgACKyzA= Date: Mon, 11 Nov 2019 07:40:41 +0000 Message-ID: References: <2601191342CEEE43887BDE71AB97725801A8C8579F@IRSMSX104.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB97725801A8C8579F@IRSMSX104.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dekelp@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 926736fb-bb0b-409b-665f-08d7667a73d9 x-ms-traffictypediagnostic: AM4PR05MB3140:|AM4PR05MB3140: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 0218A015FA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(13464003)(14454004)(7416002)(305945005)(76176011)(7736002)(74316002)(25786009)(81166006)(81156014)(2201001)(8676002)(86362001)(229853002)(7696005)(476003)(486006)(2906002)(11346002)(446003)(33656002)(8936002)(6506007)(316002)(110136005)(9686003)(53546011)(26005)(99286004)(66946007)(64756008)(66556008)(66476007)(66446008)(55016002)(4326008)(71190400001)(71200400001)(66066001)(6436002)(2501003)(6116002)(3846002)(478600001)(186003)(52536014)(256004)(5660300002)(6246003)(76116006)(102836004)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3140; H:AM4PR05MB3460.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2OGKygA/tjl63gAIb363lsGmVvpFaKlGgPp+T0yRfHwh1x4pDrhfTLgl/doXv+iDn/a4u+qZIjLz49CmhPmyKp/LiQJFM3AHsNOu0tR4MhH2dd3N0T01HF+b+CfrYnyoXzivP0yGh7/9JYnghexPtKSqnMickRJ6WURYuh4Ob3FbaA0NFrAgV+I4Cg9hhk0VCpWaC/EtpFR/qOhumwndkLdIDsccEjxIyKcPCHj/wRfKTQWdiPq7K9Z6QAYINRGWLXJmgdvbTsdhP0L627Aj+NT9jPUwMt4lk87Yxklu1smbg1k8SDniySpmrgztufbPmFfqCqRbvu9+Tiwf5DCPWJP/b22EORbRhxcHN33TWCxa5NwW1tY4Ifom1HGAqsEmN90a+zKEuP3tE+8E3/AKMXq5I0dMEsmc8Ssn+sVZ+FM7/RAEmp6olmQjyFKWy0ob Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 926736fb-bb0b-409b-665f-08d7667a73d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2019 07:40:41.0396 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YXhEtYvY8GafbZZohZiRtmIxJGtQxDvii/GDu9+DHL2TxGX6grWrItdkzHKCc+tsR1ZtXUpDJoWfHQKvX2o+tA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3140 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thanks, PSB. > -----Original Message----- > From: Ananyev, Konstantin > Sent: Monday, November 11, 2019 1:11 AM > To: Dekel Peled ; Mcnamara, John > ; Kovacevic, Marko > ; nhorman@tuxdriver.com; > ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; Burakov, > Anatoly ; xuanziyang2@huawei.com; > cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; Lu, Wenzhuo > ; Matan Azrad ; Shahaf > Shuler ; Slava Ovsiienko > ; rmody@marvell.com; > shshaikh@marvell.com; maxime.coquelin@redhat.com; Bie, Tiwei > ; Wang, Zhihong ; > yongwang@vmware.com; Thomas Monjalon ; Yigit, > Ferruh ; arybchenko@solarflare.com; Wu, Jingjing > ; Iremonger, Bernard > > Cc: dev@dpdk.org > Subject: RE: [PATCH v5 3/3] app/testpmd: use API to set max LRO packet si= ze >=20 >=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. > > > > Signed-off-by: Dekel Peled > > Acked-by: Bernard Iremonger > > Acked-by: Matan Azrad > > --- > > 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(+) > > > > 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" > > > > + "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 { > > }, > > }; > > > > +/* *** 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 ", > > + .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, > const 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 > allocated " > > "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 > addresses " > > "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, >=20 > 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 This is to keep consistent with max_rx_pkt_len use. > > }; > > > > struct rte_eth_txmode tx_mode =3D { > > diff --git a/doc/guides/testpmd_app_ug/run_app.rst > > b/doc/guides/testpmd_app_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: > > > > Set the maximum packet size to N bytes, where N >=3D 64. The defau= lt > value is 1518. > > > > +* ``--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`` > > > > Use a configuration file containing the Ethernet addresses of the = peer > ports. > > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > b/doc/guides/testpmd_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:: > > > > This is equivalent to the ``--max-pkt-len`` command-line option. > > > > +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 > > ~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > -- > > 1.8.3.1