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 E9D7CA0487 for ; Wed, 3 Jul 2019 13:46:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5A894C8F; Wed, 3 Jul 2019 13:46:28 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 186AA2B94; Wed, 3 Jul 2019 13:46:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2019 04:46:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,446,1557212400"; d="scan'208";a="247599628" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by orsmga001.jf.intel.com with ESMTP; 03 Jul 2019 04:46:23 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.46]) by IRSMSX109.ger.corp.intel.com ([169.254.13.220]) with mapi id 14.03.0439.000; Wed, 3 Jul 2019 12:46:21 +0100 From: "Iremonger, Bernard" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: fix to add offloads confguration for queue Thread-Index: AQHVMWPnZirMJrRUuEWj3aXPNOmh5qa4xPXA Date: Wed, 3 Jul 2019 11:46:21 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260DC1399@IRSMSX108.ger.corp.intel.com> References: <1562131464-58732-1-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1562131464-58732-1-git-send-email-wei.zhao1@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2IxNWEzYzAtYWIxMS00N2Q5LTg2OTEtZmVmYWIyYWViYmY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibkJIcGdTalNkRGlVRHJBZFFIS1VsVUxrWW5seCtPc0NXdEx4VGo2b0xrYmx4SVwvV2JHYVA2UEFOSTBnRXZ0ZHIifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 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-stable] [dpdk-dev] [PATCH] app/testpmd: fix to add offloads confguration for queue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi Wei, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao > Sent: Wednesday, July 3, 2019 6:24 AM > To: dev@dpdk.org > Cc: stable@dpdk.org; Zhao1, Wei > Subject: [dpdk-dev] [PATCH] app/testpmd: fix to add offloads confguration > for queue >=20 > When adding offloads from commandline, not only port related configuratio= n > bits should be set, but also queue related offloads configuration bits, o= r it will > cause error. > For example, test in this process for ixgbe: > (1)./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4 > -- -i --portmask=3D0x1 --port-topology=3Dloop --disable-crc-strip (2)port= stop all > (3)port config all crc-strip on (4)port start all we will see "Fail to co= nfigure port > 0 rx queues" of warning info. >=20 > Fixes: 0074d02fca21 ("app/testpmd: convert to new Rx offloads API") ./devtools/check-git-log.sh -1 Is it candidate for Cc: stable@dpdk.org backport? app/testpmd: fix to add offloads confguration for queue >=20 > Signed-off-by: wei zhao > --- > app/test-pmd/cmdline.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > d1e0d44..1b2daa1 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -2047,6 +2047,7 @@ cmd_config_rx_mode_flag_parsed(void > *parsed_result, { > struct cmd_config_rx_mode_flag *res =3D parsed_result; > portid_t pid; > + int k; >=20 > if (!all_ports_stopped()) { > printf("Please stop all ports first\n"); @@ -2147,6 +2148,10 > @@ cmd_config_rx_mode_flag_parsed(void *parsed_result, > return; > } > port->dev_conf.rxmode.offloads =3D rx_offloads; > + /* Apply Rx offloads configuration */ > + for (k =3D 0; k < port->dev_info.max_rx_queues; k++) > + port->rx_conf[k].offloads =3D > + port->dev_conf.rxmode.offloads; > } >=20 > init_port_config(); > @@ -4368,6 +4373,7 @@ cmd_csum_parsed(void *parsed_result, > int hw =3D 0; > uint64_t csum_offloads =3D 0; > struct rte_eth_dev_info dev_info; > + int k; >=20 > if (port_id_is_invalid(res->port_id, ENABLED_WARN)) { > printf("invalid port %d\n", res->port_id); @@ -4443,6 > +4449,10 @@ cmd_csum_parsed(void *parsed_result, > ports[res->port_id].dev_conf.txmode.offloads &=3D > (~csum_offloads); > } > + /* Apply Tx offloads configuration */ > + for (k =3D 0; k < ports[res->port_id].dev_info.max_tx_queues; > k++) > + ports[res->port_id].tx_conf[k].offloads =3D > + ports[res- > >port_id].dev_conf.txmode.offloads; > } The above block of code seems to be duplicated 3 times in this patch. It would probably be better to put it in a function and call the function 3= times. > csum_show(res->port_id); >=20 > @@ -4565,6 +4575,7 @@ cmd_tso_set_parsed(void *parsed_result, { > struct cmd_tso_set_result *res =3D parsed_result; > struct rte_eth_dev_info dev_info; > + int k; >=20 > if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > return; > @@ -4594,6 +4605,10 @@ cmd_tso_set_parsed(void *parsed_result, > printf("TSO segment size for non-tunneled packets is %d\n", > ports[res->port_id].tso_segsz); > } > + /* Apply Tx offloads configuration */ > + for (k =3D 0; k < ports[res->port_id].dev_info.max_tx_queues; k++) > + ports[res->port_id].tx_conf[k].offloads =3D > + ports[res->port_id].dev_conf.txmode.offloads; The above block of code seems to be duplicated 3 times in this patch. >=20 > /* display warnings if configuration is not supported by the NIC */ > rte_eth_dev_info_get(res->port_id, &dev_info); @@ -4694,6 > +4709,7 @@ cmd_tunnel_tso_set_parsed(void *parsed_result, { > struct cmd_tunnel_tso_set_result *res =3D parsed_result; > struct rte_eth_dev_info dev_info; > + int k; >=20 > if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > return; > @@ -4747,6 +4763,10 @@ cmd_tunnel_tso_set_parsed(void > *parsed_result, > DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) > printf("Warning: csum set outer-ip must be set to hw > " > "if outer L3 is IPv4; not necessary for > IPv6\n"); > + /* Apply Tx offloads configuration */ > + for (k =3D 0; k < ports[res->port_id].dev_info.max_tx_queues; > k++) > + ports[res->port_id].tx_conf[k].offloads =3D > + ports[res- > >port_id].dev_conf.txmode.offloads; > } The above block of code seems to be duplicated 3 times in this patch. >=20 > cmd_reconfig_device_queue(res->port_id, 1, 1); > -- > 2.7.5 Regards, Bernard.