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 542B8A2EFC for ; Tue, 15 Oct 2019 03:03:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 222FB1C2DD; Tue, 15 Oct 2019 03:03:17 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 3CEF31C2C0; Tue, 15 Oct 2019 03:03:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 18:03:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,297,1566889200"; d="scan'208";a="208076362" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 14 Oct 2019 18:03:14 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 18:03:13 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 14 Oct 2019 18:03:13 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.119]) by SHSMSX152.ccr.corp.intel.com ([10.239.6.52]) with mapi id 14.03.0439.000; Tue, 15 Oct 2019 09:03:11 +0800 From: "Xu, Ting" To: "Iremonger, Bernard" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Wu, Jingjing" , "stable@dpdk.org" Thread-Topic: [PATCH v1] app/testpmd: fix CRC strip config error Thread-Index: AQHVgoIYTr854iAVj0qd7Ol+51dzeKdZfZeAgAFjWFA= Date: Tue, 15 Oct 2019 01:03:11 +0000 Message-ID: <8C448DD570D7CD459EACDF44AB3869D701924F85@SHSMSX106.ccr.corp.intel.com> References: <22fa727a2ce09834133530c40cb02666e0be10ba.1570882485.git.ting.xu@intel.com> <8CEF83825BEC744B83065625E567D7C260E0C9BB@IRSMSX108.ger.corp.intel.com> <8CEF83825BEC744B83065625E567D7C260E0CA4D@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C260E0CA4D@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] app/testpmd: fix CRC strip config error 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, Bernard, In the previous version, the command 'crc_strip' and 'keep_crc' used the sa= me macro DEV_RX_OFFLOAD_KEEP_CRC. After Commit e5db17a1e54e, "port config = all crc-strip on|off" is removed and the new command does not enable 'crc_s= trip'. So I wanted to change the name to 'keep_crc' to use DEV_RX_OFFLOAD_K= EEP_CRC for 'crc_strip'. However, since Ferruh said that the command 'crc_strip' is removed, I will = rework the code totally. Thanks! -----Original Message----- From: Iremonger, Bernard=20 Sent: Monday, October 14, 2019 7:42 PM To: Iremonger, Bernard ; Xu, Ting ; dev@dpdk.org Cc: Lu, Wenzhuo ; Wu, Jingjing ; stable@dpdk.org Subject: RE: [PATCH v1] app/testpmd: fix CRC strip config error Hi Ting, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Iremonger,=20 > Bernard > Sent: Monday, October 14, 2019 12:26 PM > To: Xu, Ting ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Wu, Jingjing=20 > ; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1] app/testpmd: fix CRC strip config=20 > error >=20 > Hi Ting, >=20 > > -----Original Message----- > > From: Xu, Ting > > Sent: Saturday, October 12, 2019 1:19 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo ; Wu, Jingjing=20 > > ; Iremonger, Bernard=20 > > ; stable@dpdk.org > > Subject: [PATCH v1] app/testpmd: fix CRC strip config error > > > > This patch fixed the bug that an error appears when config=20 > > rx_offload crc_strip using command "port config all crc-strip=20 > > on|off". The reason is that this command was removed previously.=20 > > However, the current command does not enable "crc_strip" option=20 > > properly, so that testpmd returns error when config crc_strip. > > > > In this patch, an additional operation is added to recognize "crc_strip= " > > option, since "crc_strip" and "keep_crc" are using the same flag=20 > > "DEV_RX_OFFLOAD_KEEP_CRC". The current command is "port config=20 > > rx_offload crc_strip on|off". > > > > Fixes: e5db17a1e54e ("app/testpmd: remove duplicated Rx offload > > commands") > > Cc: stable@dpdk.org > > > > Signed-off-by: Ting Xu > > --- > > app/test-pmd/cmdline.c | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > def471d97..31dbe4a07 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -18084,6 +18084,9 @@ search_rx_offload(const char *name) > > int found =3D 0; > > unsigned int bit; > > > > + if (!strcmp(name, "crc_strip")) > > + name =3D "keep_crc"; > > + I don't understand why the name is being changed from "crc_strip" to "keep_= crc" here? > > single_offload =3D 1; > > for (bit =3D 0; bit < sizeof(single_offload) * CHAR_BIT; bit++) { > > single_name =3D > > rte_eth_dev_rx_offload_name(single_offload); > > @@ -18113,6 +18116,7 @@ cmd_config_per_port_rx_offload_parsed(void > > *parsed_result, > > uint16_t nb_rx_queues; > > int q; > > int ret; > > + int res_on_off =3D 1; > > > > if (port->port_status !=3D RTE_PORT_STOPPED) { > > printf("Error: Can't config offload when Port %d " > > @@ -18131,7 +18135,11 @@ > cmd_config_per_port_rx_offload_parsed(void > > *parsed_result, > > return; > > > > nb_rx_queues =3D dev_info.nb_rx_queues; > > - if (!strcmp(res->on_off, "on")) { > > + res_on_off =3D strcmp(res->on_off, "on"); > > + > > + if (!strcmp(res->offload, "crc_strip")) > > + res_on_off =3D ~res_on_off; >=20 > It looks as if res_on_off is intended to have a value of 0 or 1. > The above line gives it a value of -1, is this intended ? >=20 > > + if (!res_on_off) { > > port->dev_conf.rxmode.offloads |=3D single_offload; > > for (q =3D 0; q < nb_rx_queues; q++) > > port->rx_conf[q].offloads |=3D single_offload; > > -- > > 2.17.1 >=20 > Regards, >=20 > Bernard. Regards, Bernard.