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 0D493A2EFC for ; Mon, 14 Oct 2019 13:25:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDDED1C1DB; Mon, 14 Oct 2019 13:25:35 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id EC66A1C1C4; Mon, 14 Oct 2019 13:25:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 04:25:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,295,1566889200"; d="scan'208";a="370102364" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga005.jf.intel.com with ESMTP; 14 Oct 2019 04:25:31 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.131]) by IRSMSX102.ger.corp.intel.com ([169.254.2.40]) with mapi id 14.03.0439.000; Mon, 14 Oct 2019 12:25:30 +0100 From: "Iremonger, Bernard" To: "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: AQHVgL1MtUKeV2S76EuWXPCIkcThnKdaAYWQ Date: Mon, 14 Oct 2019 11:25:30 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260E0C9BB@IRSMSX108.ger.corp.intel.com> References: <22fa727a2ce09834133530c40cb02666e0be10ba.1570882485.git.ting.xu@intel.com> In-Reply-To: <22fa727a2ce09834133530c40cb02666e0be10ba.1570882485.git.ting.xu@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: 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 >=20 > 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 erro= r > when config crc_strip. >=20 > 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". >=20 > Fixes: e5db17a1e54e ("app/testpmd: remove duplicated Rx offload > commands") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ting Xu > --- > app/test-pmd/cmdline.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > 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; >=20 > + if (!strcmp(name, "crc_strip")) > + name =3D "keep_crc"; > + > 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; >=20 > 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; >=20 > 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; 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 Regards, Bernard.