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 D5DABA2EFC for ; Mon, 14 Oct 2019 13:41:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B6A11C206; Mon, 14 Oct 2019 13:41:53 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3BD681C203; Mon, 14 Oct 2019 13:41:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 04:41:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,295,1566889200"; d="scan'208";a="346739311" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga004.jf.intel.com with ESMTP; 14 Oct 2019 04:41:49 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.131]) by IRSMSX154.ger.corp.intel.com ([169.254.12.170]) with mapi id 14.03.0439.000; Mon, 14 Oct 2019 12:41:48 +0100 From: "Iremonger, Bernard" To: "Iremonger, Bernard" , "Xu, Ting" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Wu, Jingjing" , "stable@dpdk.org" Thread-Topic: [PATCH v1] app/testpmd: fix CRC strip config error Thread-Index: AQHVgL1MtUKeV2S76EuWXPCIkcThnKdaAYWQgAAFN4A= Date: Mon, 14 Oct 2019 11:41:47 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260E0CA4D@IRSMSX108.ger.corp.intel.com> References: <22fa727a2ce09834133530c40cb02666e0be10ba.1570882485.git.ting.xu@intel.com> <8CEF83825BEC744B83065625E567D7C260E0C9BB@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C260E0C9BB@IRSMSX108.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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDQ4ZTEwODktZDA2NC00NTY4LTg2NGYtNGM3ZjUyN2I4YjY5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoia0xZVTFIRmNVdEhoTFdSNDhkRlNGSXk5aDVWV3g5QUlCVGM5OXkyVEFHcWMxcktlMmttMW9DNEs4OWNLakRBUiJ9 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 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 Ting, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Iremonger, Bernard > Sent: Monday, October 14, 2019 12:26 PM > To: Xu, Ting ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Wu, Jingjing > ; stable@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1] app/testpmd: fix CRC strip config erro= r >=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 > > ; Iremonger, Bernard > > ; stable@dpdk.org > > Subject: [PATCH v1] app/testpmd: fix CRC strip config error > > > > This patch fixed the bug that an error appears when config rx_offload > > crc_strip using command "port config all crc-strip on|off". The reason > > is that this command was removed previously. However, the current > > command does not enable "crc_strip" option 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 > > "DEV_RX_OFFLOAD_KEEP_CRC". The current command is "port config > > 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.